libgss 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/libgss/async_action_request.rb +9 -1
- data/lib/libgss/http_client_with_signature_key.rb +10 -3
- data/lib/libgss/network.rb +6 -2
- data/lib/libgss/version.rb +1 -1
- metadata +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d65517f74f8f6290c265bde2dcfa858974f4ee8
|
4
|
+
data.tar.gz: f1b27493e24d26c5990a5885fede27f07d62bd7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64a4ad4a6de5294fb7f28fef442e51614967e8afc82f227f8307cc15f51f375598c4c48bc51f01cee8008820797443fd62085a6f234fd9f4456163b68ef454e9
|
7
|
+
data.tar.gz: 0de31d99679a417841856d0b828b210a58ee04f4152f2c66301757ab02740919657fc709e153970a61de6c34d80fcf7c4874e08e71de3298e27caaf93b388ccf
|
data/Gemfile.lock
CHANGED
@@ -10,6 +10,14 @@ module Libgss
|
|
10
10
|
|
11
11
|
attr_reader :ids
|
12
12
|
attr_accessor :action_id
|
13
|
+
attr_accessor :result_url
|
14
|
+
|
15
|
+
|
16
|
+
# コンストラクタ
|
17
|
+
def initialize(httpclient, action_url, result_url, req_headers)
|
18
|
+
super(httpclient, action_url, req_headers)
|
19
|
+
@result_url = result_url
|
20
|
+
end
|
13
21
|
|
14
22
|
# アクション群を実行するために実際にHTTPリクエストを送信します。
|
15
23
|
def send_request(&callback)
|
@@ -34,7 +42,7 @@ module Libgss
|
|
34
42
|
def async_status()
|
35
43
|
raise Error, "failed to get response. please exec send_request before call." unless @ids
|
36
44
|
|
37
|
-
res = @httpclient.get(
|
45
|
+
res = @httpclient.get(result_url, {input_ids: @ids.join(',')}, req_headers)
|
38
46
|
case res.code.to_i
|
39
47
|
when 200..299 then # OK
|
40
48
|
else
|
@@ -42,7 +42,10 @@ module Libgss
|
|
42
42
|
}
|
43
43
|
|
44
44
|
signature_class = Libgss.use_oauth_gem ? ::OAuth::Signature : Signature
|
45
|
-
|
45
|
+
if ENV["VERBOSE"]
|
46
|
+
$stdout.puts("signature_class: #{signature_class.name}")
|
47
|
+
$stdout.puts(" req_hash: #{req_hash.inspect}")
|
48
|
+
end
|
46
49
|
|
47
50
|
headers["oauth_signature"] = signature_class.sign(req_hash, options)
|
48
51
|
|
@@ -57,6 +60,7 @@ module Libgss
|
|
57
60
|
"oauth_timestamp" => oauth_timestamp,
|
58
61
|
}
|
59
62
|
oauth_params = {
|
63
|
+
"body" => '',
|
60
64
|
"oauth_signature_method" => "HMAC-SHA1"
|
61
65
|
}.update(headers)
|
62
66
|
|
@@ -83,7 +87,7 @@ module Libgss
|
|
83
87
|
uri += encoded_query.gsub(/^&/, '?')
|
84
88
|
end
|
85
89
|
req_hash = {
|
86
|
-
"method" => "
|
90
|
+
"method" => "GET",
|
87
91
|
"uri" => uri,
|
88
92
|
"parameters" => oauth_params
|
89
93
|
}
|
@@ -94,7 +98,10 @@ module Libgss
|
|
94
98
|
}
|
95
99
|
|
96
100
|
signature_class = Libgss.use_oauth_gem ? ::OAuth::Signature : Signature
|
97
|
-
|
101
|
+
if ENV["VERBOSE"]
|
102
|
+
$stdout.puts("signature_class: #{signature_class.name}")
|
103
|
+
$stdout.puts(" req_hash: #{req_hash.inspect}")
|
104
|
+
end
|
98
105
|
|
99
106
|
headers["oauth_signature"] = signature_class.sign(req_hash, options)
|
100
107
|
|
data/lib/libgss/network.rb
CHANGED
@@ -118,7 +118,7 @@ module Libgss
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def new_async_action_request
|
121
|
-
AsyncActionRequest.new(httpclient_for_action,
|
121
|
+
AsyncActionRequest.new(httpclient_for_action, async_action_url, async_result_url, req_headers)
|
122
122
|
end
|
123
123
|
|
124
124
|
def new_public_asset_request(asset_path)
|
@@ -183,10 +183,14 @@ module Libgss
|
|
183
183
|
@action_url ||= base_url + "/api/#{API_VERSION}/actions.json?auth_token=#{auth_token}"
|
184
184
|
end
|
185
185
|
|
186
|
-
def
|
186
|
+
def async_action_url
|
187
187
|
@async_action_url ||= base_url + "/api/#{API_VERSION}/async_actions.json?auth_token=#{auth_token}"
|
188
188
|
end
|
189
189
|
|
190
|
+
def async_result_url
|
191
|
+
@async_result_url ||= base_url + "/api/#{API_VERSION}/async_results.json?auth_token=#{auth_token}"
|
192
|
+
end
|
193
|
+
|
190
194
|
def public_asset_url(asset_path)
|
191
195
|
"#{@public_asset_url_prefix}#{asset_path}#{@public_asset_url_suffix}"
|
192
196
|
end
|
data/lib/libgss/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libgss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akima
|
@@ -195,4 +195,3 @@ test_files:
|
|
195
195
|
- spec/protected_assets/Icon.png
|
196
196
|
- spec/public_assets/Default.png
|
197
197
|
- spec/spec_helper.rb
|
198
|
-
has_rdoc:
|