knife-solo_data_bag 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## head
2
2
 
3
+ ## 0.3.1 (01/11/2012)
4
+ * write pretty json to disk (addresses #1)
5
+
3
6
  ## 0.3.0 (11/08/2012)
4
7
  * Add support for 'encrypted_data_bag_secret' in knife config (props to Anton Orel @skyeagle)
5
8
 
data/LICENSE CHANGED
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2012 Thomas Bishop
189
+ Copyright 2012-13 Thomas Bishop
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -70,9 +70,9 @@ This plugin will rely on the configured data_bag_path for placement of the data
70
70
  bags. This defaults to '/var/chef/data_bags', but can be overriden in your chef
71
71
  client config.
72
72
 
73
- This plugin respects the "encrypted_data_bag_path" configuration option in
73
+ This plugin respects the "encrypted_data_bag_secret" configuration option in
74
74
  knife.rb. Command line secret arguments (-s or --secret-file) will override the
75
- the setting in knife.rb.
75
+ setting in knife.rb.
76
76
 
77
77
  ## Version Support
78
78
  This plugin has been tested on the following:
@@ -56,7 +56,7 @@ module KnifeSoloDataBag
56
56
 
57
57
  def persist_bag_item(item)
58
58
  File.open bag_item_path, 'w' do |f|
59
- f.write item.to_json
59
+ f.write JSON.pretty_generate(JSON.parse(item.to_json))
60
60
  end
61
61
  end
62
62
 
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module SoloDataBag
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -21,8 +21,8 @@ describe KnifeSoloDataBag::SoloDataBagEdit do
21
21
  lambda {
22
22
  @knife.run
23
23
  }.should raise_error SystemExit
24
- @stdout.string.should match /usage/i
25
- @stderr.string.should match /name for the item/
24
+ @stdout.string.should match(/usage/i)
25
+ @stderr.string.should match(/name for the item/)
26
26
  end
27
27
  end
28
28
 
@@ -58,6 +58,20 @@ describe KnifeSoloDataBag::SoloDataBagEdit do
58
58
  JSON.parse(File.read(@item_path)).raw_data.should == @updated_data
59
59
  end
60
60
 
61
+ it 'should write pretty json' do
62
+ @knife.run
63
+ File.read(@item_path).should == %q({
64
+ "name": "data_bag_item_bag_1_foo",
65
+ "json_class": "Chef::DataBagItem",
66
+ "chef_type": "data_bag_item",
67
+ "data_bag": "bag_1",
68
+ "raw_data": {
69
+ "id": "foo",
70
+ "who": "sue"
71
+ }
72
+ })
73
+ end
74
+
61
75
  context 'when encrypting with -s or --secret' do
62
76
  before do
63
77
  @knife.config[:secret] = 'secret_key'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-solo_data_bag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-09 00:00:00.000000000Z
12
+ date: 2013-01-11 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
16
- requirement: &70357567294460 !ruby/object:Gem::Requirement
16
+ requirement: &70306434697200 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.10.10
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70357567294460
24
+ version_requirements: *70306434697200
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70357567294040 !ruby/object:Gem::Requirement
27
+ requirement: &70306434696780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70357567294040
35
+ version_requirements: *70306434696780
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70357571692840 !ruby/object:Gem::Requirement
38
+ requirement: &70306430382880 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 2.10.0
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70357571692840
46
+ version_requirements: *70306430382880
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: fakefs
49
- requirement: &70357571692340 !ruby/object:Gem::Requirement
49
+ requirement: &70306430382380 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 0.4.0
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70357571692340
57
+ version_requirements: *70306430382380
58
58
  description: A knife plugin for working with data bags and chef solo
59
59
  email:
60
60
  - bishop.thomas@gmail.com