punchfork 0.0.4 → 0.0.5

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.
data/README.rdoc CHANGED
@@ -29,6 +29,12 @@ For example:
29
29
 
30
30
  Check out the full set of options at http://punchfork.com/api#apidocs
31
31
 
32
+ Due to a lack of support images being served over https, I have implemented a rewrite method to do this for you in the Recipe object:
33
+ recipe = search.recipes.first
34
+ recipe.thumb # http://img.punchfork.net/f9c6047f7958927a0cff232e0da16853_250x250.jpg
35
+ recipe.secure_thumb # https://s3.amazonaws.com/img.punchfork.net/f9c6047f7958927a0cff232e0da16853_250x250.jpg
36
+ recipe.secure_url(recipe.thumb) # https://s3.amazonaws.com/img.punchfork.net/f9c6047f7958927a0cff232e0da16853_250x250.jpg
37
+
32
38
  = Contact
33
39
 
34
40
  If you have any issues or questions, please open a ticket through github: https://github.com/gabeodess/Punchfork/issues
@@ -15,5 +15,15 @@ module Punchfork
15
15
 
16
16
  attr_reader :attributes
17
17
 
18
+ def secure_thumb
19
+ return secure_url(thumb)
20
+ end
21
+
22
+ def secure_url(url)
23
+ return url if url.match(/^https/)
24
+ uri = URI.parse(url).tap{ |uri| uri.scheme = 'https'; uri.path = File.join('/', uri.host, uri.path); uri.host = 's3.amazonaws.com' }
25
+ return uri.to_s
26
+ end
27
+
18
28
  end
19
29
  end
@@ -13,7 +13,7 @@ module Punchfork
13
13
  @attributes[k] = v
14
14
  end
15
15
 
16
- @recipes = @recipes.map{ |recipe_hash| Recipe.new(recipe_hash) }
16
+ @recipes = @recipes.map{ |recipe_hash| recipe = Recipe.new(recipe_hash) }
17
17
  end
18
18
 
19
19
  attr_reader :attributes
@@ -1,3 +1,3 @@
1
1
  module Punchfork
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -237,3 +237,31 @@
237
237
   (0.0ms) rollback transaction
238
238
   (0.0ms) begin transaction
239
239
   (0.0ms) rollback transaction
240
+  (0.3ms) begin transaction
241
+  (0.1ms) rollback transaction
242
+  (0.1ms) begin transaction
243
+  (0.2ms) rollback transaction
244
+  (0.1ms) begin transaction
245
+  (0.1ms) rollback transaction
246
+  (0.1ms) begin transaction
247
+  (0.1ms) rollback transaction
248
+  (0.1ms) begin transaction
249
+  (0.1ms) rollback transaction
250
+  (0.0ms) begin transaction
251
+  (0.1ms) rollback transaction
252
+  (0.1ms) begin transaction
253
+  (0.0ms) rollback transaction
254
+  (0.4ms) begin transaction
255
+  (0.1ms) rollback transaction
256
+  (0.0ms) begin transaction
257
+  (0.1ms) rollback transaction
258
+  (0.1ms) begin transaction
259
+  (0.0ms) rollback transaction
260
+  (0.0ms) begin transaction
261
+  (0.1ms) rollback transaction
262
+  (0.0ms) begin transaction
263
+  (0.0ms) rollback transaction
264
+  (0.0ms) begin transaction
265
+  (0.0ms) rollback transaction
266
+  (0.0ms) begin transaction
267
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: punchfork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -93,7 +93,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  segments:
95
95
  - 0
96
- hash: 1201131303701118635
96
+ hash: -3245644608910550908
97
97
  required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  none: false
99
99
  requirements:
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: 1201131303701118635
105
+ hash: -3245644608910550908
106
106
  requirements: []
107
107
  rubyforge_project:
108
108
  rubygems_version: 1.8.23