myflickr 0.1.0 → 0.1.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.
@@ -6,6 +6,7 @@ Rakefile
6
6
  config/hoe.rb
7
7
  config/requirements.rb
8
8
  lib/myflickr.rb
9
+ lib/myflickr/cache.rb
9
10
  lib/myflickr/machine_tag.rb
10
11
  lib/myflickr/photo.rb
11
12
  lib/myflickr/query.rb
@@ -21,4 +22,4 @@ spec/query_spec.rb
21
22
  spec/set_spec.rb
22
23
  spec/size_spec.rb
23
24
  spec/spec_helper.rb
24
- spec/tag_spec.rb
25
+ spec/tag_spec.rb
@@ -0,0 +1,35 @@
1
+ # All memcached references have been stolen straight
2
+ # from the implementation in the `rubyweather` gem.
3
+ # It just seemed too simple to roll in.
4
+
5
+ module Myflickr
6
+ class Query
7
+ module Cache
8
+ attr_writer :cache_validity
9
+ def cache
10
+ @memcache ||= MemCache.new :namespace => "Myflickr"
11
+ end
12
+
13
+ def cache_validity
14
+ # Default of 10 minutes
15
+ @cache_validity || 60 * 10
16
+ end
17
+
18
+ private
19
+ def self.extend_object(o)
20
+ begin
21
+ require 'memcache'
22
+ rescue LoadError
23
+ require 'rubygems'
24
+ begin
25
+ gem 'memcache-client', '~> 1.2.1'
26
+ rescue Gem::LoadError
27
+ gem 'Ruby-MemCache'
28
+ end
29
+ require 'memcache'
30
+ end
31
+ super
32
+ end
33
+ end
34
+ end
35
+ end
@@ -2,7 +2,7 @@ module Myflickr
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: myflickr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Schwarz
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-01-06 00:00:00 +11:00
12
+ date: 2008-01-07 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -41,6 +41,7 @@ files:
41
41
  - config/hoe.rb
42
42
  - config/requirements.rb
43
43
  - lib/myflickr.rb
44
+ - lib/myflickr/cache.rb
44
45
  - lib/myflickr/machine_tag.rb
45
46
  - lib/myflickr/photo.rb
46
47
  - lib/myflickr/query.rb