method_log 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a64a5c77324253051cdea911808a4d26fbcf07a
4
- data.tar.gz: 8cf7ac058dea844d6ffbcfff7e87ce7d64bd91bf
3
+ metadata.gz: 8806c3155ef8119ce8144d2de6224cb9ec8c4cfb
4
+ data.tar.gz: 223707b63c5ee375fc0a6735cd9a04a85361952a
5
5
  SHA512:
6
- metadata.gz: c1a4955bc308e0e733e3f156f44ba796a2ce639660f4988a87949ef7ab6ef85b0dd1975f540c96386cac17ff72ef912700da0d2f3477d863ff5eb6b3b2f428ea
7
- data.tar.gz: 7176a109612715acd7b7e57f35800bb2c4c533ccf82b56ccd40dd305f67b0cc9a0f1d96cafa7233bcf24c1f9ae7e168031dd730c5b9e29e4e4b1367a6d85aa7e
6
+ metadata.gz: 88c75c7ba8f9f1fe97257c873200c5e793c32a62060b1b01a4016c665b85ad3f4f8924f772903aebf0b8506cd2c701aaa90f757d1c04796184b2f005182a4524
7
+ data.tar.gz: c1306ec22ca0401966bc6d66a5ebb695bde5acd85016b1edcf6f95922901a29822333c83055d868e61db2b1c1c6c7600bda9928df5e2c7e76c7a39d1ab02aefa
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.0
4
+ - 2.0.0
5
+
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- ruby '2.1.0'
4
-
5
3
  gemspec
data/README.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  Trace the history of an individual method in a git repository.
4
4
 
5
+ This is a work-in-progress and nowhere near production-ready.
6
+
7
+ ### Dependencies
8
+
9
+ * Ruby >= v2.0.0 (just because I'm using named parameters)
10
+ * The [rugged](https://github.com/libgit2/rugged) Ruby gem (listed as dependency in gemspec)
11
+ * The [libgit2](https://github.com/libgit2/libgit2) C library (included as part of rugged gem)
12
+
5
13
  ### Install
6
14
 
7
15
  gem install method_log
@@ -12,7 +20,7 @@ Trace the history of an individual method in a git repository.
12
20
 
13
21
  ### Todo
14
22
 
15
- * Support earlier versions of Ruby
23
+ * Support earlier versions of Ruby (it ought to be possible to support down to v1.9.3 fairly easily)
16
24
  * Support class methods
17
25
  * Support namespaced classes e.g. `class Foo::Bar`
18
26
  * Support for Rspec tests
data/bin/method_log CHANGED
@@ -5,9 +5,9 @@ require 'method_log'
5
5
  require 'method_log/repository'
6
6
  require 'method_log/api'
7
7
 
8
- repository = MethodLog::Repository.new(path: ARGV[0])
8
+ repository = MethodLog::Repository.new(path: Dir.pwd)
9
9
  api = MethodLog::API.new(repository: repository)
10
- method_commits = api.history(ARGV[1])
10
+ method_commits = api.history(ARGV[0])
11
11
  method_commits.each do |method_commit|
12
12
  puts method_commit
13
13
  end
@@ -3,7 +3,7 @@ require 'method_log/method_commit'
3
3
 
4
4
  module MethodLog
5
5
  class API
6
- def initialize(repository:)
6
+ def initialize(repository: nil)
7
7
  @repository = repository
8
8
  end
9
9
 
@@ -6,7 +6,7 @@ module MethodLog
6
6
  class Commit
7
7
  attr_reader :sha
8
8
 
9
- def initialize(repository: repository, sha: sha)
9
+ def initialize(repository: nil, sha: nil)
10
10
  @repository = repository
11
11
  @sha = sha
12
12
  @index = Rugged::Index.new
@@ -1,6 +1,6 @@
1
1
  module MethodLog
2
2
  class MethodCommit
3
- def initialize(commit:, method_definition:)
3
+ def initialize(commit: nil, method_definition: nil)
4
4
  @commit = commit
5
5
  @method_definition = method_definition
6
6
  end
@@ -1,6 +1,6 @@
1
1
  module MethodLog
2
2
  class MethodDefinition
3
- def initialize(source_file:, lines:)
3
+ def initialize(source_file: nil, lines: nil)
4
4
  @source_file = source_file
5
5
  @lines = lines
6
6
  end
@@ -4,7 +4,7 @@ require 'method_log/method_definition'
4
4
 
5
5
  module MethodLog
6
6
  class MethodFinder < Ripper
7
- def initialize(source_file:)
7
+ def initialize(source_file: nil)
8
8
  super(source_file.source)
9
9
  @source_file = source_file
10
10
  @namespaces = []
@@ -6,7 +6,7 @@ module MethodLog
6
6
  class Repository
7
7
  attr_reader :commits
8
8
 
9
- def initialize(path:)
9
+ def initialize(path: nil)
10
10
  @repository = Rugged::Repository.new(path)
11
11
  @commits = []
12
12
  if @repository.ref('refs/heads/master')
@@ -3,7 +3,7 @@ module MethodLog
3
3
  attr_reader :path
4
4
  attr_reader :source
5
5
 
6
- def initialize(path:, source:)
6
+ def initialize(path: nil, source: nil)
7
7
  @path = path
8
8
  @source = source
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module MethodLog
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -4,7 +4,7 @@ require 'method_log/source_file'
4
4
  require 'method_log/method_definition'
5
5
 
6
6
  describe MethodLog::MethodCommit do
7
- let(:commit) { MethodLog::Commit.new }
7
+ let(:commit) { MethodLog::Commit.new(sha: nil) }
8
8
  let(:source_file) { MethodLog::SourceFile.new(path: '/path/to/source.rb', source: 'source') }
9
9
  let(:method_definition) { MethodLog::MethodDefinition.new(source_file: source_file, lines: 5..7) }
10
10
  let(:method_commit) {
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-02-10 00:00:00.000000000 Z
11
+ date: 2014-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rugged
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description:
@@ -60,7 +60,8 @@ executables:
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
- - ".gitignore"
63
+ - .gitignore
64
+ - .travis.yml
64
65
  - Gemfile
65
66
  - LICENSE
66
67
  - README.md
@@ -105,17 +106,17 @@ require_paths:
105
106
  - lib
106
107
  required_ruby_version: !ruby/object:Gem::Requirement
107
108
  requirements:
108
- - - ">="
109
+ - - '>='
109
110
  - !ruby/object:Gem::Version
110
111
  version: '0'
111
112
  required_rubygems_version: !ruby/object:Gem::Requirement
112
113
  requirements:
113
- - - ">="
114
+ - - '>='
114
115
  - !ruby/object:Gem::Version
115
116
  version: '0'
116
117
  requirements: []
117
118
  rubyforge_project:
118
- rubygems_version: 2.2.0
119
+ rubygems_version: 2.0.14
119
120
  signing_key:
120
121
  specification_version: 4
121
122
  summary: Trace the history of an individual method in a git repository.