gcloud-cli 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWFhMTg2MTRlMDFhMTg2NDdkMDZmZTBkNzU4OGViOGQwMTI5MGRmNg==
4
+ NjQyNjFmNWY2ZTAxNmE4OGEyM2Q1NDMwMGZjNzUzZmFhMDRlYzczMg==
5
5
  data.tar.gz: !binary |-
6
- MDQ1MjhkNjFhODE2YjA0Njk3ZDVkOTg3ZWYxOWQ3YzJiZTI1NWVmZA==
6
+ ZGIyMjY5YWU5ZWFiZmIzZTgwMGQ4NzE3YTU1Mzc0Y2MzNTgzNDI2OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDlkYWNlNDI3ODE4NTBmMjFmZTM0OGNmNzlkZDczOTliZjE2ODdiYjQxYmU4
10
- ZjI2ZTcyYWQ5NGFmYjFjNjZkNDYyNTZmYTdhNTFkOTA5NTg3ZTlkYjVmOTZi
11
- OGU3NTVlNzhlNDgxNmRkYWFmZTIxODA2ZTM5OGYyODkyOTk0MTk=
9
+ ODAxZmQzNzg0MWJjOWFlYWNmMjc5YWVkODM4YzMxZTk1ZDUyNWY1YmVhMDcw
10
+ YWNhM2U0NWUxMDFlNjRkYzg1NDRmMGNlZmUxYTY0YzYwMGE2MDVkYzNiNWEz
11
+ N2EyYTMzNDhiYmFlNGNhM2E3YmQzM2NlZTBmMjM5MDhiMzBhMjA=
12
12
  data.tar.gz: !binary |-
13
- NjJmMWVjNDJkZmQ5ODQyM2I1MWFkOWQwYzliZmQyYTY5YzBjZGJhZmU2ZjZj
14
- YzRlMWRmZDQ1Y2IyMzc3YTZjZmU5MjlhMmEwZWY3ZmE4ZGFkODBkN2NjNjBk
15
- OWNiY2VkMzkxYzVmOGRiYTIxZWU2YjVhZDU3ZDU3MmFkODk5NDI=
13
+ OTA5OGVlZTE2ZGZjM2I0NmFmNDhhNWQ0Y2YxZDZmN2FjZDk4M2E4ODM4MzMy
14
+ ZjViYTkwN2VhMWRjNDMwZWNmYjYwNmY2MDU3MTU3YTYxODk0MDFkOTFjMDkz
15
+ N2I0YzE1MTE4NTMyMDhjMWJmYWM3NGFhYzMxYTQ1Y2EwYjg0Y2I=
@@ -1,14 +1,15 @@
1
1
  require 'rest_client'
2
2
  require 'gcloud/cli/version'
3
3
  require 'gcloud/cli/config_repository'
4
+ require 'json'
4
5
 
5
6
  module Gcloud
6
7
  module Cli
7
- module_function
8
+ extend self
8
9
 
9
- def create_gorgon_cluster
10
+ def create_gorgon_cluster(grid_configuration_name)
10
11
  config = ConfigRepository.find_or_create
11
- result = JSON[RestClient.post(config.create_cluster_url, api_key: config.api_key)]
12
+ result = JSON[post_create_cluster(config, grid_configuration_name)]
12
13
 
13
14
  { cluster_id: result['cluster_id'] }
14
15
  end
@@ -17,5 +18,14 @@ module Gcloud
17
18
  config = ConfigRepository.find_or_create
18
19
  RestClient.post(config.release_cluster_url(cluster_id), api_key: config.api_key)
19
20
  end
21
+
22
+ private
23
+
24
+ def post_create_cluster(config, grid_configuration_name)
25
+ RestClient.post(config.create_cluster_url,
26
+ api_key: config.api_key,
27
+ grid_configuration_name: grid_configuration_name
28
+ )
29
+ end
20
30
  end
21
31
  end
@@ -1,5 +1,5 @@
1
1
  module Gcloud
2
2
  module Cli
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -7,11 +7,13 @@ module Gcloud::Cli
7
7
 
8
8
  it "loads config and posts request" do
9
9
  allow(ConfigRepository).to receive(:load).and_return(Config.new(url, api_key))
10
+ expect(RestClient).to receive(:post).
11
+ with("#{url}/clusters", api_key: api_key, grid_configuration_name: 'that_grid').
12
+ and_return(JSON[cluster_id: 'a-cluster-id'])
10
13
 
11
- expect(RestClient).to receive(:post).with("#{url}/clusters", api_key: api_key).
12
- and_return(JSON[cluster_id: 'a-cluster-id'])
14
+ result = Gcloud::Cli.create_gorgon_cluster('that_grid')
13
15
 
14
- expect(Gcloud::Cli.create_gorgon_cluster).to eq({cluster_id: 'a-cluster-id'})
16
+ expect(result).to eq({cluster_id: 'a-cluster-id'})
15
17
  end
16
18
 
17
19
  it "posts relases cluster request" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gcloud-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arturo Pie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-07 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json