gcloud-cli 0.1.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZWFhMTg2MTRlMDFhMTg2NDdkMDZmZTBkNzU4OGViOGQwMTI5MGRmNg==
5
- data.tar.gz: !binary |-
6
- MDQ1MjhkNjFhODE2YjA0Njk3ZDVkOTg3ZWYxOWQ3YzJiZTI1NWVmZA==
2
+ SHA256:
3
+ metadata.gz: 3f2a67854269477a140fbb2fdbf02677c6ff8d9592e73314e1a7c33bcdad052c
4
+ data.tar.gz: 604773e6c4dd683535b8ae37b39bad8419c973d20213289d8a9b65f3e59c3912
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZDlkYWNlNDI3ODE4NTBmMjFmZTM0OGNmNzlkZDczOTliZjE2ODdiYjQxYmU4
10
- ZjI2ZTcyYWQ5NGFmYjFjNjZkNDYyNTZmYTdhNTFkOTA5NTg3ZTlkYjVmOTZi
11
- OGU3NTVlNzhlNDgxNmRkYWFmZTIxODA2ZTM5OGYyODkyOTk0MTk=
12
- data.tar.gz: !binary |-
13
- NjJmMWVjNDJkZmQ5ODQyM2I1MWFkOWQwYzliZmQyYTY5YzBjZGJhZmU2ZjZj
14
- YzRlMWRmZDQ1Y2IyMzc3YTZjZmU5MjlhMmEwZWY3ZmE4ZGFkODBkN2NjNjBk
15
- OWNiY2VkMzkxYzVmOGRiYTIxZWU2YjVhZDU3ZDU3MmFkODk5NDI=
6
+ metadata.gz: 5ec5bf6ecb34324bd696d0b7b32807adfe400493abadae8836324003032841e92db5e77fcbba6b1909d2ced4c234689db04c432bb9ea5ad453bef323c9403d4a
7
+ data.tar.gz: 0a6e0b75e2889d514912b3a792ffe116ff437b55606e7f5cfbb0afc909003cf0a63a953fdbc4194cab31e398279742ace5c2ecd4283605f441724a23bd01cf16
@@ -0,0 +1 @@
1
+ 2.4.2
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "json"
22
- spec.add_dependency "rest-client", "1.7.3"
22
+ spec.add_dependency "rest-client", "~> 2.0"
23
23
  spec.add_dependency "highline"
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.7"
@@ -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
@@ -6,7 +6,7 @@ module Gcloud::Cli
6
6
  module ConfigRepository
7
7
  extend self
8
8
 
9
- DEFAULT_URL = 'https://gcloud-nulogy-beta.herokuapp.com/'
9
+ DEFAULT_URL = ''
10
10
  CONFIG_FILE = ENV['HOME'] + '/.gcloud'
11
11
 
12
12
  def find_or_create
@@ -44,4 +44,4 @@ module Gcloud::Cli
44
44
  end
45
45
  end
46
46
  end
47
- end
47
+ end
@@ -1,5 +1,5 @@
1
1
  module Gcloud
2
2
  module Cli
3
- VERSION = "0.1.1"
3
+ VERSION = "0.3.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,97 +1,97 @@
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.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arturo Pie
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-07 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rest-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.3
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.7.3
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: highline
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.7'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.7'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '10.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 3.2.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.2.0
97
97
  description: This llibrary is used to communicate and authenticate with GCloud service.
@@ -101,8 +101,9 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - .gitignore
105
- - .rspec
104
+ - ".gitignore"
105
+ - ".rspec"
106
+ - ".ruby-version"
106
107
  - Gemfile
107
108
  - LICENSE.txt
108
109
  - README.md
@@ -119,24 +120,23 @@ homepage: ''
119
120
  licenses:
120
121
  - MIT
121
122
  metadata: {}
122
- post_install_message:
123
+ post_install_message:
123
124
  rdoc_options: []
124
125
  require_paths:
125
126
  - lib
126
127
  required_ruby_version: !ruby/object:Gem::Requirement
127
128
  requirements:
128
- - - ! '>='
129
+ - - ">="
129
130
  - !ruby/object:Gem::Version
130
131
  version: '0'
131
132
  required_rubygems_version: !ruby/object:Gem::Requirement
132
133
  requirements:
133
- - - ! '>='
134
+ - - ">="
134
135
  - !ruby/object:Gem::Version
135
136
  version: '0'
136
137
  requirements: []
137
- rubyforge_project:
138
- rubygems_version: 2.4.3
139
- signing_key:
138
+ rubygems_version: 3.1.2
139
+ signing_key:
140
140
  specification_version: 4
141
141
  summary: GCloud client.
142
142
  test_files: