vcs2json 2.0.1 → 2.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -31
- data/lib/vcs2json/git.rb +18 -8
- data/lib/vcs2json/version.rb +1 -1
- data/lib/vcs2json_helper.rb +1 -0
- 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: e2efbda9981df490871ca8de83eb0ed5ac37f478
|
4
|
+
data.tar.gz: b6b42ca01b777d86bbdef0d3431cf014adf3c61d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf544e9717c8a183defdfc9a6a41e25eb3ae1afd15eb59db51f7d24615fd95d602fe49701e49b92d9d21715a65c282bfbfb76123d4e9c54ac0e27078e9341f1
|
7
|
+
data.tar.gz: 192e055b5e38c75bd012d90d2cdbba2bfa017e80455bfdf505318e8da2228bfb5501368a003ca27bc35251a42b32e15a074c2e72793c1ff7494b9f8cc0a8928b
|
data/README.md
CHANGED
@@ -1,41 +1,32 @@
|
|
1
|
-
|
1
|
+
## Norsk brukerveiledning
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vcs2json`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
3
|
|
5
|
-
|
4
|
+
1. Installer SrcML. Skriptet er testet på Ubuntu 14 og 16, 32 og 64 bit, OSX El Capitan.
|
6
5
|
|
7
|
-
|
6
|
+
bash <(curl -s https://bitbucket.org/evolveit/srcml_install/raw/6e11210fbe2e62d4796e0f3e2ed5c08b27f55f1c/install.sh)
|
8
7
|
|
9
|
-
|
8
|
+
2. Installer Ruby 2.3.0
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
1. Installer RVM (Ruby Version Manager)
|
11
|
+
|
12
|
+
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
|
13
|
+
|
14
|
+
\curl -sSL https://get.rvm.io | bash -s stable --ruby=2.3.0
|
14
15
|
|
15
|
-
|
16
|
+
2. Restart terminal
|
17
|
+
|
18
|
+
3. Legg til 'rvm' kommando
|
16
19
|
|
17
|
-
|
20
|
+
source ~/.rvm/scripts/rvm
|
21
|
+
|
22
|
+
4. Velg Ruby 2.3.0
|
18
23
|
|
19
|
-
|
24
|
+
rvm use ruby-2.3.0
|
25
|
+
|
26
|
+
Du skal nå ha Ruby 2.3.0, sjekk ved å kjøre:
|
27
|
+
|
28
|
+
which ruby
|
20
29
|
|
21
|
-
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vcs2json.
|
36
|
-
|
37
|
-
|
38
|
-
## License
|
39
|
-
|
40
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
30
|
+
2. Installer vcs2json
|
41
31
|
|
32
|
+
gem install vcs2json
|
data/lib/vcs2json/git.rb
CHANGED
@@ -19,6 +19,10 @@ module Vcs2Json
|
|
19
19
|
"%B"
|
20
20
|
|
21
21
|
def initialize(opts)
|
22
|
+
# case id must be set before setting ignore
|
23
|
+
# as the id is used to lookup the list of
|
24
|
+
# files to ignore in the ignorefile
|
25
|
+
self.case_id = opts[:case_id]
|
22
26
|
self.ignore = opts[:ignore]
|
23
27
|
self.before = opts[:before]
|
24
28
|
self.after = opts[:after]
|
@@ -87,9 +91,18 @@ module Vcs2Json
|
|
87
91
|
commit_ids.each do |id|
|
88
92
|
logger.debug "Parsing commit: #{id}"
|
89
93
|
# get the changed files
|
90
|
-
changed_files = `git log --pretty=format:'' --name-status #{id} -n 1`.split("\n")
|
91
|
-
|
92
|
-
|
94
|
+
changed_files = `git log --pretty=format:'' --name-status #{id} -n 1`.split("\n").map {|line| line.split("\t")}
|
95
|
+
|
96
|
+
# remove ignored files
|
97
|
+
changed_files.reject! {|file|
|
98
|
+
if self.ignore.include?(file[1])
|
99
|
+
logger.debug "[IGNOREDEBUG] Ignored #{file[1]} in commit #{id}"
|
100
|
+
true
|
101
|
+
else
|
102
|
+
false
|
103
|
+
end
|
104
|
+
}
|
105
|
+
|
93
106
|
# add files changed info
|
94
107
|
if !changed_files.empty?
|
95
108
|
|
@@ -143,12 +156,9 @@ module Vcs2Json
|
|
143
156
|
# print progress
|
144
157
|
|
145
158
|
|
146
|
-
changed_files.each_with_index do |
|
159
|
+
changed_files.each_with_index do |(status,file_name),index|
|
147
160
|
STDERR.print "Parsing file #{index+1} of #{changed_files.size} in commit #{commit_counter+1} of #{self.number} \r"
|
148
|
-
if !
|
149
|
-
file_info = line.split("\t")
|
150
|
-
file_name = file_info[1]
|
151
|
-
status = file_info[0]
|
161
|
+
if ![status,file_name].empty?
|
152
162
|
# add finer grained change info
|
153
163
|
if self.fine_grained
|
154
164
|
begin
|
data/lib/vcs2json/version.rb
CHANGED
data/lib/vcs2json_helper.rb
CHANGED
@@ -7,5 +7,6 @@ require 'chronic'
|
|
7
7
|
require 'logger' # leveled logging
|
8
8
|
require 'nokogiri' # better/faster xml library
|
9
9
|
require 'open3' # make system calls and capture stdout/stderr/exitcodes easily
|
10
|
+
require 'yaml' # parse yaml files
|
10
11
|
require 'require_all'
|
11
12
|
require_rel '/**/*.rb'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vcs2json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Rolfsnes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|