magellan-cli 0.7.7 → 0.7.8
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/magellan/cli/resources/worker.rb +3 -0
- data/lib/magellan/cli/version.rb +1 -1
- data/spec/magellan/cli/resources/worker_spec.rb +41 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eaf44b4848ef344245560201a6bd2002568390b
|
4
|
+
data.tar.gz: 3e49f7856cddfad11605f11d5f14e79727378ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f83dd49a863e774fc1eafc38a7b59f24c50ffbcf7b362ec0dd1abb050e62b219eb0ea69dad68a48dc8f9a733cfecfd5b48601ef811e51dec2b79f1deaad1f3a
|
7
|
+
data.tar.gz: 252aa45926872c0d8ca4411f29bdbebe716fbe76a5a20bb810f43e659708bc2b32f866d0ae4ecf1b20651e102a9e28d265103bba45c26f00613c0180ff2aada9
|
data/Gemfile.lock
CHANGED
@@ -51,6 +51,9 @@ module Magellan
|
|
51
51
|
parameter_name => attrs
|
52
52
|
}
|
53
53
|
put_json("/admin/#{resource_key}/#{w["id"]}/edit.js", params)
|
54
|
+
if v = attrs[self.class.caption_attr]
|
55
|
+
select(v)
|
56
|
+
end
|
54
57
|
end
|
55
58
|
|
56
59
|
desc "prepare_images", I18n.t(:prepare_images, scope: [:resources, :worker, :cmd], images_name: Image.resource_name.pluralize, worker_name: Worker.resource_name)
|
data/lib/magellan/cli/version.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Magellan::Cli::Resources::Worker do
|
5
|
+
|
6
|
+
let(:cmd){ Magellan::Cli::Resources::Worker.new }
|
7
|
+
|
8
|
+
let(:http_conn){ double(:http_conn, :check_login_auth! => nil) }
|
9
|
+
before{ allow(cmd).to receive(:http_conn).and_return(http_conn) }
|
10
|
+
|
11
|
+
describe :update do
|
12
|
+
describe :success do
|
13
|
+
before do
|
14
|
+
allow(cmd).to receive(:load_selections).and_return(
|
15
|
+
{Magellan::Cli::Resources::Worker.parameter_name => {"id" => 3, "name" => "worker1"}})
|
16
|
+
end
|
17
|
+
|
18
|
+
it "update name" do
|
19
|
+
attrs = {"name" => "worker2"}
|
20
|
+
res = {"id" => 3, "name" => "worker2"}
|
21
|
+
expect(cmd).to receive(:put_json).with("/admin/functions~worker/3/edit.js", { "functions_worker" => attrs })
|
22
|
+
allow(cmd).to receive(:default_query).and_return({})
|
23
|
+
allow(cmd).to receive(:get_json).with("/admin/functions~worker.json", an_instance_of(Hash)).and_return([res])
|
24
|
+
allow(cmd).to receive(:update_selections!).with("functions_worker" => res)
|
25
|
+
allow(cmd).to receive(:update_selections!)
|
26
|
+
cmd.update(attrs.to_json)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "update image_name" do
|
30
|
+
attrs = {"image_name" => "groovenauts/worker:0.0.1"}
|
31
|
+
res = {"id" => 3, "image_name" => "groovenauts/worker:0.0.2"}
|
32
|
+
expect(cmd).to receive(:put_json).with("/admin/functions~worker/3/edit.js", { "functions_worker" => attrs })
|
33
|
+
allow(cmd).to receive(:default_query).and_return({})
|
34
|
+
expect(cmd).to_not receive(:update_selections!).with("functions_worker" => res)
|
35
|
+
expect(cmd).to_not receive(:update_selections!)
|
36
|
+
cmd.update(attrs.to_json)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magellan-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akm2000
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -262,6 +262,7 @@ files:
|
|
262
262
|
- spec/magellan/cli/resources/organization_spec.rb
|
263
263
|
- spec/magellan/cli/resources/project_spec.rb
|
264
264
|
- spec/magellan/cli/resources/team_spec.rb
|
265
|
+
- spec/magellan/cli/resources/worker_spec.rb
|
265
266
|
- spec/magellan/cli/script_spec.rb
|
266
267
|
- spec/magellan/cli_spec.rb
|
267
268
|
- spec/spec_helper.rb
|
@@ -310,6 +311,7 @@ test_files:
|
|
310
311
|
- spec/magellan/cli/resources/organization_spec.rb
|
311
312
|
- spec/magellan/cli/resources/project_spec.rb
|
312
313
|
- spec/magellan/cli/resources/team_spec.rb
|
314
|
+
- spec/magellan/cli/resources/worker_spec.rb
|
313
315
|
- spec/magellan/cli/script_spec.rb
|
314
316
|
- spec/magellan/cli_spec.rb
|
315
317
|
- spec/spec_helper.rb
|