pincers 0.7.9 → 0.7.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pincers/chenso/factory.rb +4 -5
- data/lib/pincers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3614304cfaeb3648c40ddc68f10a83d655a5579b
|
4
|
+
data.tar.gz: 912879b117cb00d1198c1a809398809930acbb61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 808bd93e415cca14da9fb0613cb333316f4951d056393479909d6b408e8e170bf241e34dc0ffc8b620a58082f392a2532b8aa51589bfe62966112ce93d8d39ed
|
7
|
+
data.tar.gz: f27dd729231d1411e7827f01d7ac14ea520b92282bd256d19344f98be76586e4df6920bdf71f8b955f80d0eba442c4c9e3a51b2eaf875112d3949b9c5e3de156
|
@@ -6,22 +6,21 @@ module Pincers::Chenso
|
|
6
6
|
class Factory < Pincers::Core::BaseFactory
|
7
7
|
|
8
8
|
def load_backend(_options)
|
9
|
-
_options[:headers] = default_headers.merge! _options.fetch(:headers, {})
|
9
|
+
_options[:headers] = default_headers(_options).merge! _options.fetch(:headers, {})
|
10
10
|
client = Pincers::Http::Client.build_from_options _options
|
11
11
|
Pincers::Chenso::Backend.new client
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
-
def default_headers
|
16
|
+
def default_headers(_options)
|
17
17
|
{
|
18
|
-
'User-Agent' => user_agent
|
18
|
+
'User-Agent' => _options.fetch(:user_agent, default_user_agent)
|
19
19
|
}
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
22
|
+
def default_user_agent
|
23
23
|
"Pincers/#{Pincers::VERSION}"
|
24
24
|
end
|
25
|
-
|
26
25
|
end
|
27
26
|
end
|
data/lib/pincers/version.rb
CHANGED