barthes 0.0.29 → 0.0.30

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.
@@ -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
- module Barthes
13
- module Client
14
- class Ace
15
- OPTION_KEYS = %w(
16
- authorization_key
17
- signature_method
18
- authorization_prefix
19
- service
20
- region
21
- host
22
- nonce
23
- access_key_id_key
24
- path
25
- use_ssl
26
- endpoint
27
- response_format
28
- http_method
29
- access_key_id
30
- secret_access_key
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
- def initialize(env)
35
- # TODO: validate existence of required options
36
- @options = env.slice(*OPTION_KEYS).symbolize_keys
37
- if env['client'] && env['client']['user']
38
- @user = env['client']['user']
39
- @options['access_key_id'] = env['client']['access_key_id']
40
- @options['secret_access_key'] = env['client']['secret_access_key']
41
- @options.update(env['client'].slice(*OPTION_KEYS).symbolize_keys)
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
@@ -1,3 +1,3 @@
1
1
  module Barthes
2
- VERSION = "0.0.29"
2
+ VERSION = "0.0.30"
3
3
  end
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.29
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: 716319849375049555
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: 716319849375049555
250
+ hash: 1229056123091781841
251
251
  requirements: []
252
252
  rubyforge_project:
253
253
  rubygems_version: 1.8.24