libgss 0.7.0 → 0.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f34218d9370b8d31892b2dc9bc43883c18d3c0b
4
- data.tar.gz: d77691024b3ea4a7bb346f6aac4503896383e1c6
3
+ metadata.gz: 9d65517f74f8f6290c265bde2dcfa858974f4ee8
4
+ data.tar.gz: f1b27493e24d26c5990a5885fede27f07d62bd7b
5
5
  SHA512:
6
- metadata.gz: ea8da56f9d588bfd1b9d1970749ea87b7ed09a565caf8675ebf4c7ad7770223079f0331489a2daa97d20a7c82e425ea666df9ce1b4a00623b11e36249a18b255
7
- data.tar.gz: 96bc30423526821e4074b20d1cfcc26d7a5f4f850955cfb77f902e43a1e7f2420b1a1e7d7c1227abf42a1f8da79154eb5deb2f6f253f38c5a0a7b8edf1758b13
6
+ metadata.gz: 64a4ad4a6de5294fb7f28fef442e51614967e8afc82f227f8307cc15f51f375598c4c48bc51f01cee8008820797443fd62085a6f234fd9f4456163b68ef454e9
7
+ data.tar.gz: 0de31d99679a417841856d0b828b210a58ee04f4152f2c66301757ab02740919657fc709e153970a61de6c34d80fcf7c4874e08e71de3298e27caaf93b388ccf
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- libgss (0.7.0)
4
+ libgss (0.7.1)
5
5
  httpclient
6
6
  json
7
7
  oauth
@@ -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(action_url, {input_ids: @ids.join(',')}, req_headers)
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
- $stdout.puts("signature_class: #{signature_class.name}") if ENV["VERBOSE"]
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" => "POST",
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
- $stdout.puts("signature_class: #{signature_class.name}") if ENV["VERBOSE"]
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
 
@@ -118,7 +118,7 @@ module Libgss
118
118
  end
119
119
 
120
120
  def new_async_action_request
121
- AsyncActionRequest.new(httpclient_for_action, aync_action_url, req_headers)
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 aync_action_url
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
@@ -1,3 +1,3 @@
1
1
  module Libgss
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
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.0
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: