barthes 0.0.16 → 0.0.17
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.
- data/Rakefile +1 -0
- data/lib/barthes/action.rb +1 -1
- data/lib/barthes/client/httparty.rb +10 -0
- data/lib/barthes/version.rb +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
data/lib/barthes/action.rb
CHANGED
|
@@ -7,7 +7,7 @@ module Barthes
|
|
|
7
7
|
def initialize(env)
|
|
8
8
|
@env = env.dup
|
|
9
9
|
client_class = @env['client_class'] ? @env['client_class'].constantize : Barthes::Client::HTTParty
|
|
10
|
-
@client = client_class.new(env)
|
|
10
|
+
@client = client_class.new(evalute_params env)
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
def indent(size, string)
|
|
@@ -8,10 +8,20 @@ module Barthes
|
|
|
8
8
|
|
|
9
9
|
def initialize(env)
|
|
10
10
|
@env = env
|
|
11
|
+
set_proxy
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def set_proxy
|
|
15
|
+
if proxy_uri = ENV['HTTP_PROXY']
|
|
16
|
+
uri = URI.parse(proxy_uri)
|
|
17
|
+
self.class.http_proxy uri.host, uri.port
|
|
18
|
+
end
|
|
11
19
|
end
|
|
12
20
|
|
|
13
21
|
def action(params)
|
|
14
22
|
url = @env['path'] ? @env['endpoint'] + @env['path'] : @env['endpoint']
|
|
23
|
+
headers = @env['header'] ? @env['header'] : {}
|
|
24
|
+
# TODO: method
|
|
15
25
|
self.class.post(url, query: params)
|
|
16
26
|
end
|
|
17
27
|
|
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.17
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-11-
|
|
12
|
+
date: 2014-11-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bundler
|