Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotate --exclude tests,fixtures,factories throw exception in v2.6.0 #152

Closed
tejanium opened this issue Dec 4, 2013 · 14 comments
Closed
Assignees
Labels
Milestone

Comments

@tejanium
Copy link

tejanium commented Dec 4, 2013

I no longer can annotate my models with --exclude tests,fixtures,factories argument, it now throw exception in v2.6.0

$(my_gems_path)/annotate-2.6.0/bin/annotate:142:in `<top (required)>': invalid argument: --exclude tests,fixtures,factories (OptionParser::InvalidArgument)
@bunnymatic
Copy link
Contributor

I ran into this as well. in addition, using the shortcut -e tests,fixtures gives an error. Not sure if it's related but it could be. I'll try to look into it.

bin/annotate:123:in `block (2 levels) in <top (required)>': undefined method `each' for nil:NilClass (NoMethodError)
from /Users/jon/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/optparse.rb:1395:in `call'
from /Users/jon/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/optparse.rb:1395:in `block in parse_in_order'
from /Users/jon/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/optparse.rb:1351:in `catch'
from /Users/jon/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/optparse.rb:1351:in `parse_in_order'
from /Users/jon/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/optparse.rb:1345:in `order!'
from /Users/jon/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/optparse.rb:1437:in `permute!'
from /Users/jon/.rbenv/versions/2.0.0-p353/lib/ruby/2.0.0/optparse.rb:1459:in `parse!'

@kris
Copy link

kris commented Dec 10, 2013

I'm experiencing the same issue.

@esbanarango
Copy link

Same here!

@chrismhilton
Copy link

+1

@ghost ghost assigned ctran Dec 21, 2013
@mostafahussein
Copy link

the bundle install shows Using annotate (2.6.1)
same issue here
invalid argument: --exclude tests,fixtures,factories (OptionParser::InvalidArgument)
but it works in case of using this
annotate -e tests,fixtures,factories

@bunnymatic
Copy link
Contributor

Looks like they've built a new version (https://rubygems.org/gems/annotate) which has a fix merged in.

Try updating annotate and see if that doesn't fix the issues

@ctran
Copy link
Owner

ctran commented Jan 2, 2014

Looks like the PR didn't actually fix this issue. I have a fix in the "develop" branch that I'll release soon if someone can verify that it works for you.

@bunnymatic
Copy link
Contributor

Weird. I just tried 2.6.1 and it looks like my fix worked if you were using the shortcut (-e) but not the full option (--exclude).

sorry about that. glad there is another fix on the way.

@superscott
Copy link

@bunnymatic yeah using github as source in Gemfile, had the same experience. --exclude breaks, -e works.
osx/rvm/ruby2.1/rails4

annotate --exclude tests,fixtures,factories -p after
/.rvm/gems/ruby-2.1.0@rails4/bundler/gems/annotate_models-eb633bcf19c6/bin/annotate:143:in `<top (required)>':    invalid argument: --exclude tests,fixtures,factories (OptionParser::InvalidArgument)
  from /.rvm/gems/ruby-2.1.0@rails4/bin/annotate:23:in `load'
  from /.rvm/gems/ruby-2.1.0@rails4/bin/annotate:23:in `<main>'
  from /.rvm/gems/ruby-2.1.0@rails4/bin/ruby_executable_hooks:15:in `eval'
 from /.rvm/gems/ruby-2.1.0@rails4/bin/ruby_executable_hooks:15:in `<main>'

@ctran
Copy link
Owner

ctran commented Jan 16, 2014

How are you using github as source? Make sure to use the "develop" branch specifier.

@superscott
Copy link

@ctran How? gem 'annotate', :github => 'ctran/annotate_models', :branch => 'develop'

But you're right, using the develop branch fixed the --exclude error, so works for me now. Thank you!

@josselinauguste
Copy link

Works for me too with the latest develop branch!

@nocache
Copy link

nocache commented Jan 29, 2014

latest develop branch fixes issue for me too. :shipit:

@justin808
Copy link

This is a workaround for zsh

   annotate -e \[tests\] -i

ctran pushed a commit that referenced this issue Feb 26, 2014
* release/2.6.2:
  v2.6.2
  Add known changes for 2.6.2.
  Retain existing position unless :force is passed
  Temporarily ignore integration tests
  Revert "Replacing old block with new one."
  Change email address
  Add .travis.yml
  switch deprecated "mock" for "double" in annotate specs
  use general file resolution for test files as well
  Replacing old block with new one.
  Fixed gemspec files attribute
  migrate.rake should live in lib/tasks
  Always load models, since they may not be autoloaded by Rails
  Handle the "--exclude" option correctly, #152 and #160
  FIX #157
  Pump version to 2.6.1 which fixes #22
@ctran ctran closed this as completed Feb 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests