knife-helper 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +12 -3
- data/lib/knife/helper/commands.rb +1 -0
- data/lib/knife/helper/version.rb +1 -1
- data/spec/knife/helper/commands_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d4b237c333ed70fda38c3f29245fb32e47dbea4
|
4
|
+
data.tar.gz: 45615aad52e32b1b0c9753d649a757201663cbaa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af366ce80da28f92bc4672a2bddab83e8026a66ac33a76804c494f7ef65460f7918788a41c4c9e0eea543742d54e14a0e51d4a549b11fd0a76c00e1acdc88c3e
|
7
|
+
data.tar.gz: 7cfa50874c851e561ae5ea8506277f21f853b442322decb6af71ed4e57d8a7236aaacba51d371bb7ede3ad16a01677b6fdd393befc57cdc5f5d0b6e4436a47b5
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -71,17 +71,22 @@ includes:
|
|
71
71
|
- example.yml
|
72
72
|
|
73
73
|
settings:
|
74
|
-
command_base:
|
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:
|
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|
|
data/lib/knife/helper/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|