barthes 0.0.28 → 0.0.29

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,54 @@
1
+ require 'ace-client'
2
+ require 'active_support/core_ext/hash/keys'
3
+
4
+ class AceClient::Base
5
+ query_string_normalizer proc { |query|
6
+ query.map do |key, value|
7
+ "#{CGI.escape key}=#{CGI.escape value}"
8
+ end.join('&')
9
+ }
10
+ end
11
+
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
+ )
33
+
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
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,8 @@
1
+ require 'barthes/client/ace'
2
+
3
+ class Barthes::Client::AceQuery2 < Barthes::Client::Ace
4
+ def initialize(env)
5
+ super(env)
6
+ @client = AceClient::Query2.new(@options)
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ class Barthes::Client::AceQuery3 < Barthes::Client::Ace
2
+ def initialize(env)
3
+ super(env)
4
+ @client = AceClient::Query3.new(@options)
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ class Barthes::Client::AceQuery4 < Barthes::Client::Ace
2
+ def initialize(env)
3
+ super(env)
4
+ @client = AceClient::Query3.new(@options)
5
+ end
6
+ end
7
+
@@ -1,3 +1,3 @@
1
1
  module Barthes
2
- VERSION = "0.0.28"
2
+ VERSION = "0.0.29"
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.28
4
+ version: 0.0.29
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -209,6 +209,10 @@ files:
209
209
  - lib/barthes/action.rb
210
210
  - lib/barthes/cache.rb
211
211
  - lib/barthes/cli.rb
212
+ - lib/barthes/client/ace.rb
213
+ - lib/barthes/client/ace_query2.rb
214
+ - lib/barthes/client/ace_query3.rb
215
+ - lib/barthes/client/ace_query4.rb
212
216
  - lib/barthes/client/httparty.rb
213
217
  - lib/barthes/client/mysql.rb
214
218
  - lib/barthes/client/pgsql.rb
@@ -234,7 +238,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
238
  version: '0'
235
239
  segments:
236
240
  - 0
237
- hash: -3666814344530002559
241
+ hash: 716319849375049555
238
242
  required_rubygems_version: !ruby/object:Gem::Requirement
239
243
  none: false
240
244
  requirements:
@@ -243,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
247
  version: '0'
244
248
  segments:
245
249
  - 0
246
- hash: -3666814344530002559
250
+ hash: 716319849375049555
247
251
  requirements: []
248
252
  rubyforge_project:
249
253
  rubygems_version: 1.8.24