Revert "Delegate everything to the generator" #532

Merged
merged 1 commit into from May 12, 2011

Conversation

Projects
None yet
3 participants
Member

amatsuda commented May 12, 2011

Because rake rails:update:scripts fails due to this change.

@amatsuda amatsuda Revert "Delegate everything to the generator"
This reverts commit 0904e82.

reason: rake rails:update:scripts fails due to this change
00379ee
Member

josevalim commented May 12, 2011

Thanks for the pull request. But why rake rails:update:scripts fail? What is the backtrace?

Member

amatsuda commented May 12, 2011

Here's the back trace

** Execute rails:update:scripts
rake aborted!
undefined method`to_str' for 493:Fixnum
/Users/a_matsuda/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/fileutils.rb:1395:in `fu_list'
/Users/a_matsuda/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/fileutils.rb:1395:in`map'
/Users/a_matsuda/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/fileutils.rb:1395:in `fu_list'
/Users/a_matsuda/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/1.8/fileutils.rb:872:in`chmod'
/Users/a_matsuda/.rvm/gems/ruby-1.8.7-p334/gems/rake-0.8.7/lib/rake.rb:1094:in `chmod'
/Users/a_matsuda/src/rails/railties/lib/rails/generators/rails/app/app_generator.rb:96:in`script'
/Users/a_matsuda/src/rails/railties/lib/rails/generators/app_base.rb:90:in `send'
/Users/a_matsuda/src/rails/railties/lib/rails/generators/app_base.rb:90:in`build'
/Users/a_matsuda/src/rails/railties/lib/rails/generators/rails/app/app_generator.rb:199:in `create_script_files'
/Users/a_matsuda/src/rails/railties/lib/rails/tasks/framework.rake:40:in`send'
/Users/a_matsuda/src/rails/railties/lib/rails/tasks/framework.rake:40:in `invoke_from_app_generator'
/Users/a_matsuda/src/rails/railties/lib/rails/tasks/framework.rake:68

chmod here https://github.com/rails/rails/blob/master/railties/lib/rails/generators/rails/app/app_generator.rb#L96 expects Thor's chmod method to be invoked, but actually delegated to FileUtils.chmod since:
AppBuilder class includes FileUtils in its ancestors
-> AppBuilder responds_to chmod
-> Rails::ActionMethods#method_missing would never be called

@josevalim josevalim added a commit that referenced this pull request May 12, 2011

@josevalim josevalim Merge pull request #532 from amatsuda/update_script
Revert "Delegate everything to the generator"
b210d9e

@josevalim josevalim merged commit b210d9e into rails:master May 12, 2011

Is this trace needed? The suite is pretty noisy.

Member

amatsuda replied May 13, 2011

Oops. I'm sorry I didn't notice that.
Sent another pull request removing the noise #537
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment