qingcloudserver 0.0.4 → 0.0.5
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/lib/client/connector.rb +5 -1
- data/lib/client/{service_foudation.rb → service_foundation.rb} +0 -0
- data/lib/qingcloud_server.rb +2 -1
- data/lib/utility/setting.rb +14 -0
- data/lib/version.rb +1 -1
- data/test/server_test.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ef17d989f31e0c2a3dbb6d2d21b283534fa85db
|
4
|
+
data.tar.gz: 2572d6e3168de051f94464f9517676f624847fb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33bb66ecdbe00f921f8db39e99d814eb441e73f314938a19b646fd34512ef576f6f0391de36c0488b6eed97c1b92e5a50be49b279719e3e6adc8764af157fe9c
|
7
|
+
data.tar.gz: b0205f6ee543abe2c0626f944e23ce8ef28740528bbf2ee9f9442463566bfc86d718ac7a4204feefb87ab57be15cec98eb4abb12bf8f1a2468c4aeb9d9ee2ad9
|
data/lib/client/connector.rb
CHANGED
@@ -20,8 +20,12 @@ module QingCloudServer
|
|
20
20
|
Connector.new(public_key, secret_key)
|
21
21
|
end
|
22
22
|
|
23
|
+
def self.init_with_config
|
24
|
+
config_hash_file = Utility.read_config_file
|
25
|
+
Connector.new(config_hash_file["public_key"], config_hash_file["private_key"])
|
26
|
+
end
|
27
|
+
|
23
28
|
def fetch_server_condition(action, params)
|
24
|
-
# request_url = APIAddress + "&action=#{action}"
|
25
29
|
|
26
30
|
params.update(
|
27
31
|
:action => action,
|
File without changes
|
data/lib/qingcloud_server.rb
CHANGED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'json'
|
2
|
+
module QingCloudServer
|
3
|
+
module Utility
|
4
|
+
|
5
|
+
CONFIG_FILE_PATH = "#{Dir.home}/.qingcloudserver/qingcloud.json"
|
6
|
+
|
7
|
+
def self.read_config_file
|
8
|
+
config_json_file = ""
|
9
|
+
File.open(CONFIG_FILE_PATH) {|file| config_json_file = file.read } if File.exist?(CONFIG_FILE_PATH)
|
10
|
+
JSON.parse(config_json_file)
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
data/lib/version.rb
CHANGED
data/test/server_test.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'qingcloud_server'
|
2
2
|
|
3
|
-
connector = QingCloudServer::Client::Connector.
|
3
|
+
connector = QingCloudServer::Client::Connector.init_with_config
|
4
4
|
service = QingCloudServer::Client::Service.new(connector)
|
5
5
|
|
6
6
|
# tj = status_N: ["running"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qingcloudserver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gao yuehua
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: another sdk for QingCloud servers
|
14
14
|
email:
|
@@ -20,8 +20,9 @@ files:
|
|
20
20
|
- README.md
|
21
21
|
- lib/client/connector.rb
|
22
22
|
- lib/client/service.rb
|
23
|
-
- lib/client/
|
23
|
+
- lib/client/service_foundation.rb
|
24
24
|
- lib/qingcloud_server.rb
|
25
|
+
- lib/utility/setting.rb
|
25
26
|
- lib/version.rb
|
26
27
|
- qingcloudserver.gemspec
|
27
28
|
- test/server_test.rb
|