puppetfile_editor 0.7.0 → 0.7.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: b99bd7f019aa2f0f45886781196541dbc26ee417563c442ec108f64c35127dc1
4
- data.tar.gz: 512cc9b743df97fe6ea944b6aa47a1cd2ce82f37ec84072d06053ca409482470
3
+ metadata.gz: c87e60bcb47337f1e82ddebb3cf63438ca86d16d469c4a7837bc179a7a2ca1c9
4
+ data.tar.gz: 1cdd31477c5668a7fb8170b60df48a0156a8f8e2786a575c52b56ecfadf0d563
5
5
  SHA512:
6
- metadata.gz: 4dc9b545e14367eb025409bb3e00f0fa1771ce01d5725eb45c2f3544425391896899a7a7bce02d1d8e1d611ce3b5912018d4b6722cd60b098c756d1ae2ba421a
7
- data.tar.gz: ad6327a2c9eaed1f8e9f1bf60369f009c580a8a0763cc1cfc75a8df3ae71574ea22ef7a311c4056790e81202de5e64860413722e2d8ffeae71c9d03c87aa0b0f
6
+ metadata.gz: 1095879f6b4423febcc3c225e944ad410622155ab4d3ed6a196b33dd96f87114d7b2d028f94ff626fa993a7492831df7d275791dc06f7abd443a6f5071872ce4
7
+ data.tar.gz: 84f21e96aee3e29ea6513a0b6012242aa5b41b9fd2ac1e2fba6cc85a8817d162b9c7cdaa80ad8d0c3997eab33e6b7f517f69b82e70fb660df190048cb910dbc2
data/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [0.7.1] - 2018-02-22
8
+ ### Fixed
9
+ - Fix for older rubies where `Gem::Version` broke for versions like `0.1.0-dev1`.
10
+
7
11
  ## [0.7.0] - 2018-02-15
8
12
  ### Added
9
13
  - Warn about downgrading forge, git, and hg modules while merging.
@@ -74,11 +74,23 @@ module PuppetfileEditor
74
74
  if full_version == mod.full_version
75
75
  set_message("versions match (#{full_version})", :matched)
76
76
  return
77
- elsif Gem::Version.new(full_version.sub('tag: ', '')) > Gem::Version.new(mod.full_version.sub('tag: ', ''))
78
- set_message("DOWNGRADED (#{full_version} to #{mod.full_version})", :downgrade)
77
+ end
78
+
79
+ begin
80
+ old_version = Gem::Version.new(full_version.sub('tag: ', ''))
81
+ new_version = Gem::Version.new(mod.full_version.sub('tag: ', ''))
82
+ rescue ArgumentError
83
+ # Older rubies throw ArgumentError when version is '0.1.0-dev1', for example.
84
+ # Sad.
85
+ set_message("could not compare versions, so updating (#{full_version} to #{mod.full_version})", :updated)
79
86
  else
80
- set_message("updated (#{full_version} to #{mod.full_version})", :updated)
87
+ if old_version > new_version
88
+ set_message("DOWNGRADED (#{full_version} to #{mod.full_version})", :downgrade)
89
+ else
90
+ set_message("updated (#{full_version} to #{mod.full_version})", :updated)
91
+ end
81
92
  end
93
+
82
94
  @params.delete_if { |param, _| [:branch, :tag, :ref, :changeset].include? param }
83
95
  @params.merge!(new)
84
96
  calculate_indent
@@ -110,10 +122,10 @@ module PuppetfileEditor
110
122
  output.push "mod '#{full_title}'"
111
123
  @params.each do |param_name, param_value|
112
124
  value = if param_value == :latest
113
- ':latest'
114
- else
115
- "'#{param_value}'"
116
- end
125
+ ':latest'
126
+ else
127
+ "'#{param_value}'"
128
+ end
117
129
  param = "#{param_name}:".ljust(@indent)
118
130
  output.push " #{param} #{value}"
119
131
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PuppetfileEditor
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppetfile_editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eugene Piven
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-15 00:00:00.000000000 Z
11
+ date: 2018-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler