picasa 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'http://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
@@ -4,13 +4,13 @@ require "picasa/version"
4
4
 
5
5
  module Picasa
6
6
  def self.albums(options = {})
7
- web_albums = Picasa::WebAlbums.new(options[:google_user])
8
- web_albums.albums
7
+ web_albums = Picasa::WebAlbums.new(options.delete(:google_user))
8
+ web_albums.albums(options)
9
9
  end
10
10
 
11
11
  def self.photos(options = {})
12
12
  raise ArgumentError.new("You must specify album_id") unless options[:album_id]
13
- web_albums = Picasa::WebAlbums.new(options[:google_user])
14
- web_albums.photos(options[:album_id])
13
+ web_albums = Picasa::WebAlbums.new(options.delete(:google_user))
14
+ web_albums.photos(options.delete(:album_id), options)
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Picasa
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -8,8 +8,8 @@ module Picasa
8
8
  raise ArgumentError.new("You must specify google_user") unless Picasa.config.google_user
9
9
  end
10
10
 
11
- def albums
12
- data = connect("/data/feed/api/user/#{Picasa.config.google_user}")
11
+ def albums(options = {})
12
+ data = connect("/data/feed/api/user/#{Picasa.config.google_user}", options)
13
13
  xml = XmlSimple.xml_in(data)
14
14
  albums = []
15
15
  xml["entry"].each do |album|
@@ -26,8 +26,8 @@ module Picasa
26
26
  albums
27
27
  end
28
28
 
29
- def photos(album_id)
30
- data = connect("/data/feed/api/user/#{Picasa.config.google_user}/albumid/#{album_id}")
29
+ def photos(album_id, options = {})
30
+ data = connect("/data/feed/api/user/#{Picasa.config.google_user}/albumid/#{album_id}", options)
31
31
  xml = XmlSimple.xml_in(data)
32
32
  photos = []
33
33
  xml["entry"].each do |photo|
@@ -40,13 +40,14 @@ module Picasa
40
40
  attributes[:photo] = photo["content"]["src"]
41
41
  photos << attributes
42
42
  end if xml["entry"]
43
- { :photos => photos, :slideshow => xml["link"][1]["href"] + "#slideshow" }
43
+ {:photos => photos, :slideshow => xml["link"][1]["href"] + "#slideshow"}
44
44
  end
45
45
 
46
46
  private
47
47
 
48
- def connect(url)
48
+ def connect(url, options = {})
49
49
  full_url = "http://picasaweb.google.com" + url
50
+ full_url += "?" + URI.encode_www_form(options) unless options.empty?
50
51
  Net::HTTP.get(URI.parse(full_url))
51
52
  end
52
53
  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.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-02 00:00:00.000000000 Z
12
+ date: 2012-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xml-simple
16
- requirement: &82975310 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *82975310
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: fakeweb
27
- requirement: &82975100 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -32,7 +37,12 @@ dependencies:
32
37
  version: '0'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *82975100
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
36
46
  description: Simple Google Picasa managment
37
47
  email:
38
48
  - w.wnetrzak@gmail.com
@@ -95,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
105
  version: '0'
96
106
  requirements: []
97
107
  rubyforge_project:
98
- rubygems_version: 1.8.15
108
+ rubygems_version: 1.8.23
99
109
  signing_key:
100
110
  specification_version: 3
101
111
  summary: simple google picasa managment