xmlstats 1.3.0 → 1.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f588cd5dfc99679e6be5ae6d0aa13432a281989
4
- data.tar.gz: debca1c193278a183cc0b340fecd1a0b0fa2079c
3
+ metadata.gz: 5a1505e84e00c67227a36951d0ed280af7056ad9
4
+ data.tar.gz: eca920e8520c0736618bf0de0c24063e94876cab
5
5
  SHA512:
6
- metadata.gz: a89b5bbddf16bf7572d6f7af4d2df1e3bce9815a0825e01063bfccb718913832aef4d156e554c923515a0a5486d82e72e7e0d3e40ae04d545df36e3ca5c540cc
7
- data.tar.gz: d206fcd1c65df6ab74135f74f37f12d8daf4c8db6fb6fd65edc9edcc62922445e8a78c030e975fc28533a730a6e85cc60fdbfbbb68c2d1d1993298a1334a0d73
6
+ metadata.gz: befc00208d3e6b07a7a79aade812b57c325d383cdb2fbef7a8228d636eae218119472321ee6e51854ecba91501909494be2a5e6255f63694ae8912082a65c838
7
+ data.tar.gz: 9cf9b25ae4803cac920bb7cd2692d4094b6891d7b79d5a15e59670a84d55126a296e9affccbea2a2cd4284fdfc5a7514c9e4c5cd42013c347c810da4be08750a
data/README.md CHANGED
@@ -26,13 +26,19 @@ contact info is used in the User-Agent string.
26
26
 
27
27
  You can choose to set this via environment variables:
28
28
 
29
- export XMLSTATS_API_KEY="my api key"
30
- export XMLSTATS_CONTACT_INFO="alex@anticlever.com"
29
+ export XMLSTATS_API_KEY="xxxxx-xxxx-xxxx"
30
+ export XMLSTATS_CONTACT_INFO="you@example.com"
31
31
 
32
32
  Or in Ruby:
33
33
 
34
- Xmlstats.api_key = "my api key"
35
- Xmlstats.contact_info = "alex@anticlever.com"
34
+ Xmlstats.api_key = "xxxxx-xxxx-xxxx"
35
+ Xmlstats.contact_info = "you@example.com"
36
+
37
+ The User-Agent string sent to the server will use your specified contact info
38
+ and look like "xmlstats-ruby/1.3.0 (you@example.com)".
39
+
40
+ Caching
41
+ -------
36
42
 
37
43
  This library supports a couple of different caching mechanisms to prevent
38
44
  constantly hitting the API server.
data/lib/xmlstats.rb CHANGED
@@ -82,7 +82,10 @@ module Xmlstats
82
82
  end
83
83
 
84
84
  def cacher= cacher
85
- @cacher = cacher
85
+ case cacher.class.name
86
+ when "Redis" then @cacher = Xmlstats::Cachers::Redis.new(cacher)
87
+ else @cacher = cacher
88
+ end
86
89
  end
87
90
 
88
91
  # Wrapper methods to each endpoint
@@ -7,10 +7,10 @@ module Xmlstats
7
7
  def initialize(redis = nil)
8
8
  @redis =
9
9
  case redis
10
- when Hash then ::Redis.new(redis)
11
- when Redis then redis
12
- when nil then ::Redis.new
13
- else raise "unknown parameter type to redis cacher: #{redis.inspect}"
10
+ when ::Hash then ::Redis.new(redis)
11
+ when ::Redis then redis
12
+ when nil then ::Redis.new
13
+ else raise "unknown parameter type to redis cacher (#{redis.class}): #{redis.inspect}"
14
14
  end
15
15
  end
16
16
 
@@ -1,3 +1,3 @@
1
1
  module Xmlstats
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xmlstats
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex McHale
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-21 00:00:00.000000000 Z
11
+ date: 2013-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler