richurls 0.5.7 → 0.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ffe4a9521f5ba179be0019c5e21f5d2c72fed6996e00256fef275d6234874370
4
- data.tar.gz: c65e5d58fd91158a19273b3f12470e4cd781d8e67726a229b654efba74904ef4
3
+ metadata.gz: 4030ed06bc0c13f5707d3a061e6561eb8229fa48b6d3499fbe7d434c7fa0d433
4
+ data.tar.gz: 8e324278bcc431ddd8cffe70ce17cf0d81dc8e3e9dbe13d93508f38e6a4efef5
5
5
  SHA512:
6
- metadata.gz: b594e90b8c1b184ccc63ef0f209965f7dbb031eaec4f6e58430547bd673989417d5db6f339b1d7ef193432b193727e3d3b1ecf9b82e18a8c6b2818008b80b112
7
- data.tar.gz: 9c6e6b80db7bc47ae3a368bede001b0903171314bd61d852cd30c0f66dd3fc8cb2804ad3c2684db89a39f8e14e8445833f1eed6ff7891795ac3922c084aa00ba
6
+ metadata.gz: 2ed70d90e7231dc89c0d7c152ffbdf085339c65ddf8737a9d997874dc67a34900b5768b5529f8e76bb6a2f557458f51411fd3923bd9416ae09815b4afb5996c9
7
+ data.tar.gz: 319f776fd40d680038bd134b620c779a49d263a858afc703f44b1eedf22bb6e58ee5016011ccbc8a075b917a32b83d0c42c54f2ff5c18b26657566a303513e9d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- richurls (0.5.7)
4
+ richurls (0.5.8)
5
5
  addressable (~> 2)
6
6
  oj (~> 3)
7
7
  ox (~> 2)
@@ -7,7 +7,6 @@ require_relative 'url_fetcher'
7
7
  require_relative 'body_decorator'
8
8
 
9
9
  module RichUrls
10
- DEFAULT_USER_AGENT = 'richurls'.freeze
11
10
  class MalformedURLError < StandardError; end
12
11
 
13
12
  def self.cache
@@ -23,12 +22,12 @@ module RichUrls
23
22
  @cache ||= wrapper
24
23
  end
25
24
 
26
- def self.user_agent=(user_agent)
27
- @user_agent ||= user_agent
25
+ def self.headers=(headers)
26
+ @headers ||= headers
28
27
  end
29
28
 
30
- def self.user_agent
31
- @user_agent || DEFAULT_USER_AGENT
29
+ def self.headers
30
+ @headers || {}
32
31
  end
33
32
 
34
33
  def self.enrich(url, filter: [], cache_time: nil)
@@ -38,9 +38,7 @@ module RichUrls
38
38
  def patron_call
39
39
  session = Patron::Session.new(
40
40
  timeout: DEFAULT_TIMEOUT,
41
- headers: {
42
- 'User-Agent' => RichUrls.user_agent
43
- }
41
+ headers: RichUrls.headers
44
42
  )
45
43
 
46
44
  response = session.get(@url)
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'richurls'
6
- spec.version = '0.5.7'
6
+ spec.version = '0.5.8'
7
7
  spec.authors = ['grdw']
8
8
  spec.email = ['gerard@wetransfer.com']
9
9
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richurls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - grdw
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-22 00:00:00.000000000 Z
11
+ date: 2020-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable