repo_miner 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/README.md +9 -0
- data/lib/repo_miner.rb +2 -2
- data/lib/repo_miner/repository.rb +4 -3
- data/lib/repo_miner/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: 79ca893738983fde2915ffd07fbbea2ac46ed331
|
4
|
+
data.tar.gz: 6f879d2ca48825f551fe0ddcccc973519b6bb059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12b3b6adc619fa8238eca5170225a0cfb32b91ab22925228c9c58c4cc642996878cedeb4e333d8308204db86c21b13b377871c18f0f4649be54324b706183d59
|
7
|
+
data.tar.gz: '09a3c002cc25e35fc6daa133c04e93ae67042776850e66ca5c01829663d4eaf54212c21f2731a91411244ef48ea85355acaf36d467d59df52345bc8d9ab3c9c1'
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.3.0] - 2017-07-20
|
8
|
+
### Added
|
9
|
+
- Add ability to skip previously analsyed commits
|
10
|
+
|
11
|
+
|
12
|
+
## [0.2.2] - 2017-07-19
|
13
|
+
### Added
|
14
|
+
- timestamp as method on commit
|
15
|
+
|
16
|
+
|
17
|
+
## [0.2.1] - 2017-07-17
|
18
|
+
### Added
|
19
|
+
- Contribution documentation and changelog
|
20
|
+
- Badges to readme
|
21
|
+
|
22
|
+
### Changed
|
23
|
+
- Improve #inspect output
|
24
|
+
- Kind of manifest (manifest or lockfile) to dependency mining return data
|
25
|
+
|
26
|
+
|
7
27
|
## [0.2.0] - 2017-07-17
|
8
28
|
### Added
|
9
29
|
- Parsing of modified dependency manifest files
|
data/README.md
CHANGED
@@ -50,9 +50,18 @@ commits = repository.analyse('master')
|
|
50
50
|
See mined dependency data for a given commit:
|
51
51
|
|
52
52
|
```ruby
|
53
|
+
commits.length #=> 34
|
54
|
+
|
53
55
|
commits.last #=> <RepoMiner::Commit:0x007fd87fdf1150(message: "Fixes 1597", sha: c656e48ada19c6c83f7705893f0a73cfc1844abf, data: {:email=>{:committer=>"andrewnez@gmail.com", :author=>"andrewnez@gmail.com"}, :dependencies=>{:added_manifests=>[], :modified_manifests=>[{:path=>"Gemfile", :platform=>"rubygems", :added_dependencies=>[], :modified_dependencies=>[], :removed_dependencies=>[{:name=>"sass", :requirement=>"= 3.4.24", :type=>:runtime}]}, {:path=>"Gemfile.lock", :platform=>"rubygems", :added_dependencies=>[{:name=>"sass-listen", :requirement=>"4.0.0", :type=>"runtime"}], :modified_dependencies=>[{:name=>"commonmarker", :requirement=>"0.16.8", :type=>"runtime", :previous_requirement=>"0.16.7"}, {:name=>"gitlab", :requirement=>"4.2.0", :type=>"runtime", :previous_requirement=>"4.1.0"}, {:name=>"rack-cors", :requirement=>"1.0.0", :type=>"runtime", :previous_requirement=>"0.4.1"}, {:name=>"sass", :requirement=>"3.5.1", :type=>"runtime", :previous_requirement=>"3.4.24"}, {:name=>"sassc", :requirement=>"1.11.4", :type=>"runtime", :previous_requirement=>"1.11.2"}], :removed_dependencies=>[]}], :removed_manifests=>[]}})>
|
54
56
|
```
|
55
57
|
|
58
|
+
You can also skip commits that you've already analysed:
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
commits = repository.analyse('master', '00e7221')
|
62
|
+
commits.length # => 9
|
63
|
+
```
|
64
|
+
|
56
65
|
## Development
|
57
66
|
|
58
67
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/repo_miner.rb
CHANGED
@@ -9,7 +9,7 @@ end
|
|
9
9
|
require 'rugged'
|
10
10
|
|
11
11
|
module RepoMiner
|
12
|
-
def self.analyse(repo_path, branch = 'master')
|
13
|
-
Repository.new(repo_path).analyse(branch)
|
12
|
+
def self.analyse(repo_path, branch = 'master', since = nil)
|
13
|
+
Repository.new(repo_path).analyse(branch, since)
|
14
14
|
end
|
15
15
|
end
|
@@ -11,15 +11,16 @@ module RepoMiner
|
|
11
11
|
@repository ||= Rugged::Repository.new(repo_path)
|
12
12
|
end
|
13
13
|
|
14
|
-
def walk(branch)
|
14
|
+
def walk(branch, since = nil)
|
15
15
|
@walker = Rugged::Walker.new(rugged_repository)
|
16
16
|
@walker.sorting(Rugged::SORT_TOPO | Rugged::SORT_REVERSE)
|
17
|
+
@walker.hide(rugged_repository.lookup(since)) if since
|
17
18
|
@walker.push(rugged_repository.branches[branch].target_id)
|
18
19
|
@walker
|
19
20
|
end
|
20
21
|
|
21
|
-
def analyse(branch = 'master')
|
22
|
-
walk(branch).map do |commit|
|
22
|
+
def analyse(branch = 'master', since = nil)
|
23
|
+
walk(branch, since).map do |commit|
|
23
24
|
Commit.new(self, commit).analyse
|
24
25
|
end
|
25
26
|
end
|
data/lib/repo_miner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repo_miner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rugged
|