Skip to content

Commit

Permalink
Merge pull request rails#532 from amatsuda/update_script
Browse files Browse the repository at this point in the history
Revert "Delegate everything to the generator"
  • Loading branch information
josevalim committed May 12, 2011
2 parents 2bff301 + 00379ee commit b210d9e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions railties/lib/rails/generators/rails/app/app_generator.rb
Expand Up @@ -9,11 +9,21 @@ def initialize(generator)
@options = generator.options
end

private
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

def method_missing(meth, *args, &block)
@generator.send(meth, *args, &block)
end
# 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
end

# The application builder allows you to override elements of the application
Expand Down

0 comments on commit b210d9e

Please sign in to comment.