conoha 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ae1a9401c0b36ba74cf147b1c6757b84f392510
4
- data.tar.gz: 342a0c6c042a5645c7bb7ee9de5f262800f97b7c
3
+ metadata.gz: 08efbeb2adcb082922b6449cc5ba9d350f3142c3
4
+ data.tar.gz: 0e1154adce0023bfbe0d7a3f4b0b7c2bd01b9807
5
5
  SHA512:
6
- metadata.gz: 6f879fd4973a16369e9519b870cd5148e614ff7b4a8fe3a92ea01249835901450105f3f31901ae6a1417bda1df5003e21b6587d55c87beedf99e044b017857a5
7
- data.tar.gz: c7ea157269f5472d10699f6a909fbbb5dc945baeb5d802c84888a7a7158ca0176c82992faa0c6d718a31ea3ed998d21027052c3abd6efa6e5cb1b52667f80d61
6
+ metadata.gz: ffbb04f40a8d3ff7544133f0540fe52df5a04bea9fc591b778f3628ad9bc181edda998c5041fe62e271b7187c0b5d5fd4b5f0b5a6dba73edc09750346935f614
7
+ data.tar.gz: 513cd536da2a1c68a253c00c0d01556d7d1203a2839989a9e63844bc10eda880a7a6a4ad2932e557bf2b23286b75dde51c97a39bd734096926eb1f6a2417d307
@@ -3,4 +3,5 @@ rvm:
3
3
  - 2.0.0
4
4
  - 2.1.7
5
5
  - 2.2.3
6
- before_install: gem install bundler -v 1.10.6
6
+ - 2.3.0
7
+ before_install: gem install bundler -v 1.11.2
data/README.md CHANGED
@@ -163,4 +163,4 @@ conoharant browse 3000
163
163
 
164
164
  [MIT](http://opensource.org/licenses/MIT)
165
165
 
166
- Copyright (C) 2015 ka
166
+ Copyright (C) 2015-2016 ka
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
21
21
 
22
- spec.add_development_dependency "bundler", "~> 1.10"
23
- spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "bundler", "~> 1.11"
23
+ spec.add_development_dependency "rake", "~> 10.4"
24
24
  spec.add_development_dependency "test-unit", "~> 3.1.3"
25
25
  spec.add_development_dependency "test-unit-notify", "~> 1.0.4"
26
- spec.add_development_dependency "guard", "~> 2.13.0"
27
- spec.add_development_dependency "guard-test", "~> 2.0.6"
26
+ spec.add_development_dependency "guard", "~> 2.13"
27
+ spec.add_development_dependency "guard-test", "~> 2.0"
28
28
  end
@@ -26,7 +26,9 @@ require 'conoha/util'
26
26
  # Dump current status to ".conoharant/status.yml"
27
27
  # @params [Hash] status
28
28
  def dump_conoharant_status(status)
29
- File.open('.conoharant/status.yml', 'w').print(YAML.dump(status))
29
+ File.open('.conoharant/status.yml', 'w') do |f|
30
+ f.print(YAML.dump(status))
31
+ end
30
32
  end
31
33
 
32
34
  require 'conoha/version'
@@ -69,16 +69,19 @@ class Conoha
69
69
  JSON.parse(res.body)["server"]["status"]
70
70
  end
71
71
 
72
- def self.boot(server_id)
72
+ # @param [String] action "os-start" or "os-stop"
73
+ def self.server_action(server_id, action)
73
74
  uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
74
- res = https_post uri, {"os-start" => nil}, authtoken
75
+ res = https_post uri, {action => nil}, authtoken
75
76
  res.code == '202' ? 'OK' : 'Error'
76
77
  end
77
78
 
79
+ def self.boot(server_id)
80
+ server_action server_id, "os-start"
81
+ end
82
+
78
83
  def self.shutdown(server_id)
79
- uri = "https://compute.tyo1.conoha.io/v2/#{tenant_id}/servers/#{server_id}/action"
80
- res = https_post uri, {"os-stop" => nil}, authtoken
81
- res.code == '202' ? 'OK' : 'Error'
84
+ server_action server_id, "os-stop"
82
85
  end
83
86
 
84
87
  def self.images
@@ -166,7 +169,9 @@ EOS
166
169
  public_key: @@public_key,
167
170
  authtoken: @@authtoken,
168
171
  })
169
- File.open(config_file_path, 'w').write s
172
+ File.open(config_file_path, 'w') do |f|
173
+ f.write s
174
+ end
170
175
  end
171
176
 
172
177
  def self.tenant_id
@@ -1,3 +1,3 @@
1
1
  module ConohaVersion
2
- ITSELF = "0.3.0"
2
+ ITSELF = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conoha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ka
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-26 00:00:00.000000000 Z
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
19
+ version: '1.11'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '10.4'
34
34
  type: :development
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: '10.0'
40
+ version: '10.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 2.13.0
75
+ version: '2.13'
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
- version: 2.13.0
82
+ version: '2.13'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: guard-test
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 2.0.6
89
+ version: '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
- version: 2.0.6
96
+ version: '2.0'
97
97
  description: ConoHa VPS CLI Tool
98
98
  email:
99
99
  - ka.kaosf@gmail.com
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.4.5.1
142
+ rubygems_version: 2.5.1
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: ConoHa VPS CLI Tool