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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 016146efdc342a98f2297f442fa7c34d7ce49c3d
4
- data.tar.gz: b53cc0168ff9fb5238864c5ae6264d32a5ab1e04
3
+ metadata.gz: 9eaf44b4848ef344245560201a6bd2002568390b
4
+ data.tar.gz: 3e49f7856cddfad11605f11d5f14e79727378ae6
5
5
  SHA512:
6
- metadata.gz: 3fcd9f07e89954c33fd96bd06795362d2d34774a5fcf3b4b5766a6199818fb095ec63a04d0ef32b10f86d81e21557e5df2ee82907a9ee9d342a2d22f481b06be
7
- data.tar.gz: 51ce3c723a3edcdabd9b7a7cea2fb1bdb4eb58beb0eec1131e5428956bcfff194c4182baffbeb781e8e9e2ecf6d9ea9a0a6aa1ebc4937d74f7579019621f4720
6
+ metadata.gz: 4f83dd49a863e774fc1eafc38a7b59f24c50ffbcf7b362ec0dd1abb050e62b219eb0ea69dad68a48dc8f9a733cfecfd5b48601ef811e51dec2b79f1deaad1f3a
7
+ data.tar.gz: 252aa45926872c0d8ca4411f29bdbebe716fbe76a5a20bb810f43e659708bc2b32f866d0ae4ecf1b20651e102a9e28d265103bba45c26f00613c0180ff2aada9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- magellan-cli (0.7.7)
4
+ magellan-cli (0.7.8)
5
5
  activesupport (~> 4.1.4)
6
6
  groovenauts-thor
7
7
  httpclient (~> 2.5)
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module Magellan
2
2
  module Cli
3
- VERSION = "0.7.7"
3
+ VERSION = "0.7.8"
4
4
  end
5
5
  end
@@ -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.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-25 00:00:00.000000000 Z
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