DamirSvrtan/fasterer

Allow the user to run on a single file

Closed this issue · 7 comments

lpil commented

Hello!

I work on some rather large codebases, and running the very cool fasterer on them results in more information than is humanly manageable. It would be nice if I could run it on a single file (the one I'm working on). i.e.

$ fasterer app/controllers/users_controller.rb

Thanks,
Louis

@lpil I had the same requirement, basically I wanted to try this out against an older ruby project, but I wouldn't be able to run this gem from that dir, because it is a much older version of ruby.

I forked, branched, and tried my hand at allowing a path or individual file to be passed in.
https://github.com/jmccaffrey/fasterer/tree/pass_in_dir

Allow a directory or individual file to be passed in

Confirmed these changes allow

  1. no args
    fasterer
  2. a completely different directory (eg. an older ruby project)
    fastener 'path/to/ruby/1.8/project'
  3. an individual file
    fastener 'my/current/bad_file.rb'

All current tests pass, but this needs more tests.
I'm commenting here just to say I also had the same interest, and I'm attempting my fix.
I'll look at the tests and then do a PR when I get some more time to try it.

You can try it out and see if it works for you if you need it asap.

git clone git@github.com:jmccaffrey/fasterer.git
cd fasterer
bundle install

switch to my branch with the changes

git checkout pass_in_dir
rake build
gem install pkg/fasterer-0.1.11.gem

try it out

fasterer 'path/to/your/stuff/'

I'll try to look at this as soon as possible.

This has been published in 0.3.0 - sorry for the extra long wait!

lpil commented

Hooray! :)

Does people use this with a git hook?

@benoittgt - check this out: #19