knife-helper 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 231c99b7f892f61e0999bcaaf5f7cbbf5d0c0662
4
- data.tar.gz: 7bd5445511ca8634535b54934dd638e47f4e1e3c
3
+ metadata.gz: 3d4b237c333ed70fda38c3f29245fb32e47dbea4
4
+ data.tar.gz: 45615aad52e32b1b0c9753d649a757201663cbaa
5
5
  SHA512:
6
- metadata.gz: c3f9bd07a71b9d90b691fbd7b407da1797b62653c4db8ffe8e44753cb1e2ab67697370dcc6396bbadd673d8521df5ba65ebc50af1cc312554a465fb01316ac7b
7
- data.tar.gz: 4ba4ad52b24df0590506bc366d46995e623977df8c555e087b811e10ac9109236acf8a1d01f6f24a976ee22a151e6874a3e65d8d2303ae2974eebc887f750c1e
6
+ metadata.gz: af366ce80da28f92bc4672a2bddab83e8026a66ac33a76804c494f7ef65460f7918788a41c4c9e0eea543742d54e14a0e51d4a549b11fd0a76c00e1acdc88c3e
7
+ data.tar.gz: 7cfa50874c851e561ae5ea8506277f21f853b442322decb6af71ed4e57d8a7236aaacba51d371bb7ede3ad16a01677b6fdd393befc57cdc5f5d0b6e4436a47b5
@@ -1,3 +1,7 @@
1
+ ## 0.1.1
2
+
3
+ * Allow string to option_sets of commands
4
+
1
5
  ## 0.1.0
2
6
 
3
7
  * Support set of options [#1]
data/README.md CHANGED
@@ -71,17 +71,22 @@ includes:
71
71
  - example.yml
72
72
 
73
73
  settings:
74
- command_base: /home/marcy/.rbenv/versions/2.1.5/bin/knife
74
+ command_base: bundle exec knife
75
75
 
76
76
  option_sets:
77
77
  - name: default
78
78
  options:
79
+ ssh-user: ec2-user
80
+ identity-file: ~/.ssh/example.pem
81
+ hint: ec2
79
82
 
80
83
  commands:
81
84
  - name: default
82
- command: help
83
- condition:
85
+ command: zero chef_client
86
+ condition: chef_environment:production
87
+ option_sets: default
84
88
  options:
89
+ attribute: ec2.public_ipv4
85
90
  ```
86
91
 
87
92
  ### includes
@@ -108,6 +113,10 @@ Type: `String`
108
113
  Condition for search and execute command.
109
114
  Type: `String`
110
115
 
116
+ ### commands:option_sets
117
+ Option set to be used in the command.
118
+ Type: `String` or `Array`
119
+
111
120
  ### commands:options
112
121
  Command options.
113
122
  Type: `Hash`
@@ -21,6 +21,7 @@ module Knife
21
21
  cmd << " '#{c['condition']}'" if c.has_key?('condition') && c['condition']
22
22
  options = {}
23
23
  option_sets = {}
24
+ c['option_sets'] = Array(c['option_sets']) if c['option_sets'].is_a?(String)
24
25
  if c['option_sets'].is_a?(Array)
25
26
  c['option_sets'].each do |opts|
26
27
  option_set(opts).each do |k,v|
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module Helper
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -58,6 +58,13 @@ describe Knife::Helper::Commands do
58
58
  'attribute' => 'ipaddress'
59
59
  }
60
60
  },
61
+ {
62
+ 'name' => 'knife-zero-opts-3',
63
+ 'command' => 'zero chef_client',
64
+ 'condition' => 'name:*',
65
+ 'option_sets' => 'test_set02',
66
+ 'options' => nil
67
+ },
61
68
  {
62
69
  'name' => 'help',
63
70
  'command' => 'help',
@@ -85,6 +92,10 @@ describe Knife::Helper::Commands do
85
92
  expect(@cmd.build('knife-zero-opts-2')).to eq(
86
93
  '/test/knife zero chef_client \'name:*\' -i ~/.ssh/knife-helper-example.pem -x ubuntu --sudo --attribute ipaddress')
87
94
  end
95
+ example do
96
+ expect(@cmd.build('knife-zero-opts-3')).to eq(
97
+ '/test/knife zero chef_client \'name:*\' -x ec2-user')
98
+ end
88
99
  end
89
100
 
90
101
  describe '#complete_option' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masashi Terui
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-21 00:00:00.000000000 Z
11
+ date: 2015-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor