nbibler-page_glimpse 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/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,8 @@
1
- Current Development
1
+ 0.0.5 - June 7, 2009
2
+
3
+ * Removed exist? check for get to work around apparent but in PageGlimpse service not successfully queueing an image until after at least one get request for it.
4
+
5
+ 0.0.4 - June 4, 2009
2
6
 
3
7
  * Fixed PageGlimpse.developer_key throwing NameError when undefined.
4
8
 
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 4
2
+ :patch: 5
3
3
  :major: 0
4
4
  :minor: 0
data/lib/page_glimpse.rb CHANGED
@@ -2,6 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__)) ||
2
2
 
3
3
  gem 'relax' #, '~>0.1.0'
4
4
  require 'relax'
5
+ require 'cgi'
5
6
 
6
7
  require 'page_glimpse/api'
7
8
 
@@ -18,7 +19,7 @@ module PageGlimpse
18
19
  # Returns +true+ if the thumbnail exists on Page Glimpse, +false+ otherwise.
19
20
  #
20
21
  def self.exist?(url, options = {})
21
- options[:url] = url
22
+ options[:url] = CGI.escape(url)
22
23
  response = api.exist?(options)
23
24
  response.kind_of?(Array) && response.size == 2 && response[1] == API::THUMBNAIL_EXISTS
24
25
  rescue RestClient::ResourceNotFound
@@ -52,8 +53,8 @@ module PageGlimpse
52
53
  # Default value is "<tt>yes</tt>".
53
54
  #
54
55
  def self.get(url, options = {})
55
- options[:url] = url
56
- exist?(url, options) ? api.thumbnail(options) : nil
56
+ options[:url] = CGI.escape(url)
57
+ api.thumbnail(options)
57
58
  rescue RestClient::RequestFailed
58
59
  handle_failure($!)
59
60
  end
@@ -62,7 +63,7 @@ module PageGlimpse
62
63
  # Instructs Page Glimpse to enqueue the thumbnailing of a specific URL.
63
64
  #
64
65
  def self.queue(url)
65
- response = api.queue(:url => url)
66
+ response = api.queue(:url => CGI.escape(url))
66
67
  response.kind_of?(Array) && response.size == 2 && response[1] == API::QUEUE_SUCCESS
67
68
  rescue RestClient::RequestFailed
68
69
  handle_failure($!)
data/page_glimpse.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{page_glimpse}
5
- s.version = "0.0.4"
5
+ s.version = "0.0.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Nathaniel Bibler"]
9
- s.date = %q{2009-06-04}
9
+ s.date = %q{2009-06-07}
10
10
  s.email = %q{gem@nathanielbibler.com}
11
11
  s.extra_rdoc_files = [
12
12
  "LICENSE",
@@ -48,8 +48,8 @@ class PageGlimpseTest < Test::Unit::TestCase
48
48
 
49
49
  context 'with no thumbnail available' do
50
50
 
51
- should 'return nil' do
52
- assert_nil PageGlimpse.get('http://badurl.local/', :size => 'large')
51
+ should 'return an Image' do
52
+ assert_kind_of PageGlimpse::Image, PageGlimpse.get('http://badurl.local/', :size => 'large')
53
53
  end
54
54
 
55
55
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nbibler-page_glimpse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Bibler
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-04 00:00:00 -07:00
12
+ date: 2009-06-07 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency