puppetfile_editor 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/puppetfile_editor/cli.rb +1 -1
- data/lib/puppetfile_editor/module.rb +11 -12
- data/lib/puppetfile_editor/puppetfile.rb +1 -1
- data/lib/puppetfile_editor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3012dc52c8fc9e31fd2e05bf696482b5d5151e7e
|
4
|
+
data.tar.gz: db59418ca560a30d01901a5dd6fdbd5b63764935
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d960ef7240383124c2f8dc8cfc569f2b77bc6be49111b776000add14a9f1054c00af65746ccac26065c433ea8c89433e5a7dbfa1c7b0fa2bd57bea1e3a46ebc
|
7
|
+
data.tar.gz: f45048722ddecabc3119a920ce15f60d9db714aa0f832011ccec7c509562eef5ff5fbbb0b618df2ebbed70a37ca7053cea646b5209ec7406d2b9622eb83d9dd9
|
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,15 @@ 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
|
-
## [
|
7
|
+
## [0.4.0] - 2017-10-07
|
8
|
+
### Added
|
9
|
+
- Support for setting `changeset` for git/hg modules.
|
10
|
+
|
11
|
+
### Changed
|
12
|
+
- Color of `matched` output status changed to bright white so that other statuses stand out better.
|
13
|
+
|
14
|
+
### Fixed
|
15
|
+
- Force update when using 'edit' command from CLI.
|
8
16
|
|
9
17
|
## [0.3.1] - 2017-10-04
|
10
18
|
### Fixed
|
@@ -99,7 +99,7 @@ module PuppetfileEditor
|
|
99
99
|
def initialize
|
100
100
|
@statuses = {
|
101
101
|
updated: "[ \e[32;1m+\e[0m ]",
|
102
|
-
matched: "[ \e[
|
102
|
+
matched: "[ \e[0;1m=\e[0m ]",
|
103
103
|
skipped: "[ \e[33;1m~\e[0m ]",
|
104
104
|
not_found: "[ \e[31;1mx\e[0m ]",
|
105
105
|
type_mismatched: "[ \e[31;1mx\e[0m ]",
|
@@ -31,15 +31,16 @@ module PuppetfileEditor
|
|
31
31
|
def set(param, newvalue, force = false)
|
32
32
|
case @type
|
33
33
|
when :hg, :git
|
34
|
-
if !force && (
|
34
|
+
if !force && !([:branch, :ref, :changeset] & @params.keys).empty?
|
35
35
|
set_message("kept at (#{full_version})", :wont_upgrade)
|
36
|
-
elsif !%w[branch tag ref].include? param
|
37
|
-
set_message("only 'branch', 'tag', and '
|
36
|
+
elsif !%w[branch tag ref changeset].include? param
|
37
|
+
set_message("only 'branch', 'tag', 'ref', and 'changeset' are supported for '#{@type}' modules.", :unsupported)
|
38
38
|
else
|
39
39
|
set_message("updated (#{full_version} to #{param}: #{newvalue}", :updated)
|
40
40
|
@params.delete :branch
|
41
41
|
@params.delete :tag
|
42
42
|
@params.delete :ref
|
43
|
+
@params.delete :changeset
|
43
44
|
@params[param.to_sym] = newvalue
|
44
45
|
calculate_indent
|
45
46
|
end
|
@@ -63,7 +64,7 @@ module PuppetfileEditor
|
|
63
64
|
case @type
|
64
65
|
when :hg, :git
|
65
66
|
new = mod.params.reject { |param, _| param.eql? @type }
|
66
|
-
if !force && new.keys == [:tag] &&
|
67
|
+
if !force && new.keys == [:tag] && !([:branch, :ref, :changeset] & @params.keys).empty?
|
67
68
|
set_message("kept at #{full_version}", :wont_upgrade)
|
68
69
|
return
|
69
70
|
end
|
@@ -78,7 +79,7 @@ module PuppetfileEditor
|
|
78
79
|
calculate_indent
|
79
80
|
when :forge
|
80
81
|
unless force
|
81
|
-
if mod.params.nil?
|
82
|
+
if mod.params.nil? || mod.params.is_a?(Symbol)
|
82
83
|
set_message("won't upgrade to #{mod.full_version}", :wont_upgrade)
|
83
84
|
return
|
84
85
|
end
|
@@ -102,10 +103,10 @@ module PuppetfileEditor
|
|
102
103
|
output.push "mod '#{full_title}'"
|
103
104
|
@params.each do |param_name, param_value|
|
104
105
|
value = if param_value == :latest
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
106
|
+
':latest'
|
107
|
+
else
|
108
|
+
"'#{param_value}'"
|
109
|
+
end
|
109
110
|
param = "#{param_name}:".ljust(@indent)
|
110
111
|
output.push " #{param} #{value}"
|
111
112
|
end
|
@@ -133,14 +134,12 @@ module PuppetfileEditor
|
|
133
134
|
when :forge
|
134
135
|
return @params[:version] if @params.key? :version
|
135
136
|
nil
|
136
|
-
else
|
137
|
-
nil
|
138
137
|
end
|
139
138
|
end
|
140
139
|
|
141
140
|
def set_message(message, status)
|
142
141
|
@message = message
|
143
|
-
@status
|
142
|
+
@status = status
|
144
143
|
end
|
145
144
|
|
146
145
|
private
|
@@ -72,7 +72,7 @@ module PuppetfileEditor
|
|
72
72
|
|
73
73
|
def update_module(name, param, value)
|
74
74
|
if @modules.key? name
|
75
|
-
@modules[name].set(param, value)
|
75
|
+
@modules[name].set(param, value, true)
|
76
76
|
else
|
77
77
|
raise StandardError, "Module #{name} does not exist in your Puppetfile"
|
78
78
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Piven
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|