puppetfile_editor 0.3.1 → 0.4.0

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: 15d075f0af7a73918a550b8b6715625d21053027
4
- data.tar.gz: af35e9d77f745314e1640640bc1bfe3047a29b63
3
+ metadata.gz: 3012dc52c8fc9e31fd2e05bf696482b5d5151e7e
4
+ data.tar.gz: db59418ca560a30d01901a5dd6fdbd5b63764935
5
5
  SHA512:
6
- metadata.gz: bd7f060fbc0721a622949db87dc395e1f8043c7cd8c9992664bf137b8a51c7139037eb45f4783deb62b8158af769ec21e61fca2d4aff923ff78c94d450de556a
7
- data.tar.gz: d0852ba1a1311a560faa38143dd0b01bf545a03c4c6e27f08cdfece923d3df1fb3aa29f0e26fa5b065d382043b387977f6501c3561d1b0c8a24a1546a49f6872
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
- ## [Unreleased]
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[33;1m=\e[0m ]",
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 && (@params.key?(:branch) || @params.key?(:ref))
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 'ref' are supported for '#{@type}' modules.", :unsupported)
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] && (!([:branch, :ref, :changeset] & @params.keys).empty?)
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? or mod.params.is_a? Symbol
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
- ':latest'
106
- else
107
- "'#{param_value}'"
108
- end
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 = 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
@@ -1,3 +1,3 @@
1
1
  module PuppetfileEditor
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  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.3.1
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-04 00:00:00.000000000 Z
11
+ date: 2017-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler