gem_bench 1.0.3 → 1.0.4

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: c33530febbc947b520d85f5489e36998331e5a3d
4
- data.tar.gz: 4aea6577c980e5f95ee630269593e6bbe9687dbb
3
+ metadata.gz: 0a003421ea75678d129265f4636c40e74b5602e4
4
+ data.tar.gz: da500d6acf4935d195cc7e6bf687ddb289fec32f
5
5
  SHA512:
6
- metadata.gz: c4f6e8e779c9816ec15c9c8ca10334d8ea0ed0808f925f6a63c2e057737ff260aafaf728fda9dd14437193715321bb63f374fdbc59aa064414a522d77a2400e3
7
- data.tar.gz: a071e83f2ecc47ca940ce2c6919b272479c4ab1aef8a6fbace07f297660c08583eed38dfd9f0eaec570f29713c6604d47b182cc7de6d906b9212a0e6a93c5078
6
+ metadata.gz: c7823400e8545878f790d2f1c85b567dc3bddaf17d0ff9ca0769238636405539b2f8eb6d90d207eea87e6662dfdec53b6d452deb2de7ad0c513fcf6436105dce
7
+ data.tar.gz: 491ec9e681e37f1e8e99ab2aa4fcbc48fe6e3ccfe9753a03733480dc66d2ff2ecd51c6caa0f1f2f2e0e9870e4fb6f23cf25dd6081fb515f4d922d620b04f6e77
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ Version 1.0.5 - JUN.05.2017
2
+ * Allow github macro as an alternative to git within Gemfile for strict version constraint analysis
3
+
1
4
  Version 1.0.3 - JUN.02.2017
2
5
  * fixed accidental removal of loaded_gems in 1.0.2
3
6
  * better documentation
@@ -10,7 +13,7 @@ Version 1.0.2 - JUN.02.2017
10
13
  ```ruby
11
14
  Rspec.describe "Gemfile" do
12
15
  it("has version constraint on every gem") do
13
- requirements = GemBench::StrictVersionRequirement.new({verbose: true}
16
+ requirements = GemBench::StrictVersionRequirement.new({verbose: true})
14
17
  expect(requirements.list_missing_version_constraints).to eq([])
15
18
  end
16
19
  end
data/README.md CHANGED
@@ -12,7 +12,7 @@ Version constraints are important. Give the Gemfile some love in your CI build
12
12
  ```ruby
13
13
  Rspec.describe "Gemfile" do
14
14
  it("has version constraint on every gem") do
15
- requirements = GemBench::StrictVersionRequirement.new({verbose: true}
15
+ requirements = GemBench::StrictVersionRequirement.new({verbose: false})
16
16
  expect(requirements.list_missing_version_constraints).to eq([])
17
17
  end
18
18
  end
@@ -6,6 +6,7 @@ module GemBench
6
6
  GEMFILE_HASH_CONFIG_KEY_REGEX_PROC = ->(key) { /\A\s*[^#]*(?<key1>#{key}: *)['"]{1}(?<value1>[^'"]*)['"]|(?<key2>['"]#{key}['"] *=> *)['"]{1}(?<value2>[^'"]*)['"]|(?<key3>:#{key} *=> *)['"]{1}(?<value3>[^'"]*)['"]/ }
7
7
  VERSION_PATH = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('path').freeze
8
8
  VERSION_GIT = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('git').freeze
9
+ VERSION_GITHUB = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('github').freeze
9
10
  VERSION_GIT_REF = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('ref').freeze
10
11
  VERSION_GIT_TAG = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('tag').freeze
11
12
  VERSION_GIT_BRANCH = GEMFILE_HASH_CONFIG_KEY_REGEX_PROC.call('branch').freeze
@@ -71,7 +72,7 @@ module GemBench
71
72
  def determine_version
72
73
  version_path ||
73
74
  (
74
- version_git && (
75
+ (version_git || version_github) && (
75
76
  check_for_version_of_type_git_ref ||
76
77
  check_for_version_of_type_git_tag ||
77
78
  check_for_version_of_type_git_branch
@@ -118,6 +119,17 @@ module GemBench
118
119
  )
119
120
  end
120
121
 
122
+ def version_github
123
+ @version = {}
124
+ line = relevant_lines.detect { |next_line| (next_line.match(VERSION_GITHUB)) }
125
+ return false unless line
126
+ enhance_version(
127
+ line.match(VERSION_GITHUB),
128
+ :github,
129
+ :github
130
+ )
131
+ end
132
+
121
133
  def check_for_version_of_type_git_ref
122
134
  line = relevant_lines.detect { |next_line| (next_line.match(VERSION_GIT_REF)) }
123
135
  return false unless line
@@ -1,3 +1,3 @@
1
1
  module GemBench
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_bench
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Boling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-02 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler