Skip to content

Commit

Permalink
Delegate everything to the generator
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Oct 6, 2010
1 parent 848eb0d commit 0904e82
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Expand Up @@ -14,21 +14,11 @@ def initialize(generator)
@options = generator.options
end

private
%w(template copy_file directory empty_directory inside
empty_directory_with_gitkeep create_file chmod shebang).each do |method|
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{method}(*args, &block)
@generator.send(:#{method}, *args, &block)
end
RUBY
end
private

# TODO: Remove once this is fully in place
def method_missing(meth, *args, &block)
STDERR.puts "Calling #{meth} with #{args.inspect} with #{block}"
@generator.send(meth, *args, &block)
end
def method_missing(meth, *args, &block)
@generator.send(meth, *args, &block)
end
end

class AppBuilder
Expand Down

0 comments on commit 0904e82

Please sign in to comment.