method_log 0.0.7 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/bin/method_log +1 -2
- data/lib/method_log/api.rb +1 -1
- data/lib/method_log/commit.rb +2 -2
- data/lib/method_log/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c9ece9dbca9c3d3cd0fa665a1467c7f4984e12f
|
4
|
+
data.tar.gz: 801beef47c6efa48e7501e2d875b6860a2b1359d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9791976fc166cd947c08572fc17b6ca8d9bd95e8889c09195d4640fef1791363f8557b56c9a7dc6e7ce53289b4678007bb4a0af8c1cbd82212a09e6db7725be
|
7
|
+
data.tar.gz: 4a292a85258e169a3b0e05523c9acda795b9f2df604b6aab36b3d42b98e269696d2c9ab5f5efa79e6dad626d91a80c82a7db26f2438384c0bdd180f652875584
|
data/README.md
CHANGED
@@ -33,8 +33,6 @@ Trace the history of an individual method in a git repository (experimental).
|
|
33
33
|
* Default to looking for commits in current git branch
|
34
34
|
* Check what happens with merge commits
|
35
35
|
* Maybe add as new git command or extension to existing command e.g. `git log`
|
36
|
-
* Optimise search for method definitions:
|
37
|
-
* First look in file where method was last defined
|
38
36
|
* Find "similar" method implementations e.g. by comparing ASTs of implementations
|
39
37
|
|
40
38
|
### Credits
|
data/bin/method_log
CHANGED
data/lib/method_log/api.rb
CHANGED
@@ -17,7 +17,7 @@ module MethodLog
|
|
17
17
|
if last_source_file && commit.contains?(last_source_file)
|
18
18
|
last_method_commit.update(commit)
|
19
19
|
else
|
20
|
-
method_definition = commit.find(method_identifier)
|
20
|
+
method_definition = commit.find(method_identifier, last_source_file)
|
21
21
|
yielder << last_method_commit if last_method_commit
|
22
22
|
last_method_commit = MethodCommit.new(commit, method_definition)
|
23
23
|
yielder << last_method_commit
|
data/lib/method_log/commit.rb
CHANGED
@@ -39,10 +39,10 @@ module MethodLog
|
|
39
39
|
source_files_by_path[source_file.path] == source_file
|
40
40
|
end
|
41
41
|
|
42
|
-
def find(method_identifier)
|
42
|
+
def find(method_identifier, last_source_file = nil)
|
43
43
|
method_definition = nil
|
44
44
|
method_name = method_identifier.split(Regexp.union('#', '.')).last
|
45
|
-
source_files.each do |source_file|
|
45
|
+
source_files.sort_by { |sf| last_source_file == sf ? 1 : 0 }.each do |source_file|
|
46
46
|
next unless source_file.source[Regexp.new(method_name)]
|
47
47
|
method_finder = MethodFinder.new(source_file)
|
48
48
|
break if method_definition = method_finder.find(method_identifier)
|
data/lib/method_log/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: method_log
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Mead
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|