chef-sugar 1.2.0 → 1.2.2

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: 762ec92b492ff5b729fc32c65c2c09033b4bf4bf
4
- data.tar.gz: 1106d542f20dfe7435c3b7e4a0c77290e65e9849
3
+ metadata.gz: f5674537c266d05abd9f17e9b069f904945e12b7
4
+ data.tar.gz: b6f26132d9c4e1ee9fd99e7c5437e45bb884c4ea
5
5
  SHA512:
6
- metadata.gz: 7fe01291031397c8335511196243ff8dffe104b092d2f044af898921bbaae6edf3643157240044c5ec5f2972bcb9a6c2b7917712719c52780c1cb6b6b89e5ee8
7
- data.tar.gz: ee419d9a1756340bfecffa235b6828d8591ddd6fe3924944616123e941497c9d2ac7e94c76b4083cddb97fa15fbd1aaecc877130491c62fa213d9f6179bf709c
6
+ metadata.gz: 6e45cf63cba7efb2305fa499475f2e176135354cc157b39efb11ccf332bc8bb5df863e15785cad7c9ca8ca189778bcf9e8d95fcc1692201d08da417797c60ced
7
+ data.tar.gz: 5e8ba58f52af37590e283e49a1fdab8cde85a404b25e4fd1c481d46518b9532e9367225a47138c7ee70ec5e658939fa17182f948482d1ef072dee0bb1ddcc3d0
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  rvm:
2
2
  - 1.9.3
3
3
  - 2.0.0
4
- script:
5
- - bundle exec rspec --color --format progress
4
+ - 2.1
5
+
6
+ script: bundle exec rspec --color --format progress
data/CHANGELOG.md CHANGED
@@ -2,12 +2,16 @@ Chef Sugar Changelog
2
2
  =========================
3
3
  This file is used to list changes made in each version of the chef-sugar cookbook and gem.
4
4
 
5
+ v1.2.2 (2014-03-13)
6
+ -------------------
7
+ - Fix a critical bug with `encrypted_data_bag_item` using the wrong key
8
+
5
9
  v1.2.0 (2014-03-09)
6
10
  -------------------
7
11
  - Add `namespace` functionality for specifying attributes in a DSL
8
12
  - Add constraints helpers for comparing version strings
9
13
  - Add `require_chef_gem` to safely require and degrade if a gem is not installed
10
- - Add `deep_fetch` and `deep_fetch` to fetch deeply nested keys
14
+ - Add `deep_fetch` and `deep_fetch!` to fetch deeply nested keys
11
15
  - Accept an optional secret key in `encrypted_data_bag_item` helper and raise a helpful error if one is not set (NOTE: this changes the airity of the method, but it's backward-compatible because Ruby is magic)
12
16
  - Add Stove for releasing
13
17
  - Updated copyrights for 2014
@@ -42,20 +42,19 @@ EOH
42
42
  # @param [String] id
43
43
  # the id of the encrypted data bag
44
44
  # @param [String] secret
45
- # the encrypted data bag secret (default's to the +Chef::Config+ value)
45
+ # the encrypted data bag secret raw value
46
46
  #
47
47
  # @return [Hash]
48
48
  #
49
49
  def encrypted_data_bag_item(bag, id, secret = nil)
50
50
  Chef::Log.debug "Loading encrypted data bag item #{bag}/#{id}"
51
51
 
52
- secret ||= Chef::Config[:encrypted_data_bag_secret]
53
-
54
- if secret
55
- Chef::EncryptedDataBagItem.load(bag, id, secret)
56
- else
52
+ if secret.nil? && Chef::Config[:encrypted_data_bag_secret].nil?
57
53
  raise EncryptedDataBagSecretNotGiven.new
58
54
  end
55
+
56
+ secret ||= File.read(Chef::Config[:encrypted_data_bag_secret])
57
+ Chef::EncryptedDataBagItem.load(bag, id, secret)
59
58
  end
60
59
 
61
60
  #
@@ -95,12 +94,12 @@ EOH
95
94
  end
96
95
 
97
96
  module DSL
98
- # @see Chef::Sugar::DataBag#encrypted_data_bag_item?
97
+ # @see Chef::Sugar::DataBag#encrypted_data_bag_item
99
98
  def encrypted_data_bag_item(bag, id, secret = nil)
100
99
  Chef::Sugar::DataBag.encrypted_data_bag_item(bag, id, secret)
101
100
  end
102
101
 
103
- # @see Chef::Sugar::DataBag#encrypted_data_bag_item_for_environment?
102
+ # @see Chef::Sugar::DataBag#encrypted_data_bag_item_for_environment
104
103
  def encrypted_data_bag_item_for_environment(bag, id, secret = nil)
105
104
  Chef::Sugar::DataBag.encrypted_data_bag_item_for_environment(node, bag, id, secret)
106
105
  end
@@ -16,6 +16,6 @@
16
16
 
17
17
  class Chef
18
18
  module Sugar
19
- VERSION = '1.2.0'
19
+ VERSION = '1.2.2'
20
20
  end
21
21
  end
data/metadata.rb CHANGED
@@ -4,5 +4,14 @@ maintainer_email 'sethvargo@gmail.com'
4
4
  license 'Apache 2.0'
5
5
  description 'Installs chef-sugar. Please see the chef-sugar ' \
6
6
  'Ruby gem for more information.'
7
- long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
8
- version '1.2.0'
7
+ long_description <<-EOH
8
+ Chef Sugar is a Gem & Chef Recipe that includes series of helpful syntactic
9
+ sugars on top of the Chef core and other resources to make a cleaner, more lean
10
+ recipe DSL, enforce DRY principles, and make writing Chef recipes an awesome and
11
+ fun experience!
12
+
13
+ For the most up-to-date information and documentation, please visit the [Chef
14
+ Sugar project page on GitHub](https://github.com/sethvargo/chef-sugar).
15
+ EOH
16
+
17
+ version '1.2.2'
@@ -13,7 +13,8 @@ describe Chef::Sugar::DataBag do
13
13
 
14
14
  context 'when Chef::Config is set' do
15
15
  it 'loads the secret key from the Chef::Config' do
16
- Chef::Config.stub(:[]).with(:encrypted_data_bag_secret).and_return('B@c0n')
16
+ Chef::Config.stub(:[]).with(:encrypted_data_bag_secret).and_return('/data/path')
17
+ File.stub(:read).with('/data/path').and_return('B@c0n')
17
18
 
18
19
  expect(Chef::EncryptedDataBagItem).to receive(:load)
19
20
  .with('accounts', 'github', 'B@c0n')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-09 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler