Permalink
Browse files

second commit!

  • Loading branch information...
1 parent a1228a1 commit 37a2e7f311a959430b49e8642d3a69d2d739dc77 @jugyo committed Feb 21, 2010
View
@@ -9,4 +9,5 @@ Sample of rails3 generator
`-- foo # directory of "foo generator"
|-- foo_generator.rb # script of "foo generator"
`-- templates # directory of templates (specified as "source_root" in foo_generator.rb)
- `-- foo # foo!
+ `-- foo.rb
+ `-- bar.rb
@@ -2,13 +2,11 @@
class FooGenerator < Rails::Generators::Base
def self.source_root
- @_foo_source_root ||=
- File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
+ @_foo_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
end
def install
- copy_file(
- 'foo'
- )
+ copy_file('foo.rb', 'lib/foo.rb') # copy foo.rb to lib/
+ copy_file('bar.rb', 'app/models/bar.rb') # copy bar.rb to app/models/
end
end
@@ -0,0 +1 @@
+bar!

0 comments on commit 37a2e7f

Please sign in to comment.