gistory 0.1.5 → 0.1.6

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
- SHA1:
3
- metadata.gz: f15e11803f6e91bfb1af57610267737d808406fb
4
- data.tar.gz: fd36322d7caa39a74a17843f6604c721906e8cdb
2
+ SHA256:
3
+ metadata.gz: 72836cca18fd26cede97fde21b76c9ae225356751cec131e9631e8c746241a26
4
+ data.tar.gz: a62e021cc1fbf194f00e84722a89c7a05bc7eb152edf4c15f1d70531a1e986e4
5
5
  SHA512:
6
- metadata.gz: 00de34130a52fcd49e7cfe8de998fd80e16307b8e62b24d357f551a27fe3eebd4b98599c354bcf51ab2cb7b9d8fc8d28c856d66ae6d5e37bab5ff3f7d40fbd55
7
- data.tar.gz: 18fc83ae3593944d3fe8f8b7476494c1d4272baa3c162c3d09b5feed21bf1813f7bd1ca93e786cd3bf26ce87ffebf3ad7eab4317045f604bcca893c5c3c67d23
6
+ metadata.gz: b95cb0e28c162937b8533768d719050ae756117d2def8ba552b906636e00e282f983a1bae36860ce4afc2a7f5b3a9cbaea91873b71ce5fb24b9cf43f1f2a0707
7
+ data.tar.gz: d3f43852128ca25fa2619084b3916f54cda3ba30999a208b025329c57f7dce48d04f3ac5247056ff8a0c61abc369d80dafd5af932a0e3f8410982c6d33b2ce7d
@@ -1,18 +1,30 @@
1
- Metrics/LineLength:
2
- Max: 120
3
-
4
1
  Documentation:
5
2
  Enabled: false
6
3
 
7
4
  Metrics/AbcSize:
8
5
  # The ABC size is a calculated magnitude, so this number can be a Fixnum or a Float.
9
6
  # http://c2.com/cgi/wiki?AbcMetric
10
- Max: 20
7
+ Max: 25
11
8
  Exclude:
12
9
  - 'test/**/*_test.rb' # ignore tests which typically have high B count due to many asserts
13
10
 
11
+ Metrics/ClassLength:
12
+ Exclude:
13
+ - 'test/**/*_test.rb'
14
+
14
15
  Metrics/MethodLength:
15
- Max: 15
16
+ Max: 20
17
+ Exclude:
18
+ - 'test/**/*_test.rb'
19
+
20
+ Metrics/LineLength:
21
+ Max: 120
22
+
23
+ Layout/EmptyLineAfterGuardClause:
24
+ Enabled: false
25
+
26
+ Style/IfUnlessModifier:
27
+ Enabled: false
16
28
 
17
29
  Style/FrozenStringLiteralComment:
18
30
  EnforcedStyle: always
@@ -4,5 +4,4 @@ rvm:
4
4
  - 2.4.0
5
5
  - 2.3.3
6
6
  - 2.2.6
7
- - 2.1.10
8
- before_install: gem install bundler -v 1.14.3
7
+ before_install: gem install bundler -v 1.17.3
data/README.md CHANGED
@@ -44,3 +44,4 @@ only show the latest version changes up until it was removed.
44
44
  - remove bundler dep
45
45
  - add yard doc
46
46
  - do not print the warning text if there were no more changes in the lock file
47
+ - find version with the longest length and pad all others to match it (f.i. rails has 4.2.8 and 4.2.7.1)
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- lib = File.expand_path('../../lib', __FILE__)
4
+ lib = File.expand_path('../lib', __dir__)
5
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
6
 
7
7
  require 'gistory'
@@ -1,7 +1,6 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
- lib = File.expand_path('../lib', __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
5
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
6
5
  require 'gistory/version'
7
6
 
@@ -9,7 +8,7 @@ Gem::Specification.new do |spec|
9
8
  spec.name = 'gistory'
10
9
  spec.version = Gistory::VERSION
11
10
  spec.platform = Gem::Platform::RUBY
12
- spec.required_ruby_version = '>= 2.1'
11
+ spec.required_ruby_version = '>= 2.2'
13
12
  spec.authors = ['Sergio Medina']
14
13
  spec.email = ['medinasergio@gmail.com']
15
14
 
@@ -28,6 +27,6 @@ Gem::Specification.new do |spec|
28
27
  spec.add_dependency 'bundler', '~> 1.0'
29
28
  spec.add_dependency 'colorize'
30
29
 
31
- spec.add_development_dependency 'rake', '~> 10.0'
32
30
  spec.add_development_dependency 'minitest', '~> 5.0'
31
+ spec.add_development_dependency 'rake', '~> 10.0'
33
32
  end
@@ -12,23 +12,33 @@ module Gistory
12
12
 
13
13
  def changelog_for_gem(gem_name)
14
14
  version_changes = []
15
- previous_version = nil
16
15
  lockfile_changes = @repo.changes_to_file(LOCKFILE)
17
16
 
18
- lockfile_changes.each do |commit|
19
- gem_spec = gem_spec_at_commit_hash(commit.short_hash, gem_name)
17
+ # no lockfile found or no changes to the lockfile found
18
+ return [] if lockfile_changes.empty?
19
+
20
+ previous_commit = lockfile_changes.shift
21
+ previous_gem_spec = gem_spec_at_commit_hash(previous_commit.short_hash, gem_name)
22
+ # only one change to the lockfile was found and the gem was not there
23
+ return [] if previous_gem_spec.nil?
24
+
25
+ lockfile_changes.each do |current_commit|
26
+ current_gem_spec = gem_spec_at_commit_hash(current_commit.short_hash, gem_name)
20
27
 
21
28
  # we reached the end, the gem didn't exist back then
22
29
  # TODO: what if it was added then removed and then added again?
23
- break if gem_spec.nil?
30
+ break if current_gem_spec.nil?
24
31
 
25
- # only store version changes of this gem
26
- unless gem_spec.version.to_s == previous_version
27
- version_changes << VersionChange.new(commit: commit, version: gem_spec.version)
28
- previous_version = gem_spec.version.to_s
32
+ if current_gem_spec.version.to_s != previous_gem_spec.version.to_s
33
+ version_changes << VersionChange.new(commit: previous_commit, version: previous_gem_spec.version)
29
34
  end
35
+
36
+ previous_gem_spec = current_gem_spec
37
+ previous_commit = current_commit
30
38
  end
31
39
 
40
+ version_changes << VersionChange.new(commit: previous_commit, version: previous_gem_spec.version)
41
+
32
42
  version_changes
33
43
  end
34
44
 
@@ -34,7 +34,7 @@ module Gistory
34
34
 
35
35
  def git(command)
36
36
  out = `git #{command}`
37
- raise('Git CLI command failed') unless $CHILD_STATUS.success?
37
+ raise 'Git CLI command failed' unless $CHILD_STATUS.success?
38
38
  out
39
39
  end
40
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gistory
4
- VERSION = '0.1.5'.freeze
4
+ VERSION = '0.1.6'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gistory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergio Medina
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-27 00:00:00.000000000 Z
11
+ date: 2019-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -39,33 +39,33 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
47
+ version: '5.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
- version: '10.0'
54
+ version: '5.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: minitest
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '5.0'
61
+ version: '10.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '5.0'
68
+ version: '10.0'
69
69
  description: 'Gistory: Know exactly when a gem was updated in your Gemfile.lock'
70
70
  email:
71
71
  - medinasergio@gmail.com
@@ -110,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - ">="
112
112
  - !ruby/object:Gem::Version
113
- version: '2.1'
113
+ version: '2.2'
114
114
  required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.6.12
121
+ rubygems_version: 2.7.8
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: 'Gistory: Know exactly when a gem was updated in your Gemfile.lock'