hiera-eyaml 2.0.6 → 2.0.7

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 91148de066d290b4cdd6341ca54a3e20f7ae62fc
4
+ data.tar.gz: 349951ef92e5d63dbd56cd769e32cf9fc16eb7ec
5
+ SHA512:
6
+ metadata.gz: 633324c4a0bb00849b924fb667975650b88256e0941b4ff123499d64d6d11f14f8f47769f9c301423a44d9bd9c9a7257de9eeaa0673290473c1332420882e07f
7
+ data.tar.gz: 22a2eae199bae8f23f96bfe68634a440eb2dc1db512463b2c54f711085d09e318cd1f2a111232b068f8ec59967c7c8eed7f98a1c67daf638896e2e9ecb004f19
data/.gitignore CHANGED
@@ -8,3 +8,4 @@ tmp/
8
8
  .rvmrc
9
9
  .ruby-version
10
10
  .ruby-gemset
11
+ Gemfile.lock
data/CHANGES.md CHANGED
@@ -1,26 +1,33 @@
1
1
  Change log for hiera-eyaml
2
2
  ==========================
3
3
 
4
- 2.06
5
- ----
4
+ 2.0.7
5
+ -----
6
6
 
7
- - #131 - Fix another EDITOR bug (#130) that could erase command line flags to the specified editor (@elyscape)
7
+ - (#142) - Fixed highline dependency to exclude newer versions that are not compatible with ruby 1.8.7 (@elyscape)
8
+ - (#136) - \t and \r characters are now supported in encrypted blocks (@elyscape)
9
+ - (#138) - Added missing tags and new tagging tool (@elyscape)
8
10
 
9
- 2.05
10
- ----
11
+ 2.0.6
12
+ -----
11
13
 
12
- - #128 - Fix a bug (#127) that caused `eyaml edit` to break when `$EDITOR` was a command on PATH rather than a path to a command (@elyscape)
14
+ - (#131) - Fix another EDITOR bug (#130) that could erase command line flags to the specified editor (@elyscape)
13
15
 
14
- 2.04
15
- ----
16
+ 2.0.5
17
+ -----
18
+
19
+ - (#128) - Fix a bug (#127) that caused `eyaml edit` to break when `$EDITOR` was a command on PATH rather than a path to a command (@elyscape)
20
+
21
+ 2.0.4
22
+ -----
16
23
 
17
24
  - Add change log
18
- - #118 - Some initial support for spaces in filenames (primarily targeted at windows platforms) (@elyscape)
19
- - #114 - Add new config file resolution so that a system wide /etc/eyaml/config.yaml is processed first (@gtmtech)
20
- - #112 - Improve debugging options and colorise output (@gtmtech)
21
- - #102 - Extension of temp files should be yaml to help editors provide syntax highlighting (@ColinHebert)
22
- - #90, #121, #122 - Add preamble in edit mode to make it easier to remember how to edit (@sihil)
23
- - #96, #111, #116 - Various updates to docs
24
-
25
- 2.03
26
- ----
25
+ - (#118) - Some initial support for spaces in filenames (primarily targeted at windows platforms) (@elyscape)
26
+ - (#114) - Add new config file resolution so that a system wide /etc/eyaml/config.yaml is processed first (@gtmtech)
27
+ - (#112) - Improve debugging options and colorise output (@gtmtech)
28
+ - (#102) - Extension of temp files should be yaml to help editors provide syntax highlighting (@ColinHebert)
29
+ - (#90), #121, #122 - Add preamble in edit mode to make it easier to remember how to edit (@sihil)
30
+ - (#96), #111, #116 - Various updates to docs
31
+
32
+ 2.0.3
33
+ -----
data/Gemfile CHANGED
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org/'
2
2
 
3
- gem 'highline'
4
- gem 'trollop'
3
+ gem 'highline', '~> 1.6.19'
4
+ gem 'trollop', '~> 2.0'
5
5
 
6
6
  group :development do
7
7
  gem "aruba"
@@ -17,6 +17,6 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_dependency('trollop', '>= 2.0')
21
- gem.add_dependency('highline', '>= 1.6.19')
20
+ gem.add_dependency('trollop', '~> 2.0')
21
+ gem.add_dependency('highline', '~> 1.6.19')
22
22
  end
@@ -2,7 +2,7 @@ class Hiera
2
2
  module Backend
3
3
  module Eyaml
4
4
 
5
- VERSION = "2.0.6"
5
+ VERSION = "2.0.7"
6
6
  DESCRIPTION = "Hiera-eyaml is a backend for Hiera which provides OpenSSL encryption/decryption for Hiera properties"
7
7
 
8
8
  class RecoverableError < StandardError
@@ -39,13 +39,13 @@ class Hiera
39
39
  case format
40
40
  when :block
41
41
  # strip any white space
42
- @cipher = @cipher.gsub(/ /m, "")
42
+ @cipher = @cipher.gsub(/[ \t]/, "")
43
43
  # normalize indentation
44
- ciphertext = @cipher.gsub(/\n/, "\n" + @indentation)
44
+ ciphertext = @cipher.gsub(/[\n\r]/, "\n" + @indentation)
45
45
  chevron = (args[:use_chevron].nil? || args[:use_chevron]) ? ">\n" : ''
46
46
  "#{label_string}#{chevron}" + @indentation + "ENC[#{@encryptor.tag},#{ciphertext}]"
47
47
  when :string
48
- ciphertext = @cipher.gsub(/\n/, "")
48
+ ciphertext = @cipher.gsub(/[\n\r]/, "")
49
49
  "#{label_string}ENC[#{@encryptor.tag},#{ciphertext}]"
50
50
  else
51
51
  raise "#{@format} is not a valid format"
@@ -87,7 +87,7 @@ class Hiera
87
87
  @string_token_type = EncStringTokenType.new()
88
88
  end
89
89
  def create_token(string)
90
- @string_token_type.create_token(string.gsub(/[ \n]/, ''))
90
+ @string_token_type.create_token(string.gsub(/\s/, ''))
91
91
  end
92
92
  end
93
93
 
@@ -103,7 +103,7 @@ class Hiera
103
103
 
104
104
  class EncBlockTokenType < EncTokenType
105
105
  def initialize
106
- @regex = />\n(\s*)ENC\[(\w+,)?([a-zA-Z0-9\+\/ =\n]+?)\]/
106
+ @regex = />\n(\s*)ENC\[(\w+,)?([a-zA-Z0-9\+\/=\s]+?)\]/
107
107
  end
108
108
  def create_token(string)
109
109
  md = @regex.match(string)
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.9')
5
+ $stderr.puts "This script requires Ruby >= 1.9"
6
+ exit 1
7
+ end
8
+
9
+ require 'open3'
10
+ result = Open3.capture3('git rev-parse --show-toplevel')
11
+ unless result[2].exitstatus == 0
12
+ $stderr.puts "You do not appear to be in a git repository. This script must be run from inside a git repository."
13
+ exit 2
14
+ end
15
+ filename = result[0].lines.first.chomp + '/CHANGES.md'
16
+ unless File.exist?(filename)
17
+ $stderr.puts "CHANGES.md not found. Please ensure that CHANGES.md exists."
18
+ exit 3
19
+ end
20
+ contents = IO.read(filename)
21
+
22
+ lines = contents.lines.drop(3).map(&:chomp).reject(&:empty?)
23
+ versions = Hash.new
24
+ currentversion = nil
25
+ versions[nil] = []
26
+ lines.each_with_index do |line, index|
27
+ if line =~ /\A-+\z/
28
+ versions[currentversion].pop
29
+ currentversion = lines[index-1]
30
+ versions[currentversion] = []
31
+ else
32
+ versions[currentversion] << line
33
+ end
34
+ end
35
+ versions.delete(nil)
36
+
37
+ def prompt(*args)
38
+ print(*args)
39
+ gets.chomp
40
+ end
41
+
42
+ newest = versions.first[0]
43
+ version = prompt "Version [#{newest}]: "
44
+ version = newest if version.empty?
45
+
46
+ unless versions[version]
47
+ $stderr.puts "Version #{version} is invalid. Valid versions are: #{versions.keys.join(', ')}"
48
+ exit 4
49
+ end
50
+
51
+ tagname = "v#{version}"
52
+
53
+
54
+
55
+ result = Open3.capture3("git rev-parse #{tagname}")
56
+ if result[2].exitstatus == 0
57
+ $stderr.puts "Tag #{tagname} already exists."
58
+ exit 5
59
+ end
60
+
61
+ commit = prompt "Commit: "
62
+
63
+ result = Open3.capture3("git --no-pager log -1 #{commit} --format='%ci'")
64
+ unless result[2].exitstatus == 0
65
+ $stderr.puts "Commit '#{commit}' is not valid."
66
+ exit result[2].exitstatus
67
+ end
68
+ commitdate = result[0].lines.first.chomp
69
+
70
+ def word_wrap(line, width)
71
+ first_prefix = line.match(/([ -]*)/)[1]
72
+ prefix = ' ' * first_prefix.size
73
+ real_width = width - (prefix.size * 2)
74
+ line[prefix.size..-1].gsub(/(^)?(.{1,#{real_width}})(?: +|$)/) { |s| $1 ? "#{first_prefix}#{s}\n" : "#{prefix}#{s}\n" }
75
+ end
76
+
77
+ require 'tempfile'
78
+ begin
79
+ tf = Tempfile.new('tag-message')
80
+ tf.puts "Version #{version} release"
81
+ tf.puts ""
82
+ tf.puts "Changes:"
83
+ versions[version].each do |line|
84
+ tf.puts word_wrap(line, 80)
85
+ end
86
+ tf.flush
87
+
88
+ result = Open3.capture3({'GIT_COMMITTER_DATE' => commitdate}, "git tag -a #{tagname} #{commit} -F #{tf.path}")
89
+ $stderr.puts result[1]
90
+ if result[2].exitstatus == 0
91
+ system "git --no-pager show #{tagname} --no-patch"
92
+ puts ""
93
+ puts "Tag created. Please push to GitHub with `git push origin #{tagname}`."
94
+ end
95
+ exit result[2].exitstatus
96
+ ensure
97
+ tf.close!
98
+ end
metadata CHANGED
@@ -1,60 +1,49 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hiera-eyaml
3
- version: !ruby/object:Gem::Version
4
- version: 2.0.6
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.7
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - Tom Poulton
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-12-13 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: trollop
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '2.0'
22
- type: :runtime
11
+
12
+ date: 2015-03-04 00:00:00 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: "2.0"
20
+ version_requirements: *id001
23
21
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '2.0'
30
- - !ruby/object:Gem::Dependency
31
- name: highline
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: 1.6.19
38
22
  type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
23
+ name: trollop
24
+ - !ruby/object:Gem::Dependency
25
+ requirement: &id002 !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
45
29
  version: 1.6.19
30
+ version_requirements: *id002
31
+ prerelease: false
32
+ type: :runtime
33
+ name: highline
46
34
  description: Hiera backend for decrypting encrypted yaml properties
47
35
  email:
48
- executables:
36
+ executables:
49
37
  - eyaml
50
38
  extensions: []
39
+
51
40
  extra_rdoc_files: []
52
- files:
41
+
42
+ files:
53
43
  - .gitignore
54
44
  - .travis.yml
55
45
  - CHANGES.md
56
46
  - Gemfile
57
- - Gemfile.lock
58
47
  - LICENSE.txt
59
48
  - PLUGINS.md
60
49
  - README.md
@@ -85,30 +74,33 @@ files:
85
74
  - sublime_text/README.md
86
75
  - sublime_text/eyaml.sublime-package
87
76
  - sublime_text/eyaml.syntax_definition.json
77
+ - tools/git_tag_release.rb
88
78
  - tools/regem.sh
89
79
  homepage: http://github.com/TomPoulton/hiera-eyaml
90
- licenses:
80
+ licenses:
91
81
  - MIT
82
+ metadata: {}
83
+
92
84
  post_install_message:
93
85
  rdoc_options: []
94
- require_paths:
86
+
87
+ require_paths:
95
88
  - lib
96
- required_ruby_version: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- required_rubygems_version: !ruby/object:Gem::Requirement
103
- none: false
104
- requirements:
105
- - - ! '>='
106
- - !ruby/object:Gem::Version
107
- version: '0'
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - &id003
92
+ - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: "0"
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - *id003
108
98
  requirements: []
99
+
109
100
  rubyforge_project:
110
- rubygems_version: 1.8.23.2
101
+ rubygems_version: 2.0.14
111
102
  signing_key:
112
- specification_version: 3
103
+ specification_version: 4
113
104
  summary: OpenSSL Encryption backend for Hiera
114
105
  test_files: []
106
+
@@ -1,48 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- aruba (0.5.3)
5
- childprocess (>= 0.3.6)
6
- cucumber (>= 1.1.1)
7
- rspec-expectations (>= 2.7.0)
8
- builder (3.2.2)
9
- childprocess (0.3.9)
10
- ffi (~> 1.0, >= 1.0.11)
11
- cucumber (1.3.10)
12
- builder (>= 2.1.2)
13
- diff-lcs (>= 1.1.3)
14
- gherkin (~> 2.12)
15
- multi_json (>= 1.7.5, < 2.0)
16
- multi_test (>= 0.0.2)
17
- diff-lcs (1.2.5)
18
- facter (1.7.3)
19
- ffi (1.9.3)
20
- gherkin (2.12.2)
21
- multi_json (~> 1.3)
22
- hiera (1.2.1)
23
- json_pure
24
- hiera-eyaml-plaintext (0.5)
25
- highline (1.6.20)
26
- json_pure (1.8.1)
27
- multi_json (1.8.2)
28
- multi_test (0.0.2)
29
- puppet (3.3.2)
30
- facter (~> 1.6)
31
- hiera (~> 1.0)
32
- rgen (~> 0.6.5)
33
- rake (10.1.0)
34
- rgen (0.6.6)
35
- rspec-expectations (2.14.4)
36
- diff-lcs (>= 1.1.3, < 2.0)
37
- trollop (2.0)
38
-
39
- PLATFORMS
40
- ruby
41
-
42
- DEPENDENCIES
43
- aruba
44
- hiera-eyaml-plaintext
45
- highline
46
- puppet
47
- rake
48
- trollop