Comments (8)
Ok, I hardcoded the version manually where needed and I was able to use it.
But, I was hoping this would output the actual changes done to a function, not just the commit keys.
method_log HubWebhookController#handle_book
commit c60b868d81a08d052e2e06ad0a89cf921ba4adbf
Author: jgd <[email protected]>
Date: Thu Aug 1 17:23:22 2019 +0300
fix book unsafe_h
commit 6dfb05221468193bf61c1f9554420a5b91f49209
Author: jgd <[email protected]>
Date: Fri May 24 14:07:46 2019 +0300
changes for rails 5.1.6 and ruby 2.5.5
...
Or then it is not working as expected?
from method_log.
So I "fixed" it by adding a puts diff to the diffs method in api.rb
I guess there's a proper way to do it, but just for me...
unless diff.empty?
yielder << [commit, diff]
puts diff
end
Very useful gem. Thanks!
from method_log.
Just installed this gem on OSX 10.11.6
But I get the next error.method_log Traceback (most recent call last): 9: from /Users/jgd/.rvm/gems/[email protected]/bin/ruby_executable_hooks:24:in `<main>' 8: from /Users/jgd/.rvm/gems/[email protected]/bin/ruby_executable_hooks:24:in `eval' 7: from /Users/jgd/.rvm/gems/[email protected]/bin/method_log:23:in `<main>' 6: from /Users/jgd/.rvm/gems/[email protected]/bin/method_log:23:in `load' 5: from /Users/jgd/.rvm/gems/[email protected]/gems/method_log-0.2.0/bin/method_log:6:in `<top (required)>' 4: from /Users/jgd/.rvm/gems/[email protected]/gems/optimist-3.0.0/lib/optimist.rb:921:in `options' 3: from /Users/jgd/.rvm/gems/[email protected]/gems/optimist-3.0.0/lib/optimist.rb:921:in `new' 2: from /Users/jgd/.rvm/gems/[email protected]/gems/optimist-3.0.0/lib/optimist.rb:103:in `initialize' 1: from /Users/jgd/.rvm/gems/[email protected]/gems/optimist-3.0.0/lib/optimist.rb:103:in `call' /Users/jgd/.rvm/gems/[email protected]/gems/method_log-0.2.0/bin/method_log:7:in `block in <top (required)>': uninitialized constant MethodLog::VERSION (NameError)
Any hints?
Thanks for trying out the gem and for the bug report. I'll push up a fix shortly.
from method_log.
So I "fixed" it by adding a puts diff to the diffs method in api.rb
I guess there's a proper way to do it, but just for me...unless diff.empty? yielder << [commit, diff] puts diff end
Very useful gem. Thanks!
Did you try the --patch
option for the method_log
command?
$ method_log --help
Display the commit history for a single method.
Usage:
method_log [options] <method-signature>
where <method-signature> is in the Ruby Index format e.g. Foo#bar, Bar::Baz#foo, Baz.foo.
and [options] are:
-p, --patch Generate patch.
-r, --ruby-version=<s> Parser Ruby version (e.g. 2.5) (default: current)
-n, --max-count=<i> Limit the number of commits to output.
-s, --stop-at-latest-introduction-of-method, --no-stop-at-latest-introduction-of-method Stop at lastest introduction of method. (Default: true)
-e, --repository-path=<s> Path to repository (default: /private/tmp/wem)
-v, --version Print version and exit
-h, --help Show this message
from method_log.
@josegrad Out of interest did you manage to use the tool to successfully find what you were looking for in the git repository in question? Did the query take long to run? Do you have any other feedback?
from method_log.
Thanks for trying out the gem and for the bug report. I'll push up a fix shortly.
Fixed in new release, v0.2.1.
from method_log.
Did you try the --patch option
Ha. Not until now. I did see it, but "Generate patch" didn't sound like what I was looking for. "Print code" would have done it :-)
@josegrad Out of interest did you manage to use the tool to successfully find what you were looking for in the git repository in question? Did the query take long to run? Do you have any other feedback?
Yes, it did the job. I was able to check all the changes made to a function, and find exactly when I introduced the bug I was trying to fix :-)
It didn't take too long. And it is printing it out as it finds the changes, so I wouldn't be too worried about that. After all it took more than one hour to install the gem into OSX, but it was because of missing cmake. So after that it felt really fast.
I can't come with anything else at this point. I'm glad I found this gem, can be handy in the future.
from method_log.
Did you try the --patch option
Ha. Not until now. I did see it, but "Generate patch" didn't sound like what I was looking for. "Print code" would have done it :-)
Ah, OK. I based it on the --patch
option for the git log
command.
@josegrad Out of interest did you manage to use the tool to successfully find what you were looking for in the git repository in question? Did the query take long to run? Do you have any other feedback?
Yes, it did the job. I was able to check all the changes made to a function, and find exactly when I introduced the bug I was trying to fix :-)
It didn't take too long. And it is printing it out as it finds the changes, so I wouldn't be too worried about that. After all it took more than one hour to install the gem into OSX, but it was because of missing cmake. So after that it felt really fast.
I can't come with anything else at this point. I'm glad I found this gem, can be handy in the future.
Oh, cool. I'm glad it solved your problem. Thanks for the feedback!
from method_log.
Related Issues (15)
- gem install fails HOT 2
- Try using in-memory backend to improve performance
- Replace deprecated trollop gem with optimist gem HOT 1
- Add parsing support for RSpec tests
- Default to looking for commits in current git branch
- Check what happens with merge commits
- Find "similar" method implementations in a codebase
- Add command-line progress bar for each commit processed in build_methods_repo script
- Extract MethodFinder into its own gem
- Optimisation: Stop parsing when method definition is found
- Use Rugged::Diff vs diffy gem HOT 1
- Submit PR to parser gem to expose last line number on Parser::Source::Buffer
- Convert into git extension; ideally extend git-log command
- Build a "database" of method metadata vs commits HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from method_log.