vcs2json 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16eb57bedbd48bc94c5b73477ac784f40d8be16b
4
- data.tar.gz: b2dcb78c8e63bc71c098f9b6642364c99bb65e2a
3
+ metadata.gz: 1628d43fb23f825bd38e025c470b378796d9f11c
4
+ data.tar.gz: a5e7a884bcdfda60a5c94816a0fadc603c3106fc
5
5
  SHA512:
6
- metadata.gz: bd1b15c85e038ae87965aae44837349c380f89eb5dda91fc91a56c6c4ed3b90159b93c70c978421e4b382c8d34c4a0faaf9e7e4e388b7d470b7e61df3cdae567
7
- data.tar.gz: e74a46888aefc4cc02d30cb23b8064c3185e140e51f9d0845ee66b9abdb434e33d63edb299e1e80b89cc5eb3218403c116250eb41c64899e4bf7a499431c0e1e
6
+ metadata.gz: a68392b573648d1db85febda70a0ee76443d0e678d0d9193997f750172412ee1db3e7023bef4b9a2ffa45c2911be0e1d01c6d67915944975b5f87597f6fef321
7
+ data.tar.gz: 4539de79de6ce53973205dcd05c42065b21607fe74b2d0b3162790519a4520214a5c8c2686970c1454221e4689ab1787523d3e8451672fff59413bdf447fb1e0
data/lib/vcs2json/git.rb CHANGED
@@ -91,7 +91,8 @@ module Vcs2Json
91
91
  commit_ids.each do |id|
92
92
  logger.debug "Parsing commit: #{id}"
93
93
  # get the changed files
94
- changed_files = `git log --pretty=format:'' --name-status #{id} -n 1`.split("\n").map {|line| line.split("\t")}
94
+ changed_files = `git log --pretty=format:'' --name-status #{id} -n 1`.split("\n")
95
+ .map {|line| line.split(/(^[AMD])\s+/).delete_if {|e| e.empty?}}
95
96
 
96
97
  # remove ignored files
97
98
  changed_files.reject! {|file|
@@ -157,15 +158,17 @@ module Vcs2Json
157
158
 
158
159
 
159
160
  changed_files.each_with_index do |(status,file_name),index|
160
- STDERR.print "Parsing file #{index+1} of #{changed_files.size} in commit #{commit_counter+1} of #{self.number} \r"
161
- if ![status,file_name].empty?
161
+ STDERR.print "Parsing file #{index+1} Of #{changed_files.size} in commit #{commit_counter+1} of #{self.number} \r"
162
+ if ([status,file_name].empty? | status.nil? | status.empty? | file_name.nil? | file_name.empty?)
163
+ # ignoring commit
164
+ else
162
165
  # add finer grained change info
163
166
  if self.fine_grained
164
167
  begin
165
168
  # new file, all methods are new, no need to calculate diff
166
169
  if status == 'A'
167
170
  SrcML.methods(file_name,revision: id).keys.each {|m| output_hash[:changes] << m}
168
- # calculate diffs
171
+ # calculate diffs
169
172
  else
170
173
  SrcML.changed_methods_git(file_name,id).each {|m| output_hash[:changes] << m}
171
174
  end
@@ -178,7 +181,7 @@ module Vcs2Json
178
181
  end
179
182
  end # changes_files.each
180
183
 
181
- # Only add commits where at least on changes was detected
184
+ # Only add commits where at least one change was detected
182
185
  if !output_hash[:changes].empty?
183
186
  ###########################
184
187
  # PRINT COMMIT TO $stdout #
@@ -1,3 +1,3 @@
1
1
  module Vcs2Json
2
- VERSION = "2.2.4"
2
+ VERSION = "2.2.5"
3
3
  end
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.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Rolfsnes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-13 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler