lapidarist 0.1.0 → 0.1.1

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
  SHA256:
3
- metadata.gz: b8c8ab46b2d54a0e859b530fc4a412dc89f483eed5244a12c9dd00c0adb1c2c8
4
- data.tar.gz: 326f99a9496187492dead76dcc989ff4236aa40361d72391ae94faf1ba82c106
3
+ metadata.gz: 1105156709cc99e5c061836d1815d84721de11b80ae92f90e9404fa9461f7f49
4
+ data.tar.gz: b2cbcbe7c210fefcbd870baa5c9de71d5ce4065f9e208a8f36359e6a7daeea05
5
5
  SHA512:
6
- metadata.gz: 0fb14d325fde03f4162d14b87e73c3cddc0793a9f861066a9e0ea7c4d59d753a2d400b5e57ace22878620b1581197f4904358d2c1670303f442da458afb2bae9
7
- data.tar.gz: ca2dd4fe4a9e5ed49f6082abe51ec6f1e1ed54b3025b58a347fce6bacd9b3978d01a62f18bffddc4b90cc36ab74d2a042048cb37f3882b773a15b38df2f40509
6
+ metadata.gz: c4bc4c2ca10de53d0d6af8ff6154290171870029fa72366347577aad742f36e0e6ef7acf43ede35df0c03f789bf016b321748d897d16995c038b068833bf8cd8
7
+ data.tar.gz: 62dc6f447328f0ce79287c826a716126a6cffe689216724b58416d2c2a3f330580a9de558cf89829456359b2ddfc80287688585de4e2291ce9fb6116b60fd1c7
@@ -4,6 +4,16 @@
4
4
 
5
5
  ### New features
6
6
 
7
+ ## 0.1.1 (2018-08-11)
8
+
9
+ ### New features
10
+
11
+ * add ability to parse and update gems locked to a sha.
12
+
13
+ ### Bug fixes
14
+
15
+ * fix promoted/demoted bug when gem wasn't in the outdated list.
16
+
7
17
  ## 0.1.0 (2018-08-07)
8
18
 
9
19
  ### New features
@@ -12,10 +22,10 @@
12
22
  * allow random seed to be provided.
13
23
  * use CircleCi to run specs.
14
24
  * allow groups to have different semver level restrictions.
15
- * add ability to promote gems in the order of being updated
16
- * add ability to demote gems in the order of being updated
17
- * add ability to only update specific gems
18
- * add ability to update everything but specific excluded gems
25
+ * add ability to promote gems in the order of being updated.
26
+ * add ability to demote gems in the order of being updated.
27
+ * add ability to only update specific gems.
28
+ * add ability to update everything but specific excluded gems.
19
29
 
20
30
  ## 0.0.1 (2018-08-01)
21
31
 
@@ -7,6 +7,7 @@ require_relative 'lapidarist/level_constraint'
7
7
  require_relative 'lapidarist/options'
8
8
  require_relative 'lapidarist/level'
9
9
  require_relative 'lapidarist/version_change'
10
+ require_relative 'lapidarist/gem_version'
10
11
  require_relative 'lapidarist/gem'
11
12
  require_relative 'lapidarist/gems'
12
13
 
@@ -24,8 +24,8 @@ module Lapidarist
24
24
 
25
25
  def version(gem)
26
26
  stdout = shell.run('bundle list', "grep \" #{gem.name} \"")
27
- result = stdout.match(/\((?<version>[0-9\.]+)\)/)
28
- result[:version] if result
27
+ result = stdout.match(/\((?<version>[0-9\.]+)(?<sha> \w{7})?\)/)
28
+ Lapidarist::GemVersion.new(version: result[:version], sha: result[:sha]&.strip) if result
29
29
  end
30
30
 
31
31
  private
@@ -33,14 +33,14 @@ module Lapidarist
33
33
  attr_reader :shell
34
34
 
35
35
  def parse_gem_from(line)
36
- regex = / \* (.*) \(newest (\d[\d\.]*\d)[,\s] installed (\d[\d\.]*\d)[\),\s](.*groups \"(.*)\")?/.match line
36
+ regex = / \* (.*) \(newest (\d[\d\.]*\d)( \w{7})?[,\s] installed (\d[\d\.]*\d)( \w{7})?[\),\s](.*groups \"(.*)\")?/.match line
37
37
 
38
38
  unless regex.nil?
39
39
  Gem.new(
40
40
  name: regex[1],
41
- newest_version: regex[2],
42
- installed_version: regex[3],
43
- groups: Array(regex[5]&.split(',')).map(&:strip)
41
+ newest_version: Lapidarist::GemVersion.new(version: regex[2], sha: regex[3]&.strip),
42
+ installed_version: Lapidarist::GemVersion.new(version: regex[4], sha: regex[5]&.strip),
43
+ groups: Array(regex[7]&.split(',')).map(&:strip)
44
44
  )
45
45
  end
46
46
  end
@@ -0,0 +1,19 @@
1
+ module Lapidarist
2
+ class GemVersion
3
+ attr_reader :version, :sha
4
+
5
+ def initialize(version:, sha: nil)
6
+ @version = version
7
+ @sha = sha
8
+ end
9
+
10
+ def ==(other_version)
11
+ version == other_version.version &&
12
+ sha == other_version.sha
13
+ end
14
+
15
+ def to_s
16
+ [version, sha].compact.join(' ')
17
+ end
18
+ end
19
+ end
@@ -34,14 +34,16 @@ module Lapidarist
34
34
  end
35
35
 
36
36
  def promoted_gems
37
- (Lapidarist.config.promoted - Lapidarist.config.demoted).map do |gem_name|
38
- all_outdated_gems.detect { |g| g.name == gem_name }
37
+ (Lapidarist.config.promoted - Lapidarist.config.demoted).each_with_object([]) do |gem_name, results|
38
+ promoted_gem = all_outdated_gems.detect { |g| g.name == gem_name }
39
+ results.push(promoted_gem) if promoted_gem
39
40
  end
40
41
  end
41
42
 
42
43
  def demoted_gems
43
- Lapidarist.config.demoted.map do |gem_name|
44
- all_outdated_gems.detect { |g| g.name == gem_name }
44
+ Lapidarist.config.demoted.each_with_object([]) do |gem_name, results|
45
+ demoted_gem = all_outdated_gems.detect { |g| g.name == gem_name }
46
+ results.push(demoted_gem) if demoted_gem
45
47
  end
46
48
  end
47
49
 
@@ -1,3 +1,3 @@
1
1
  module Lapidarist
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -18,11 +18,11 @@ module Lapidarist
18
18
  attr_reader :installed, :updated
19
19
 
20
20
  def installed_segments
21
- @installed_segments ||= installed.split('.')
21
+ @installed_segments ||= installed.version.split('.')
22
22
  end
23
23
 
24
24
  def updated_segments
25
- @updated_segments ||= updated&.split('.')
25
+ @updated_segments ||= updated&.version&.split('.')
26
26
  end
27
27
 
28
28
  def level
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lapidarist
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Gangl
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-07 00:00:00.000000000 Z
11
+ date: 2018-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,6 +79,7 @@ files:
79
79
  - lib/lapidarist/cli.rb
80
80
  - lib/lapidarist/configuration.rb
81
81
  - lib/lapidarist/gem.rb
82
+ - lib/lapidarist/gem_version.rb
82
83
  - lib/lapidarist/gems.rb
83
84
  - lib/lapidarist/git_command.rb
84
85
  - lib/lapidarist/group_constraint.rb