richurls 0.2.0 → 0.2.1

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: c099711668f878f6935edf351d0c76735e30653f806a06f161c54f56d38e7191
4
- data.tar.gz: 4559b4fe4fad8f175384a127a5ffb93f71e3ed92b2c2d54aa0c8e8fecf5f4828
3
+ metadata.gz: 93f358614808a5627aaacc247e54591f077a6ab866e6c97018a82a1ad657179a
4
+ data.tar.gz: 4d9d11c4689d9f3d3e7e78424f34adb472a69b4afd26c6e5dd20c2803963229d
5
5
  SHA512:
6
- metadata.gz: d8634f5865f47911969e0b7f3c99bfc8d63ab972a1858ea83b817db4cdf32f2d9958eb58b16a162bc81ff2948508163be2cdb46d5d223b69605d983ed13d1c08
7
- data.tar.gz: c8a0b54e6adb5bd6e0a87c75745a38849c1c226a562ef3728df48e8f51d3a6fab30aa7930b57eb7fac9d6d445ce0630e4f2953917d36ac19a16eb9dcbc41882d
6
+ metadata.gz: a82b8cd82f64ce437cace564a5bc5fe56347663e750de0d49248eda9eac162237a4ea42bad34fa80e2caaf50551dea40f52fbe3ef1d660f6d44664257668657e
7
+ data.tar.gz: 8819107b7264449dde5a8575254079eac31a4289aea3460aaca05c618b01da948be98f9b98ff16f171ac09f1af8721841544bae4ceab54fdffd451bcebfbe064
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- richurls (0.2.0)
4
+ richurls (0.2.1)
5
5
  oj (~> 3)
6
6
  ox (~> 2)
7
7
  patron (~> 0.13)
data/README.md CHANGED
@@ -30,7 +30,7 @@ RichUrls.enrich('https://wetransfer.com')
30
30
  By default caching is turned off. Caching can be enabled by writing a cache wrapper as such:
31
31
 
32
32
  ```ruby
33
- class CustomCache < Cache::Wrapper
33
+ class CustomCache < RichUrls::Cache::Wrapper
34
34
  def get(key)
35
35
  # Callback for fetching a cache entry
36
36
  end
@@ -44,3 +44,9 @@ class CustomCache < Cache::Wrapper
44
44
  end
45
45
  end
46
46
  ```
47
+
48
+ Finally you can enable the `CustomCache` by adding:
49
+
50
+ ```ruby
51
+ RichUrls.cache = CustomCache
52
+ ```
data/lib/cache.rb CHANGED
@@ -1,23 +1,25 @@
1
- module Cache
2
- class Wrapper
3
- def get(_key)
4
- raise NotImplementedError, 'wrapper needs `get` method'
5
- end
1
+ module RichUrls
2
+ module Cache
3
+ class Wrapper
4
+ def get(_key)
5
+ raise NotImplementedError, 'wrapper needs `get` method'
6
+ end
6
7
 
7
- def set(_key, _value, _time)
8
- raise NotImplementedError, 'wrapper needs `set` method'
9
- end
8
+ def set(_key, _value, _time)
9
+ raise NotImplementedError, 'wrapper needs `set` method'
10
+ end
10
11
 
11
- def extend(_key, _time)
12
- raise NotImplementedError, 'wrapper needs `extend` method'
12
+ def extend(_key, _time)
13
+ raise NotImplementedError, 'wrapper needs `extend` method'
14
+ end
13
15
  end
14
- end
15
16
 
16
- class None < Wrapper
17
- def get(_); end
17
+ class None < Wrapper
18
+ def get(_); end
18
19
 
19
- def set(_, _, _); end
20
+ def set(_, _, _); end
20
21
 
21
- def extend(_); end
22
+ def extend(_); end
23
+ end
22
24
  end
23
25
  end
data/lib/richurls.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'oj'
2
- require 'redis'
3
2
  require 'uri'
4
3
  require 'digest'
5
4
 
data/richurls.gemspec CHANGED
@@ -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.2.0'
6
+ spec.version = '0.2.1'
7
7
  spec.authors = ['grdw']
8
8
  spec.email = ['gerard@wetransfer.com']
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: richurls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - grdw