picasa 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -18,3 +18,4 @@ spec/reports
18
18
  test/tmp
19
19
  test/version_tmp
20
20
  tmp
21
+ .DS_Store
@@ -1,3 +1,5 @@
1
+ language: ruby
2
+ bundler_args: --without extra
1
3
  notifications:
2
4
  disabled: true
3
5
  rvm:
data/Gemfile CHANGED
@@ -2,10 +2,14 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem "thor"
5
+ gem "vcr", github: "myronmarston/vcr"
6
6
  gem "rake"
7
7
  gem "minitest", "3.5.0", :platform => :ruby_18
8
- gem "debugger", :platform => :ruby_19
8
+
9
+ group :extra do
10
+ gem "thor"
11
+ gem "debugger", :platform => :ruby_19 if RUBY_VERSION < "2.0"
12
+ end
9
13
 
10
14
  # JSON parsers
11
15
  gem "oj"
data/README.md CHANGED
@@ -94,6 +94,7 @@ Picasa uses gzipped requests to speedup fetching results. Benchmarks are availab
94
94
  * [Eiichi Takebuchi](https://github.com/GRGSIBERIA)
95
95
  * [TADA Tadashi](https://github.com/tdtds)
96
96
  * [Vinicius Teles](https://github.com/viniciusteles)
97
+ * [Ionut-Cristian Florescu](https://github.com/icflorescu)
97
98
 
98
99
  ## Copyright
99
100
 
@@ -20,7 +20,7 @@ module Picasa
20
20
 
21
21
  # @return [String]
22
22
  def id
23
- @id ||= safe_retrieve(parsed_body, "gphoto$id").last
23
+ @id ||= safe_retrieve(parsed_body, "gphoto$id")
24
24
  end
25
25
 
26
26
  # @return [String]
@@ -1,3 +1,3 @@
1
1
  module Picasa
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
@@ -18,6 +18,6 @@ Gem::Specification.new do |gem|
18
18
  gem.add_dependency "httparty"
19
19
 
20
20
  gem.add_development_dependency "webmock"
21
- gem.add_development_dependency "mocha"
21
+ gem.add_development_dependency "mocha", ">= 0.13.0"
22
22
  gem.add_development_dependency "vcr"
23
23
  end
@@ -154,6 +154,92 @@ describe Picasa::API::Album do
154
154
  it "has allow_downloads" do
155
155
  assert_equal true, @album.allow_downloads
156
156
  end
157
+
158
+ describe "photo" do
159
+ before do
160
+ @photo = @album.entries.first
161
+ end
162
+
163
+ it "has id" do
164
+ assert_equal "5239556203823850002", @photo.id
165
+ end
166
+
167
+ it "has links" do
168
+ assert_equal 5, @photo.links.size
169
+ end
170
+
171
+ it "has media" do
172
+ assert_equal 3, @photo.media.thumbnails.size
173
+ end
174
+
175
+ it "has content type" do
176
+ assert_equal "image/jpeg", @photo.content.type
177
+ end
178
+
179
+ it "has etag" do
180
+ assert_equal "\"YD4qeyI.\"", @photo.etag
181
+ end
182
+
183
+ it "has published" do
184
+ assert_equal "2008-08-28T13:14:03+00:00", @photo.published.to_s
185
+ end
186
+
187
+ it "has updated" do
188
+ assert_equal "2009-06-24T05:19:50+00:00", @photo.updated.to_s
189
+ end
190
+
191
+ it "has title" do
192
+ assert_equal "lena2.jpg", @photo.title
193
+ end
194
+
195
+ it "has summary" do
196
+ assert_equal "", @photo.summary
197
+ end
198
+
199
+ it "has album id" do
200
+ assert_equal "5239555770355467953", @photo.album_id
201
+ end
202
+
203
+ it "has access" do
204
+ assert_equal "public", @photo.access
205
+ end
206
+
207
+ it "has width" do
208
+ assert_equal 1084, @photo.width
209
+ end
210
+
211
+ it "has height" do
212
+ assert_equal 2318, @photo.height
213
+ end
214
+
215
+ it "has size" do
216
+ assert_equal 570958, @photo.size
217
+ end
218
+
219
+ it "has checksum" do
220
+ assert_equal "", @photo.checksum
221
+ end
222
+
223
+ it "has timestamp" do
224
+ assert_equal "1219929243000", @photo.timestamp
225
+ end
226
+
227
+ it "has image version" do
228
+ assert_equal 67, @photo.image_version
229
+ end
230
+
231
+ it "has commenting enabled" do
232
+ assert_equal true, @photo.commenting_enabled
233
+ end
234
+
235
+ it "has comment count" do
236
+ assert_equal 0, @photo.comment_count
237
+ end
238
+
239
+ it "has license" do
240
+ assert_equal "All Rights Reserved", @photo.license
241
+ end
242
+ end
157
243
  end
158
244
 
159
245
  describe "exceptions" do
@@ -4,7 +4,7 @@ require "zlib"
4
4
  require "minitest/autorun"
5
5
  require "webmock/minitest"
6
6
  require "vcr"
7
- require "mocha"
7
+ require "mocha/setup"
8
8
 
9
9
  require "picasa"
10
10
 
@@ -16,7 +16,7 @@ MultiJson.adapter = ENV["JSON_PARSER"] || "oj"
16
16
  VCR.configure do |c|
17
17
  c.cassette_library_dir = "test/cassettes"
18
18
  c.hook_into :webmock
19
- c.default_cassette_options = {:serialize_with => :syck, :preserve_exact_body_bytes => true} # Avoid stroing headers as binary
19
+ c.default_cassette_options = {:preserve_exact_body_bytes => true} # Avoid stroing headers as binary
20
20
  c.filter_sensitive_data("<FILTERED>") { AuthHeader }
21
21
  c.filter_sensitive_data("<FILTERED>") { Password }
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picasa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-06 00:00:00.000000000 Z
12
+ date: 2012-11-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ! '>='
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: 0.13.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.13.0
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: vcr
64
64
  requirement: !ruby/object:Gem::Requirement