barthes 0.0.29 → 0.0.30
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/barthes/client/ace.rb +36 -39
- data/lib/barthes/version.rb +1 -1
- metadata +3 -3
data/lib/barthes/client/ace.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'ace-client'
|
2
|
+
require 'barthes/client/httparty'
|
2
3
|
require 'active_support/core_ext/hash/keys'
|
3
4
|
|
4
5
|
class AceClient::Base
|
@@ -9,46 +10,42 @@ class AceClient::Base
|
|
9
10
|
}
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
timeout
|
32
|
-
)
|
13
|
+
class Barthes::Client::Ace < Barthes::Client::HTTParty
|
14
|
+
OPTION_KEYS = %w(
|
15
|
+
authorization_key
|
16
|
+
signature_method
|
17
|
+
authorization_prefix
|
18
|
+
service
|
19
|
+
region
|
20
|
+
host
|
21
|
+
nonce
|
22
|
+
access_key_id_key
|
23
|
+
path
|
24
|
+
use_ssl
|
25
|
+
endpoint
|
26
|
+
response_format
|
27
|
+
http_method
|
28
|
+
access_key_id
|
29
|
+
secret_access_key
|
30
|
+
timeout
|
31
|
+
)
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
def action(params)
|
46
|
-
params = params.dup
|
47
|
-
action = params.delete('Action')
|
48
|
-
params ||= {}
|
49
|
-
response = @client.action(action, params)
|
50
|
-
response
|
51
|
-
end
|
33
|
+
def initialize(env)
|
34
|
+
# TODO: validate existence of required options
|
35
|
+
@options = env.slice(*OPTION_KEYS).symbolize_keys
|
36
|
+
if env['client'] && env['client']['user']
|
37
|
+
@user = env['client']['user']
|
38
|
+
@options['access_key_id'] = env['client']['access_key_id']
|
39
|
+
@options['secret_access_key'] = env['client']['secret_access_key']
|
40
|
+
@options.update(env['client'].slice(*OPTION_KEYS).symbolize_keys)
|
52
41
|
end
|
53
42
|
end
|
43
|
+
|
44
|
+
def action(params)
|
45
|
+
params = params.dup
|
46
|
+
action = params.delete('Action')
|
47
|
+
params ||= {}
|
48
|
+
response = @client.action(action, params)
|
49
|
+
response
|
50
|
+
end
|
54
51
|
end
|
data/lib/barthes/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barthes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.30
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -238,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
238
238
|
version: '0'
|
239
239
|
segments:
|
240
240
|
- 0
|
241
|
-
hash:
|
241
|
+
hash: 1229056123091781841
|
242
242
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
243
243
|
none: false
|
244
244
|
requirements:
|
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
247
|
version: '0'
|
248
248
|
segments:
|
249
249
|
- 0
|
250
|
-
hash:
|
250
|
+
hash: 1229056123091781841
|
251
251
|
requirements: []
|
252
252
|
rubyforge_project:
|
253
253
|
rubygems_version: 1.8.24
|