flickr_fu 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +17 -0
- data/Gemfile.lock +41 -0
- data/Rakefile +51 -52
- data/VERSION.yml +3 -2
- data/flickr_fu.gemspec +120 -89
- data/lib/flickr/photoset.rb +11 -7
- data/lib/flickr/photosets.rb +17 -8
- data/spec/flickr/photo_spec.rb +2 -0
- data/spec/flickr/urls_spec.rb +2 -0
- data/spec/spec_helper.rb +1 -3
- metadata +191 -58
- data/.gitignore +0 -13
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
# Add dependencies to develop your gem here.
|
9
|
+
# Include everything needed to run rake, tests, features, etc.
|
10
|
+
group :development do
|
11
|
+
# gem "shoulda", ">= 0"
|
12
|
+
gem "bundler", "~> 1"
|
13
|
+
gem "jeweler", "~> 1.6.4"
|
14
|
+
gem "rspec"
|
15
|
+
gem "rdoc"
|
16
|
+
# gem "rcov", ">= 0"
|
17
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
flickr_fu (0.3.1)
|
5
|
+
flickr_fu
|
6
|
+
mime-types (> 0.0.0)
|
7
|
+
xml-magic (> 0.0.0)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: http://rubygems.org/
|
11
|
+
specs:
|
12
|
+
diff-lcs (1.1.3)
|
13
|
+
git (1.2.5)
|
14
|
+
jeweler (1.6.4)
|
15
|
+
bundler (~> 1.0)
|
16
|
+
git (>= 1.2.5)
|
17
|
+
rake
|
18
|
+
json (1.6.5)
|
19
|
+
mime-types (1.17.2)
|
20
|
+
rake (0.9.2.2)
|
21
|
+
rdoc (3.12)
|
22
|
+
json (~> 1.4)
|
23
|
+
rspec (2.8.0)
|
24
|
+
rspec-core (~> 2.8.0)
|
25
|
+
rspec-expectations (~> 2.8.0)
|
26
|
+
rspec-mocks (~> 2.8.0)
|
27
|
+
rspec-core (2.8.0)
|
28
|
+
rspec-expectations (2.8.0)
|
29
|
+
diff-lcs (~> 1.1.2)
|
30
|
+
rspec-mocks (2.8.0)
|
31
|
+
xml-magic (0.1.1)
|
32
|
+
|
33
|
+
PLATFORMS
|
34
|
+
ruby
|
35
|
+
|
36
|
+
DEPENDENCIES
|
37
|
+
bundler (~> 1)
|
38
|
+
flickr_fu!
|
39
|
+
jeweler (~> 1.6.4)
|
40
|
+
rdoc
|
41
|
+
rspec
|
data/Rakefile
CHANGED
@@ -1,33 +1,36 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
1
12
|
require 'rake'
|
2
|
-
require 'rake/rdoctask'
|
3
13
|
|
4
14
|
# Gem building
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
s.authors = ["Ben Wyrosdick", "Maciej Bilas"]
|
19
|
-
s.rdoc_options = ["--main", "README"]
|
20
|
-
s.extra_rdoc_files = ["README"]
|
21
|
-
s.add_dependency("mime-types", ["> 0.0.0"])
|
22
|
-
s.add_dependency("xml-magic", ["> 0.0.0"])
|
23
|
-
s.files.exclude("spec/spec.local.opts")
|
24
|
-
end
|
25
|
-
rescue LoadError
|
26
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
15
|
+
require 'jeweler'
|
16
|
+
Jeweler::Tasks.new do |s|
|
17
|
+
s.name = "flickr_fu"
|
18
|
+
s.summary = "Provides a ruby interface to flickr via the REST api"
|
19
|
+
s.email = "ben@commonthread.com"
|
20
|
+
s.homepage = "http://github.com/commonthread/flickr_fu"
|
21
|
+
s.description = "Provides a ruby interface to flickr via the REST api"
|
22
|
+
s.authors = ["Ben Wyrosdick", "Maciej Bilas"]
|
23
|
+
s.rdoc_options = ["--main", "README"]
|
24
|
+
s.extra_rdoc_files = ["README"]
|
25
|
+
s.add_dependency("mime-types", ["> 0.0.0"])
|
26
|
+
s.add_dependency("xml-magic", ["> 0.0.0"])
|
27
|
+
s.files.exclude("spec/spec.local.opts")
|
27
28
|
end
|
29
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
30
|
|
31
|
+
require 'rdoc/task'
|
29
32
|
desc 'Generate documentation for flickr_fu.'
|
30
|
-
|
33
|
+
RDoc::Task.new do |rdoc|
|
31
34
|
rdoc.rdoc_dir = 'rdoc'
|
32
35
|
rdoc.title = 'flickr_fu'
|
33
36
|
rdoc.options << '--line-numbers' << '--inline-source'
|
@@ -36,38 +39,34 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
36
39
|
end
|
37
40
|
|
38
41
|
# RSpec support
|
39
|
-
|
40
|
-
|
41
|
-
rescue LoadError
|
42
|
-
require 'rubygems'
|
43
|
-
require 'spec'
|
44
|
-
end
|
45
|
-
begin
|
46
|
-
require 'spec/rake/spectask'
|
47
|
-
rescue LoadError
|
48
|
-
puts <<-EOS
|
49
|
-
To use rspec for testing you must install rspec gem:
|
50
|
-
gem install rspec
|
51
|
-
EOS
|
52
|
-
exit(0)
|
53
|
-
end
|
42
|
+
require 'rspec/core'
|
43
|
+
require 'rspec/core/rake_task'
|
54
44
|
|
55
45
|
task :default => :spec
|
56
46
|
|
57
|
-
spec_common = Proc.new do |t|
|
58
|
-
t.spec_opts = ['--options', "spec/spec.opts"]
|
59
|
-
t.spec_opts << ['--options', "spec/spec.local.opts" ] if File.exist?(File.dirname(__FILE__) + "/spec/spec.local.opts")
|
60
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
61
|
-
end
|
47
|
+
#spec_common = Proc.new do |t|
|
48
|
+
# t.spec_opts = ['--options', "spec/spec.opts"]
|
49
|
+
# t.spec_opts << ['--options', "spec/spec.local.opts" ] if File.exist?(File.dirname(__FILE__) + "/spec/spec.local.opts")
|
50
|
+
# t.spec_files = FileList['spec/**/*_spec.rb']
|
51
|
+
#end
|
62
52
|
|
63
|
-
|
64
|
-
|
65
|
-
spec_common.call(t)
|
53
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
54
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
66
55
|
end
|
67
56
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
t.rcov = true
|
72
|
-
t.rcov_opts = ["-x", "/var/lib", "-x", "spec/", "-T"]
|
57
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
58
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
59
|
+
spec.rcov = true
|
73
60
|
end
|
61
|
+
|
62
|
+
#desc "Run the specs under spec/models"
|
63
|
+
#Spec::Rake::SpecTask.new do |t|
|
64
|
+
# spec_common.call(t)
|
65
|
+
#end
|
66
|
+
|
67
|
+
#desc "Analyze code coverage with tests"
|
68
|
+
#Spec::Rake::SpecTask.new("rcov") do |t|
|
69
|
+
# spec_common.call(t)
|
70
|
+
# t.rcov = true
|
71
|
+
# t.rcov_opts = ["-x", "/var/lib", "-x", "spec/", "-T"]
|
72
|
+
#end
|
data/VERSION.yml
CHANGED
data/flickr_fu.gemspec
CHANGED
@@ -1,117 +1,148 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
1
4
|
# -*- encoding: utf-8 -*-
|
2
5
|
|
3
6
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "0.3.
|
7
|
+
s.name = "flickr_fu"
|
8
|
+
s.version = "0.3.1"
|
6
9
|
|
7
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
11
|
s.authors = ["Ben Wyrosdick", "Maciej Bilas"]
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
s.email =
|
12
|
+
s.date = "2012-01-17"
|
13
|
+
s.description = "Provides a ruby interface to flickr via the REST api"
|
14
|
+
s.email = "ben@commonthread.com"
|
12
15
|
s.extra_rdoc_files = [
|
13
16
|
"README"
|
14
17
|
]
|
15
18
|
s.files = [
|
16
|
-
"
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
19
|
+
"Gemfile",
|
20
|
+
"Gemfile.lock",
|
21
|
+
"LICENSE",
|
22
|
+
"README",
|
23
|
+
"Rakefile",
|
24
|
+
"VERSION.yml",
|
25
|
+
"flickr_fu.gemspec",
|
26
|
+
"lib/flickr/auth.rb",
|
27
|
+
"lib/flickr/base.rb",
|
28
|
+
"lib/flickr/comment.rb",
|
29
|
+
"lib/flickr/contact.rb",
|
30
|
+
"lib/flickr/contacts.rb",
|
31
|
+
"lib/flickr/errors.rb",
|
32
|
+
"lib/flickr/geo.rb",
|
33
|
+
"lib/flickr/license.rb",
|
34
|
+
"lib/flickr/location.rb",
|
35
|
+
"lib/flickr/note.rb",
|
36
|
+
"lib/flickr/people.rb",
|
37
|
+
"lib/flickr/person.rb",
|
38
|
+
"lib/flickr/photo.rb",
|
39
|
+
"lib/flickr/photo_response.rb",
|
40
|
+
"lib/flickr/photos.rb",
|
41
|
+
"lib/flickr/photoset.rb",
|
42
|
+
"lib/flickr/photosets.rb",
|
43
|
+
"lib/flickr/size.rb",
|
44
|
+
"lib/flickr/status.rb",
|
45
|
+
"lib/flickr/test.rb",
|
46
|
+
"lib/flickr/token.rb",
|
47
|
+
"lib/flickr/uploader.rb",
|
48
|
+
"lib/flickr/urls.rb",
|
49
|
+
"lib/flickr_fu.rb",
|
50
|
+
"spec/fixtures/flickr/contacts/get_list-fail-99.xml",
|
51
|
+
"spec/fixtures/flickr/contacts/get_public_list-0.xml",
|
52
|
+
"spec/fixtures/flickr/photos/geo/get_location-0.xml",
|
53
|
+
"spec/fixtures/flickr/photos/geo/get_location-fail-2.xml",
|
54
|
+
"spec/fixtures/flickr/photos/get_info-0.xml",
|
55
|
+
"spec/fixtures/flickr/photos/get_info-1.xml",
|
56
|
+
"spec/fixtures/flickr/photos/get_sizes-0.xml",
|
57
|
+
"spec/fixtures/flickr/photos/get_sizes-1.xml",
|
58
|
+
"spec/fixtures/flickr/photos/licenses/get_info.xml",
|
59
|
+
"spec/fixtures/flickr/photosets/get_list-0.xml",
|
60
|
+
"spec/fixtures/flickr/photosets/get_photos-0.xml",
|
61
|
+
"spec/fixtures/flickr/test/echo-0.xml",
|
62
|
+
"spec/fixtures/flickr/test/null-fail-99.xml",
|
63
|
+
"spec/fixtures/flickr/urls/get_group-0.xml",
|
64
|
+
"spec/fixtures/flickr/urls/get_group-fail-1.xml",
|
65
|
+
"spec/fixtures/flickr/urls/get_user_photos-0.xml",
|
66
|
+
"spec/fixtures/flickr/urls/get_user_photos-fail-1.xml",
|
67
|
+
"spec/fixtures/flickr/urls/get_user_photos-fail-2.xml",
|
68
|
+
"spec/fixtures/flickr/urls/get_user_profile-0.xml",
|
69
|
+
"spec/fixtures/flickr/urls/get_user_profile-fail-1.xml",
|
70
|
+
"spec/fixtures/flickr/urls/get_user_profile-fail-2.xml",
|
71
|
+
"spec/fixtures/flickr/urls/lookup_group-0.xml",
|
72
|
+
"spec/fixtures/flickr/urls/lookup_group-fail-1.xml",
|
73
|
+
"spec/fixtures/flickr/urls/lookup_user-0.xml",
|
74
|
+
"spec/fixtures/flickr/videos/get_info-0.xml",
|
75
|
+
"spec/fixtures/flickr/videos/get_sizes-0.xml",
|
76
|
+
"spec/flickr/base_spec.rb",
|
77
|
+
"spec/flickr/contacts_spec.rb",
|
78
|
+
"spec/flickr/errors_spec.rb",
|
79
|
+
"spec/flickr/geo_spec.rb",
|
80
|
+
"spec/flickr/photo_spec.rb",
|
81
|
+
"spec/flickr/photos_spec.rb",
|
82
|
+
"spec/flickr/photosets_spec.rb",
|
83
|
+
"spec/flickr/test_spec.rb",
|
84
|
+
"spec/flickr/urls_spec.rb",
|
85
|
+
"spec/spec.opts",
|
86
|
+
"spec/spec_helper.rb"
|
83
87
|
]
|
84
|
-
s.homepage =
|
88
|
+
s.homepage = "http://github.com/commonthread/flickr_fu"
|
85
89
|
s.rdoc_options = ["--main", "README"]
|
86
90
|
s.require_paths = ["lib"]
|
87
|
-
s.rubygems_version =
|
88
|
-
s.summary =
|
89
|
-
s.test_files = [
|
90
|
-
"spec/spec_helper.rb",
|
91
|
-
"spec/flickr/test_spec.rb",
|
92
|
-
"spec/flickr/geo_spec.rb",
|
93
|
-
"spec/flickr/contacts_spec.rb",
|
94
|
-
"spec/flickr/urls_spec.rb",
|
95
|
-
"spec/flickr/errors_spec.rb",
|
96
|
-
"spec/flickr/base_spec.rb",
|
97
|
-
"spec/flickr/photo_spec.rb",
|
98
|
-
"spec/flickr/photosets_spec.rb",
|
99
|
-
"spec/flickr/photos_spec.rb"
|
100
|
-
]
|
91
|
+
s.rubygems_version = "1.8.10"
|
92
|
+
s.summary = "Provides a ruby interface to flickr via the REST api"
|
101
93
|
|
102
94
|
if s.respond_to? :specification_version then
|
103
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
104
95
|
s.specification_version = 3
|
105
96
|
|
106
|
-
if Gem::Version.new(Gem::
|
97
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
98
|
+
s.add_runtime_dependency(%q<flickr_fu>, [">= 0"])
|
99
|
+
s.add_development_dependency(%q<bundler>, ["~> 1"])
|
100
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
101
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
102
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
103
|
+
s.add_development_dependency(%q<bundler>, ["~> 1"])
|
104
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
105
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
106
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
107
|
+
s.add_development_dependency(%q<bundler>, ["~> 1"])
|
108
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
109
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
110
|
+
s.add_development_dependency(%q<rdoc>, [">= 0"])
|
107
111
|
s.add_runtime_dependency(%q<mime-types>, ["> 0.0.0"])
|
108
112
|
s.add_runtime_dependency(%q<xml-magic>, ["> 0.0.0"])
|
109
113
|
else
|
114
|
+
s.add_dependency(%q<flickr_fu>, [">= 0"])
|
115
|
+
s.add_dependency(%q<bundler>, ["~> 1"])
|
116
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
117
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
118
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
119
|
+
s.add_dependency(%q<bundler>, ["~> 1"])
|
120
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
121
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
122
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
123
|
+
s.add_dependency(%q<bundler>, ["~> 1"])
|
124
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
125
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
126
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
110
127
|
s.add_dependency(%q<mime-types>, ["> 0.0.0"])
|
111
128
|
s.add_dependency(%q<xml-magic>, ["> 0.0.0"])
|
112
129
|
end
|
113
130
|
else
|
131
|
+
s.add_dependency(%q<flickr_fu>, [">= 0"])
|
132
|
+
s.add_dependency(%q<bundler>, ["~> 1"])
|
133
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
134
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
135
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
136
|
+
s.add_dependency(%q<bundler>, ["~> 1"])
|
137
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
138
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
139
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
140
|
+
s.add_dependency(%q<bundler>, ["~> 1"])
|
141
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
142
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
143
|
+
s.add_dependency(%q<rdoc>, [">= 0"])
|
114
144
|
s.add_dependency(%q<mime-types>, ["> 0.0.0"])
|
115
145
|
s.add_dependency(%q<xml-magic>, ["> 0.0.0"])
|
116
146
|
end
|
117
147
|
end
|
148
|
+
|
data/lib/flickr/photoset.rb
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
class Flickr::Photosets::Photoset
|
2
|
-
attr_accessor :id,:num_photos,:title,:description
|
3
|
-
|
2
|
+
attr_accessor :id,:num_photos,:title,:description,:primary_photo_id
|
3
|
+
|
4
4
|
def initialize(flickr, attributes)
|
5
5
|
@flickr = flickr
|
6
6
|
attributes.each do |k,v|
|
7
7
|
send("#{k}=", v)
|
8
8
|
end
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
def get_photos(options={})
|
12
12
|
options = options.merge(:photoset_id=>id)
|
13
13
|
rsp = @flickr.send_request('flickr.photosets.getPhotos', options)
|
14
14
|
collect_photos(rsp)
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
|
+
def add_photo(photo_id)
|
18
|
+
rsp = @flickr.send_request('flickr.photosets.addPhoto', {:photo_id=>photo_id, :photoset_id => id})
|
19
|
+
end
|
20
|
+
|
17
21
|
protected
|
18
22
|
def collect_photos(rsp)
|
19
23
|
photos = []
|
@@ -26,11 +30,11 @@ class Flickr::Photosets::Photoset
|
|
26
30
|
end
|
27
31
|
return photos
|
28
32
|
end
|
29
|
-
|
33
|
+
|
30
34
|
def create_attributes(photo)
|
31
35
|
{:id => photo[:id],
|
32
|
-
:secret => photo[:secret],
|
33
|
-
:server => photo[:server],
|
36
|
+
:secret => photo[:secret],
|
37
|
+
:server => photo[:server],
|
34
38
|
:farm => photo[:farm],
|
35
39
|
:title => photo[:title]}
|
36
40
|
end
|
data/lib/flickr/photosets.rb
CHANGED
@@ -2,15 +2,24 @@ class Flickr::Photosets < Flickr::Base
|
|
2
2
|
def initialize(flickr)
|
3
3
|
@flickr = flickr
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
# Get the authorized user's contact list.
|
7
|
-
#
|
7
|
+
#
|
8
8
|
def get_list(options={})
|
9
9
|
rsp = @flickr.send_request('flickr.photosets.getList', options)
|
10
10
|
collect_photosets(rsp)
|
11
11
|
end
|
12
|
-
|
13
|
-
|
12
|
+
|
13
|
+
#required:
|
14
|
+
# title
|
15
|
+
# primary_photo_id
|
16
|
+
#
|
17
|
+
def create(title, primary_photo_id, options={})
|
18
|
+
options.merge!({:title => title, :primary_photo_id => primary_photo_id})
|
19
|
+
@flickr.send_request('flickr.photosets.create', options)
|
20
|
+
end
|
21
|
+
|
22
|
+
protected
|
14
23
|
def collect_photosets(rsp)
|
15
24
|
photosets = []
|
16
25
|
return photosets unless rsp
|
@@ -22,18 +31,18 @@ class Flickr::Photosets < Flickr::Base
|
|
22
31
|
end
|
23
32
|
return photosets
|
24
33
|
end
|
25
|
-
|
34
|
+
|
26
35
|
def create_attributes(photoset)
|
27
36
|
# comment by : smeevil
|
28
37
|
#
|
29
38
|
# for some reason it was needed to call to_s on photoset.title and photoset.description
|
30
39
|
# without this it will not set the value correctly
|
31
40
|
{
|
32
|
-
:id => photoset[:id],
|
41
|
+
:id => photoset[:id],
|
33
42
|
:num_photos => photoset[:photos],
|
34
43
|
:title => photoset.title.to_s,
|
35
44
|
:description => photoset.description.to_s
|
36
45
|
}
|
37
46
|
end
|
38
|
-
|
39
|
-
end
|
47
|
+
|
48
|
+
end
|
data/spec/flickr/photo_spec.rb
CHANGED
data/spec/flickr/urls_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,48 +1,191 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickr_fu
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.1
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- Ben Wyrosdick
|
8
9
|
- Maciej Bilas
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
date: 2012-01-17 00:00:00.000000000Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: flickr_fu
|
17
|
+
requirement: &70279932931440 !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
18
23
|
type: :runtime
|
19
|
-
|
20
|
-
version_requirements:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: *70279932931440
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: bundler
|
28
|
+
requirement: &70279932930860 !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: *70279932930860
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: jeweler
|
39
|
+
requirement: &70279932930220 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 1.6.4
|
45
|
+
type: :development
|
46
|
+
prerelease: false
|
47
|
+
version_requirements: *70279932930220
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rspec
|
50
|
+
requirement: &70279932929620 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *70279932929620
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: rdoc
|
61
|
+
requirement: &70279932928900 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *70279932928900
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: bundler
|
72
|
+
requirement: &70279932928320 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *70279932928320
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: jeweler
|
83
|
+
requirement: &70279932920780 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.6.4
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: *70279932920780
|
92
|
+
- !ruby/object:Gem::Dependency
|
93
|
+
name: rspec
|
94
|
+
requirement: &70279932920060 !ruby/object:Gem::Requirement
|
95
|
+
none: false
|
96
|
+
requirements:
|
97
|
+
- - ! '>='
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
type: :development
|
101
|
+
prerelease: false
|
102
|
+
version_requirements: *70279932920060
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: rdoc
|
105
|
+
requirement: &70279932919340 !ruby/object:Gem::Requirement
|
106
|
+
none: false
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: *70279932919340
|
114
|
+
- !ruby/object:Gem::Dependency
|
115
|
+
name: bundler
|
116
|
+
requirement: &70279932918740 !ruby/object:Gem::Requirement
|
117
|
+
none: false
|
118
|
+
requirements:
|
119
|
+
- - ~>
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '1'
|
122
|
+
type: :development
|
123
|
+
prerelease: false
|
124
|
+
version_requirements: *70279932918740
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: jeweler
|
127
|
+
requirement: &70279932918040 !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ~>
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 1.6.4
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: *70279932918040
|
136
|
+
- !ruby/object:Gem::Dependency
|
137
|
+
name: rspec
|
138
|
+
requirement: &70279932917400 !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ! '>='
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: *70279932917400
|
147
|
+
- !ruby/object:Gem::Dependency
|
148
|
+
name: rdoc
|
149
|
+
requirement: &70279932916880 !ruby/object:Gem::Requirement
|
150
|
+
none: false
|
151
|
+
requirements:
|
152
|
+
- - ! '>='
|
153
|
+
- !ruby/object:Gem::Version
|
154
|
+
version: '0'
|
155
|
+
type: :development
|
156
|
+
prerelease: false
|
157
|
+
version_requirements: *70279932916880
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: mime-types
|
160
|
+
requirement: &70279932916180 !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ! '>'
|
164
|
+
- !ruby/object:Gem::Version
|
24
165
|
version: 0.0.0
|
25
|
-
version:
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: xml-magic
|
28
166
|
type: :runtime
|
29
|
-
|
30
|
-
version_requirements:
|
31
|
-
|
32
|
-
|
33
|
-
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: *70279932916180
|
169
|
+
- !ruby/object:Gem::Dependency
|
170
|
+
name: xml-magic
|
171
|
+
requirement: &70279932915480 !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
173
|
+
requirements:
|
174
|
+
- - ! '>'
|
175
|
+
- !ruby/object:Gem::Version
|
34
176
|
version: 0.0.0
|
35
|
-
|
177
|
+
type: :runtime
|
178
|
+
prerelease: false
|
179
|
+
version_requirements: *70279932915480
|
36
180
|
description: Provides a ruby interface to flickr via the REST api
|
37
181
|
email: ben@commonthread.com
|
38
182
|
executables: []
|
39
|
-
|
40
183
|
extensions: []
|
41
|
-
|
42
|
-
extra_rdoc_files:
|
184
|
+
extra_rdoc_files:
|
43
185
|
- README
|
44
|
-
files:
|
45
|
-
-
|
186
|
+
files:
|
187
|
+
- Gemfile
|
188
|
+
- Gemfile.lock
|
46
189
|
- LICENSE
|
47
190
|
- README
|
48
191
|
- Rakefile
|
@@ -109,43 +252,33 @@ files:
|
|
109
252
|
- spec/flickr/urls_spec.rb
|
110
253
|
- spec/spec.opts
|
111
254
|
- spec/spec_helper.rb
|
112
|
-
has_rdoc: true
|
113
255
|
homepage: http://github.com/commonthread/flickr_fu
|
114
256
|
licenses: []
|
115
|
-
|
116
257
|
post_install_message:
|
117
|
-
rdoc_options:
|
258
|
+
rdoc_options:
|
118
259
|
- --main
|
119
260
|
- README
|
120
|
-
require_paths:
|
261
|
+
require_paths:
|
121
262
|
- lib
|
122
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
263
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
264
|
+
none: false
|
265
|
+
requirements:
|
266
|
+
- - ! '>='
|
267
|
+
- !ruby/object:Gem::Version
|
268
|
+
version: '0'
|
269
|
+
segments:
|
270
|
+
- 0
|
271
|
+
hash: -3277112206446566161
|
272
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
273
|
+
none: false
|
274
|
+
requirements:
|
275
|
+
- - ! '>='
|
276
|
+
- !ruby/object:Gem::Version
|
277
|
+
version: '0'
|
134
278
|
requirements: []
|
135
|
-
|
136
279
|
rubyforge_project:
|
137
|
-
rubygems_version: 1.
|
280
|
+
rubygems_version: 1.8.10
|
138
281
|
signing_key:
|
139
282
|
specification_version: 3
|
140
283
|
summary: Provides a ruby interface to flickr via the REST api
|
141
|
-
test_files:
|
142
|
-
- spec/spec_helper.rb
|
143
|
-
- spec/flickr/test_spec.rb
|
144
|
-
- spec/flickr/geo_spec.rb
|
145
|
-
- spec/flickr/contacts_spec.rb
|
146
|
-
- spec/flickr/urls_spec.rb
|
147
|
-
- spec/flickr/errors_spec.rb
|
148
|
-
- spec/flickr/base_spec.rb
|
149
|
-
- spec/flickr/photo_spec.rb
|
150
|
-
- spec/flickr/photosets_spec.rb
|
151
|
-
- spec/flickr/photos_spec.rb
|
284
|
+
test_files: []
|