collins_shell 0.2.15 → 0.2.16
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.
- data/Gemfile +1 -1
- data/Gemfile.lock +4 -4
- data/VERSION +1 -1
- data/collins_shell.gemspec +2 -2
- data/lib/collins_shell/asset.rb +29 -0
- data/lib/collins_shell/cli.rb +1 -0
- metadata +3 -3
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,7 +2,7 @@ GEM
|
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
4
|
coderay (1.0.8)
|
5
|
-
collins_client (0.2.
|
5
|
+
collins_client (0.2.10)
|
6
6
|
httparty (~> 0.8.3)
|
7
7
|
diff-lcs (1.1.3)
|
8
8
|
git (1.2.5)
|
@@ -17,14 +17,14 @@ GEM
|
|
17
17
|
rdoc
|
18
18
|
json (1.7.5)
|
19
19
|
method_source (0.7.1)
|
20
|
-
multi_json (1.
|
20
|
+
multi_json (1.5.0)
|
21
21
|
multi_xml (0.5.1)
|
22
22
|
mustache (0.99.4)
|
23
23
|
pry (0.9.9.6)
|
24
24
|
coderay (~> 1.0.5)
|
25
25
|
method_source (~> 0.7.1)
|
26
26
|
slop (>= 2.4.4, < 3)
|
27
|
-
rake (10.0.
|
27
|
+
rake (10.0.3)
|
28
28
|
rdoc (3.12)
|
29
29
|
json (~> 1.4)
|
30
30
|
redcarpet (2.2.2)
|
@@ -46,7 +46,7 @@ PLATFORMS
|
|
46
46
|
ruby
|
47
47
|
|
48
48
|
DEPENDENCIES
|
49
|
-
collins_client (
|
49
|
+
collins_client (>= 0.2.10)
|
50
50
|
highline (~> 1.6.15)
|
51
51
|
jeweler (~> 1.8.3)
|
52
52
|
mustache (~> 0.99.4)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.16
|
data/collins_shell.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "collins_shell"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.16"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Blake Matheny"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-12-17"
|
13
13
|
s.description = "Provides basic CLI for interacting with Collins API"
|
14
14
|
s.email = "bmatheny@tumblr.com"
|
15
15
|
s.executables = ["collins-shell"]
|
data/lib/collins_shell/asset.rb
CHANGED
@@ -148,6 +148,35 @@ module CollinsShell
|
|
148
148
|
end
|
149
149
|
end
|
150
150
|
|
151
|
+
desc 'set_attributes KEY=VALUE [KEY=VALUE,...]', 'set multiple attributes on an asset in collins'
|
152
|
+
use_collins_options
|
153
|
+
use_tag_option
|
154
|
+
use_selector_option
|
155
|
+
def set_attributes *hash
|
156
|
+
attributes = hash.inject({}) do |ret, e|
|
157
|
+
k, v = e.split('=', 2)
|
158
|
+
if k.nil? or v.nil? then
|
159
|
+
k, v = e.split(':', 2)
|
160
|
+
if k.nil? or v.nil? then
|
161
|
+
raise ::CollinsShell::RequirementFailedError.new "Expected key=value (or key:value) format"
|
162
|
+
end
|
163
|
+
end
|
164
|
+
ret[k] = v
|
165
|
+
ret
|
166
|
+
end
|
167
|
+
batch_selector_operation Hash[
|
168
|
+
:remote => options.remote,
|
169
|
+
:operation => "set_attributes",
|
170
|
+
:success_message => proc {|asset| "Set attributes on #{asset.tag}"},
|
171
|
+
:error_message => proc{|asset| "Setting attributes on #{asset.tag}"},
|
172
|
+
:confirmation_message => proc do |assets|
|
173
|
+
"You are about to set #{attributes.inspect} on #{assets.length} hosts. ARE YOU SURE?"
|
174
|
+
end
|
175
|
+
] do |client,asset|
|
176
|
+
client.set_multi_attribute!(asset, attributes)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
151
180
|
desc 'delete_attribute KEY', 'delete an attribute in collins'
|
152
181
|
use_collins_options
|
153
182
|
use_tag_option
|
data/lib/collins_shell/cli.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: collins_shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.16
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: collins_client
|
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
segments:
|
186
186
|
- 0
|
187
|
-
hash: -
|
187
|
+
hash: -885619558922916100
|
188
188
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
189
|
none: false
|
190
190
|
requirements:
|