turboladen / tailor

A RubyGem that allows for checking standard styling of Ruby files.
146 stars 18 forks source link

Rake Task Does Not Work #127

Closed kevinjalbert closed 11 years ago

kevinjalbert commented 11 years ago

I am currently trying to integrate tailor into my Ruby Project - git_statistics to help with consistent styling.

For some reason, even when following the instructions in the readme we're unable to get the tailor rake task to work correctly. We have set up a .tailor and added the tailor task. When I execute tailor I get the expected results (style warnings for the source code), but with rake tailor I get nothing (i.e., no files are checked, but tailor runs). Both of these commands should be executing based off of the same .tailor file.

The following are the versions for my environment:

turboladen commented 11 years ago

Looks like the RakeTask class wasn't using the configuration in the right way. I've fixed it and am working on adding a test for this.

kevinjalbert commented 11 years ago

Ah okay. I was just wondering if there was a problem on my end or with the gem's rake task. Look forward to the fix soon :smile:.

kevinjalbert commented 11 years ago

@turboladen Seems like your latest gem version 1.1.4 works! The only thing is now when I run the rake task I end up getting the following output at the ending.

exit (SystemExit)
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362/gems/tailor-1.1.4/lib/tailor/rake_task.rb:96:in `exit'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362/gems/tailor-1.1.4/lib/tailor/rake_task.rb:96:in `block in define_task'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/task.rb:228:in `call'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/task.rb:228:in `block in execute'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/task.rb:223:in `each'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/task.rb:223:in `execute'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/task.rb:166:in `block in invoke_with_call_chain'
/Users/jalbert/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/task.rb:159:in `invoke_with_call_chain'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/task.rb:152:in `invoke'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:143:in `invoke_task'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:101:in `each'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:101:in `block in top_level'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:110:in `run_with_threads'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:95:in `top_level'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:73:in `block in run'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362@global/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362/bin/rake:19:in `load'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362/bin/rake:19:in `<main>'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `eval'
/Users/jalbert/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `<main>'

I'm not really sure why this is the case. Looks like it is the exit code return is always failing regardless of whether it is running successfully or not. At least that is what I am seeing, do you get the same results? Or can you suggest something?

turboladen commented 11 years ago

That's not good. :) I'm only seeing it exit like that when there's failures. I did remove a rescue of this, but was thinking that was necessary for the rake task. If I add that back in, my tests still all pass, which means I need to figure out how to test this case properly. I'll check the change in and figure out the testing before doing another release--would you mind pulling down the repo and giving it a whirl so I can make sure it's working for you before I push out another release?

turboladen commented 11 years ago

Added back rescue of SystemExit cc0468c57d4619f6bb030a9a9e70423b796796de

kevinjalbert commented 11 years ago

@turboladen Works perfectly now with tailor v1.1.5! Thanks for the quick work on this issue.

turboladen commented 11 years ago

Whew! My pleasure.

On Feb 3, 2013, at 10:59, Kevin Jalbert notifications@github.com wrote:

@turboladen https://github.com/turboladen Works perfectly now with tailor v1.1.5! Thanks for the quick work on this issue.

— Reply to this email directly or view it on GitHubhttps://github.com/turboladen/tailor/issues/127#issuecomment-13051711.