digitalpardoe-rflickr 1.1.4 → 2.0.0.pre.1

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.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.autotest +5 -0
  3. data/.document +5 -0
  4. data/.rspec +0 -0
  5. data/Gemfile +5 -5
  6. data/README.md +40 -0
  7. data/Rakefile +17 -21
  8. data/VERSION +1 -0
  9. data/digitalpardoe-rflickr.gemspec +39 -42
  10. data/lib/flickr.rb +44 -37
  11. data/lib/flickr/api.rb +26 -0
  12. data/lib/flickr/interaction/flickr_api_request.rb +75 -0
  13. data/lib/flickr/interaction/request.rb +37 -0
  14. data/spec/api/activity_spec.rb +16 -0
  15. data/spec/api/api_spec.rb +16 -0
  16. data/spec/api/auth_spec.rb +16 -0
  17. data/spec/api/blogs_spec.rb +12 -0
  18. data/spec/api/collections_spec.rb +17 -0
  19. data/spec/api/commons_spec.rb +12 -0
  20. data/spec/api/contacts_spec.rb +16 -0
  21. data/spec/api/favorites_spec.rb +11 -0
  22. data/spec/api/groups/members_spec.rb +20 -0
  23. data/spec/config/api.example.yml +3 -0
  24. data/spec/flickr_spec.rb +33 -0
  25. data/spec/spec_helper.rb +19 -0
  26. metadata +95 -116
  27. data/LICENSE +0 -278
  28. data/README.markdown +0 -22
  29. data/VERSION.yml +0 -5
  30. data/lib/flickr/auth.rb +0 -94
  31. data/lib/flickr/base.rb +0 -810
  32. data/lib/flickr/blogs.rb +0 -50
  33. data/lib/flickr/contacts.rb +0 -68
  34. data/lib/flickr/favorites.rb +0 -79
  35. data/lib/flickr/groups.rb +0 -102
  36. data/lib/flickr/interestingness.rb +0 -39
  37. data/lib/flickr/licenses.rb +0 -43
  38. data/lib/flickr/notes.rb +0 -44
  39. data/lib/flickr/people.rb +0 -99
  40. data/lib/flickr/photos.rb +0 -305
  41. data/lib/flickr/photosets.rb +0 -124
  42. data/lib/flickr/pools.rb +0 -90
  43. data/lib/flickr/reflection.rb +0 -109
  44. data/lib/flickr/tags.rb +0 -79
  45. data/lib/flickr/transform.rb +0 -29
  46. data/lib/flickr/upload.rb +0 -225
  47. data/lib/flickr/urls.rb +0 -69
  48. data/test/test_suite.rb +0 -3
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Activity" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should sucessfully get the user comments" do
9
+ @flickr.flickr_activity_userComments(auth: true)['stat'].should == 'ok'
10
+ end
11
+
12
+ it "should sucessfully get the users photos" do
13
+ @flickr.flickr_activity_userPhotos(auth: true)['stat'].should == 'ok'
14
+ end
15
+ end
16
+
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Api" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should (probably) fail but not error" do
9
+ @flickr.api.login_link
10
+ @flickr.api.get_token['stat'].should == 'fail'
11
+ end
12
+
13
+ it "should raise an error when getting token without login_link" do
14
+ lambda { @flickr.api.get_token }.should raise_error(ArgumentError)
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Auth" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should sucessfully check the auth token" do
9
+ @flickr.flickr_auth_checkToken(auth: true)['stat'].should == 'ok'
10
+ end
11
+
12
+ it "should sucessfully get the frob" do
13
+ @flickr.flickr_auth_getFrob['stat'].should == 'ok'
14
+ end
15
+ end
16
+
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Blogs" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should be able to get the blog list" do
9
+ @flickr.flickr_blogs_getList(auth: true)['stat'].should == 'ok'
10
+ end
11
+ end
12
+
@@ -0,0 +1,17 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Collections" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should successfully retrieve the collection tree" do
9
+ @flickr.flickr_collections_getTree(auth: true)['stat'].should == 'ok'
10
+ end
11
+
12
+ it "should successfully retrieve the collection information" do
13
+ set_id = @flickr.flickr_collections_getTree(auth: true)['collections']['collection'][0]['id']
14
+ @flickr.flickr_collections_getInfo(args: { collection_id: set_id }, auth: true)['stat'].should == 'ok'
15
+ end
16
+ end
17
+
@@ -0,0 +1,12 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Commons" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should sucessfully get institutions" do
9
+ @flickr.flickr_commons_getInstitutions['stat'].should == 'ok'
10
+ end
11
+ end
12
+
@@ -0,0 +1,16 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Contacts" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should sucessfully get the list of contacts" do
9
+ @flickr.flickr_contacts_getList(auth: true)['stat'].should == 'ok'
10
+ end
11
+
12
+ it "should sucessfully get the recently uploaded list" do
13
+ @flickr.flickr_contacts_getListRecentlyUploaded(auth: true)['stat'].should == 'ok'
14
+ end
15
+ end
16
+
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
+
3
+ describe "Favorites" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ end
7
+
8
+ it "should be able to get the list" do
9
+ @flickr.flickr_favorites_getList(auth: true)['stat'].should == 'ok'
10
+ end
11
+ end
@@ -0,0 +1,20 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
2
+
3
+ describe "Groups/Member" do
4
+ before(:each) do
5
+ @flickr = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ @group_id = @flickr.flickr_groups_search(args: { text: "Nikon" })['groups']['group'][0]['nsid']
7
+ end
8
+
9
+ it "should be able to get the members list" do
10
+ @flickr.flickr_groups_members_getList(args: { group_id: @group_id, membertypes: [2] }, auth: true)['stat'].should == 'ok'
11
+ end
12
+
13
+ it "should be able to handle an array of member types" do
14
+ @flickr.flickr_groups_members_getList(args: { group_id: @group_id, membertypes: [2, 3] }, auth: true)['stat'].should == 'ok'
15
+ end
16
+
17
+ it "should be able to get the members list without member types" do
18
+ @flickr.flickr_groups_members_getList(args: { group_id: @group_id }, auth: true)['stat'].should == 'ok'
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ api_key: api_key
2
+ shared_secret: shared_secret
3
+ auth_token: auth_token
@@ -0,0 +1,33 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe Flickr do
4
+ before(:each) do
5
+ @flickr_auth = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'], Flickr.class_variable_get(:@@api_data)['auth_token'])
6
+ @flickr_norm = Flickr.new(Flickr.class_variable_get(:@@api_data)['api_key'], Flickr.class_variable_get(:@@api_data)['shared_secret'])
7
+ end
8
+
9
+ it "should connect and make api request" do
10
+ (@flickr_auth.flickr_test_echo['stat'] == 'fail' ? true : (@flickr_auth.flickr_test_echo['stat'].should == 'ok' ? true : false)).should == true
11
+ end
12
+
13
+ it "should make authorized request" do
14
+ @flickr_auth.flickr_test_login(auth: true)['stat'].should == 'ok'
15
+ end
16
+
17
+ it "should not make authorized request" do
18
+ @flickr_auth.auth_token('some_token').flickr_test_login(auth: true)['stat'].should == 'fail'
19
+ end
20
+
21
+ it "should not raise an error on authorized method with nil token" do
22
+ @flickr_auth.auth_token(nil).flickr_test_login(auth: true)['stat'].should == 'fail'
23
+ end
24
+
25
+ it "should not make an authorized request" do
26
+ @flickr_norm.flickr_test_login['stat'].should == 'fail'
27
+ end
28
+
29
+ it "should make a normal request" do
30
+ @flickr_norm.flickr_test_echo['stat'].should == 'ok'
31
+ end
32
+ end
33
+
@@ -0,0 +1,19 @@
1
+ require 'rspec'
2
+ require 'yaml'
3
+
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ require 'flickr'
7
+
8
+ file_path = File.dirname(__FILE__) + '/config/api.yml'
9
+
10
+ if (File.exists?(file_path))
11
+ Flickr.class_variable_set(:@@api_data, File.open(file_path) { |yf| YAML::load( yf ) })['api_key']
12
+ else
13
+ raise IOError, 'You need to create the config/api.yml file containing your details first'
14
+ end
15
+
16
+ RSpec.configure do |config|
17
+ config.color_enabled = true
18
+ config.formatter = :documentation
19
+ end
metadata CHANGED
@@ -1,146 +1,125 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: digitalpardoe-rflickr
3
- version: !ruby/object:Gem::Version
4
- hash: 27
5
- prerelease:
6
- segments:
7
- - 1
8
- - 1
9
- - 4
10
- version: 1.1.4
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0.pre.1
11
5
  platform: ruby
12
- authors:
13
- - digital:pardoe
6
+ authors:
7
+ - Alex Pardoe
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-08-09 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.8.0
21
20
  type: :runtime
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
23
- none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 3
28
- segments:
29
- - 0
30
- version: "0"
31
- requirement: *id001
32
21
  prerelease: false
33
- name: mime-types
34
- - !ruby/object:Gem::Dependency
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.8.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
35
34
  type: :development
36
- version_requirements: &id002 !ruby/object:Gem::Requirement
37
- none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- hash: 3
42
- segments:
43
- - 0
44
- version: "0"
45
- requirement: *id002
46
35
  prerelease: false
47
- name: rdoc
48
- - !ruby/object:Gem::Dependency
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jeweler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 1.8.4
49
48
  type: :development
50
- version_requirements: &id003 !ruby/object:Gem::Requirement
51
- none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- hash: 3
56
- segments:
57
- - 0
58
- version: "0"
59
- requirement: *id003
60
49
  prerelease: false
61
- name: bundler
62
- - !ruby/object:Gem::Dependency
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.8.4
55
+ - !ruby/object:Gem::Dependency
56
+ name: ZenTest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
63
62
  type: :development
64
- version_requirements: &id004 !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
73
- requirement: *id004
74
63
  prerelease: false
75
- name: jeweler
76
- description: rFlickr is a clone of the original RubyForge based rflickr, a Ruby implementation of the Flickr API. It includes a faithful albeit old reproduction of the published API.
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: rFlickr is a clone of the original RubyForge based rflickr, a Ruby implementation
70
+ of the Flickr API. It includes a faithful albeit old reproduction of the published
71
+ API.
77
72
  email: contact@digitalpardoe.co.uk
78
73
  executables: []
79
-
80
74
  extensions: []
81
-
82
- extra_rdoc_files:
83
- - LICENSE
84
- - README.markdown
85
- files:
75
+ extra_rdoc_files:
76
+ - README.md
77
+ files:
78
+ - .autotest
79
+ - .document
80
+ - .rspec
86
81
  - Gemfile
87
- - LICENSE
88
- - README.markdown
82
+ - README.md
89
83
  - Rakefile
90
- - VERSION.yml
84
+ - VERSION
91
85
  - digitalpardoe-rflickr.gemspec
92
86
  - lib/flickr.rb
93
- - lib/flickr/auth.rb
94
- - lib/flickr/base.rb
95
- - lib/flickr/blogs.rb
96
- - lib/flickr/contacts.rb
97
- - lib/flickr/favorites.rb
98
- - lib/flickr/groups.rb
99
- - lib/flickr/interestingness.rb
100
- - lib/flickr/licenses.rb
101
- - lib/flickr/notes.rb
102
- - lib/flickr/people.rb
103
- - lib/flickr/photos.rb
104
- - lib/flickr/photosets.rb
105
- - lib/flickr/pools.rb
106
- - lib/flickr/reflection.rb
107
- - lib/flickr/tags.rb
108
- - lib/flickr/transform.rb
109
- - lib/flickr/upload.rb
110
- - lib/flickr/urls.rb
111
- - test/test_suite.rb
87
+ - lib/flickr/api.rb
88
+ - lib/flickr/interaction/flickr_api_request.rb
89
+ - lib/flickr/interaction/request.rb
90
+ - spec/api/activity_spec.rb
91
+ - spec/api/api_spec.rb
92
+ - spec/api/auth_spec.rb
93
+ - spec/api/blogs_spec.rb
94
+ - spec/api/collections_spec.rb
95
+ - spec/api/commons_spec.rb
96
+ - spec/api/contacts_spec.rb
97
+ - spec/api/favorites_spec.rb
98
+ - spec/api/groups/members_spec.rb
99
+ - spec/config/api.example.yml
100
+ - spec/flickr_spec.rb
101
+ - spec/spec_helper.rb
112
102
  homepage: http://github.com/digitalpardoe/rflickr
113
103
  licenses: []
114
-
104
+ metadata: {}
115
105
  post_install_message:
116
106
  rdoc_options: []
117
-
118
- require_paths:
107
+ require_paths:
119
108
  - lib
120
- required_ruby_version: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- hash: 3
126
- segments:
127
- - 0
128
- version: "0"
129
- required_rubygems_version: !ruby/object:Gem::Requirement
130
- none: false
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- hash: 3
135
- segments:
136
- - 0
137
- version: "0"
109
+ required_ruby_version: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - '>='
112
+ - !ruby/object:Gem::Version
113
+ version: '0'
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - '>'
117
+ - !ruby/object:Gem::Version
118
+ version: 1.3.1
138
119
  requirements: []
139
-
140
120
  rubyforge_project:
141
- rubygems_version: 1.8.25
121
+ rubygems_version: 2.0.3
142
122
  signing_key:
143
- specification_version: 3
123
+ specification_version: 4
144
124
  summary: rFlickr is a Ruby interface to the Flickr API
145
125
  test_files: []
146
-