flickr.rb 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,21 @@ class TestFlickr < Test::Unit::TestCase
16
16
  assert_equal 'some_shared_secret', flickr.instance_variable_get(:@shared_secret)
17
17
  end
18
18
 
19
+ def test_should_instantiate_new_flickr_with_ssl_verify_enabled_by_default
20
+ Flickr.any_instance.stubs(:login)
21
+ flickr = Flickr.new('some_api_key')
22
+ assert_equal true, flickr.instance_variable_get(:@verify_ssl)
23
+ end
24
+
25
+ def test_should_instantiate_new_flickr_with_ssl_options
26
+ Flickr.any_instance.stubs(:login)
27
+ flickr = Flickr.new(:api_key => 'some_api_key', :verify_ssl => false, :ca_file => 'a/path/to/cert.pem')
28
+
29
+ assert_equal 'some_api_key', flickr.api_key
30
+ assert_equal false, flickr.instance_variable_get(:@verify_ssl)
31
+ assert_equal 'a/path/to/cert.pem', flickr.instance_variable_get(:@ca_file)
32
+ end
33
+
19
34
  def test_should_instantiate_new_flickr_client_on_new_api
20
35
  flickr = Flickr.new(:api_key => 'some_api_key', :shared_secret => 'some_shared_secret', 'foo' => 'bar')
21
36
 
@@ -181,7 +196,7 @@ class TestFlickr < Test::Unit::TestCase
181
196
  def test_should_generate_login_url
182
197
  f = flickr_client
183
198
  f.expects(:signature_from).with('api_key' => 'some_api_key', 'perms' => 'write').returns('validsignature')
184
- assert_equal 'http://flickr.com/services/auth/?api_key=some_api_key&perms=write&api_sig=validsignature', f.login_url('write')
199
+ assert_equal 'https://flickr.com/services/auth/?api_key=some_api_key&perms=write&api_sig=validsignature', f.login_url('write')
185
200
  end
186
201
 
187
202
  def test_should_get_token_from_frob
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickr.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Raymond, Patrick Plattes, Rafal Piekarski
8
8
  autorequire: flickr.rb
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-17 00:00:00.000000000 Z
11
+ date: 2014-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -89,13 +89,6 @@ files:
89
89
  - rdoc/Flickr/Photoset.html
90
90
  - rdoc/Flickr/User.html
91
91
  - rdoc/Flickr.html
92
- - rdoc/fonts/Lato-Light.ttf
93
- - rdoc/fonts/Lato-LightItalic.ttf
94
- - rdoc/fonts/Lato-Regular.ttf
95
- - rdoc/fonts/Lato-RegularItalic.ttf
96
- - rdoc/fonts/SourceCodePro-Bold.ttf
97
- - rdoc/fonts/SourceCodePro-Regular.ttf
98
- - rdoc/fonts.css
99
92
  - rdoc/images/add.png
100
93
  - rdoc/images/arrow_up.png
101
94
  - rdoc/images/brick.png
@@ -129,9 +122,9 @@ files:
129
122
  - rdoc/js/search_index.js
130
123
  - rdoc/js/searcher.js
131
124
  - rdoc/rdoc.css
132
- - rdoc/README_txt.html
125
+ - rdoc/README_md.html
133
126
  - rdoc/table_of_contents.html
134
- - README.txt
127
+ - README.md
135
128
  - test/flickr_test.rb
136
129
  - TODO
137
130
  homepage: http://github.com/RaVbaker/flickr/
data/README.txt DELETED
@@ -1,92 +0,0 @@
1
- = flickr
2
-
3
- http://github.com/RaVbaker/flickr
4
-
5
- == DESCRIPTION:
6
-
7
- An insanely easy interface to the Flickr photo-sharing service. By Scott Raymond. (& updated May 2008 by Chris Taggart, http://pushrod.wordpress.com & updated May 2010 by Rafal Piekarski)
8
-
9
- == FEATURES/PROBLEMS:
10
-
11
- The flickr gem (famously featured in a RubyonRails screencast) had broken with Flickr's new authentication scheme and updated API.
12
- This has now been largely corrected, though not all current API calls are supported yet.
13
-
14
- == SYNOPSIS:
15
-
16
- require 'flickr'
17
- flickr = Flickr.new('some_flickr_api_key') # create a flickr client (get an API key from http://api.flickr.com/services/api/)
18
- user = flickr.users('sco@scottraymond.net') # lookup a user
19
- user.name # get the user's name
20
- user.location # and location
21
- user.photos # grab their collection of Photo objects...
22
- user.groups # ...the groups they're in...
23
- user.contacts # ...their contacts...
24
- user.favorites # ...favorite photos...
25
- user.photosets # ...their photo sets...
26
- user.tags # ...their tags...
27
- user.popular_tags # ...and their popular tags
28
- recentphotos = flickr.photos # get the 100 most recent public photos
29
- photo = recentphotos.first # or very most recent one
30
- photo.url # see its URL,
31
- photo.title # title,
32
- photo.description # and description,
33
- photo.owner # and its owner.
34
- File.open(photo.filename, 'w') do |file|
35
- file.puts p.file # save the photo to a local file
36
- end
37
- flickr.photos.each do |p| # get the last 100 public photos...
38
- File.open(p.filename, 'w') do |f|
39
- f.puts p.file('Square') # ...and save a local copy of their square thumbnail
40
- end
41
- end
42
-
43
- == REQUIREMENTS:
44
-
45
- * Xmlsimple gem
46
-
47
- == INSTALL:
48
-
49
- sudo gem install flickr.rb
50
-
51
- * Gem homepage: http://rubygems.org/gems/flickr.rb
52
-
53
- == CONFIGURING:
54
-
55
- If you want to use this gem/plugin with Rails you can create configuration file in /config directory with specified api connection settings. For example:
56
-
57
- development:
58
- api_key: SomeLongApiKey
59
- shared_secret: secret!
60
- auth_token: authSecretToken
61
-
62
- beta:
63
- api_key: SomeLongApiKeyBeta
64
- shared_secret: secretBeta!
65
- auth_token: authSecretTokenBeta
66
-
67
-
68
-
69
- == LICENSE:
70
-
71
- (The MIT License)
72
-
73
- Copyright (c) 2005-2010 Scott Raymond, Patrick Plattes, Chris Taggart, Rafal Piekarski
74
-
75
- Permission is hereby granted, free of charge, to any person obtaining
76
- a copy of this software and associated documentation files (the
77
- 'Software'), to deal in the Software without restriction, including
78
- without limitation the rights to use, copy, modify, merge, publish,
79
- distribute, sublicense, and/or sell copies of the Software, and to
80
- permit persons to whom the Software is furnished to do so, subject to
81
- the following conditions:
82
-
83
- The above copyright notice and this permission notice shall be
84
- included in all copies or substantial portions of the Software.
85
-
86
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
87
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
88
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
89
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
90
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
91
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
92
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,167 +0,0 @@
1
- /*
2
- * Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
3
- * with Reserved Font Name "Source". All Rights Reserved. Source is a
4
- * trademark of Adobe Systems Incorporated in the United States and/or other
5
- * countries.
6
- *
7
- * This Font Software is licensed under the SIL Open Font License, Version
8
- * 1.1.
9
- *
10
- * This license is copied below, and is also available with a FAQ at:
11
- * http://scripts.sil.org/OFL
12
- */
13
-
14
- @font-face {
15
- font-family: "Source Code Pro";
16
- font-style: normal;
17
- font-weight: 400;
18
- src: local("Source Code Pro"),
19
- local("SourceCodePro-Regular"),
20
- url("fonts/SourceCodePro-Regular.ttf") format("truetype");
21
- }
22
-
23
- @font-face {
24
- font-family: "Source Code Pro";
25
- font-style: normal;
26
- font-weight: 700;
27
- src: local("Source Code Pro Bold"),
28
- local("SourceCodePro-Bold"),
29
- url("fonts/SourceCodePro-Bold.ttf") format("truetype");
30
- }
31
-
32
- /*
33
- * Copyright (c) 2010, Łukasz Dziedzic (dziedzic@typoland.com),
34
- * with Reserved Font Name Lato.
35
- *
36
- * This Font Software is licensed under the SIL Open Font License, Version
37
- * 1.1.
38
- *
39
- * This license is copied below, and is also available with a FAQ at:
40
- * http://scripts.sil.org/OFL
41
- */
42
-
43
- @font-face {
44
- font-family: "Lato";
45
- font-style: normal;
46
- font-weight: 300;
47
- src: local("Lato Light"),
48
- local("Lato-Light"),
49
- url("fonts/Lato-Light.ttf") format("truetype");
50
- }
51
-
52
- @font-face {
53
- font-family: "Lato";
54
- font-style: italic;
55
- font-weight: 300;
56
- src: local("Lato Light Italic"),
57
- local("Lato-LightItalic"),
58
- url("fonts/Lato-LightItalic.ttf") format("truetype");
59
- }
60
-
61
- @font-face {
62
- font-family: "Lato";
63
- font-style: normal;
64
- font-weight: 700;
65
- src: local("Lato Regular"),
66
- local("Lato-Regular"),
67
- url("fonts/Lato-Regular.ttf") format("truetype");
68
- }
69
-
70
- @font-face {
71
- font-family: "Lato";
72
- font-style: italic;
73
- font-weight: 700;
74
- src: local("Lato Italic"),
75
- local("Lato-Italic"),
76
- url("fonts/Lato-RegularItalic.ttf") format("truetype");
77
- }
78
-
79
- /*
80
- * -----------------------------------------------------------
81
- * SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
82
- * -----------------------------------------------------------
83
- *
84
- * PREAMBLE
85
- * The goals of the Open Font License (OFL) are to stimulate worldwide
86
- * development of collaborative font projects, to support the font creation
87
- * efforts of academic and linguistic communities, and to provide a free and
88
- * open framework in which fonts may be shared and improved in partnership
89
- * with others.
90
- *
91
- * The OFL allows the licensed fonts to be used, studied, modified and
92
- * redistributed freely as long as they are not sold by themselves. The
93
- * fonts, including any derivative works, can be bundled, embedded,
94
- * redistributed and/or sold with any software provided that any reserved
95
- * names are not used by derivative works. The fonts and derivatives,
96
- * however, cannot be released under any other type of license. The
97
- * requirement for fonts to remain under this license does not apply
98
- * to any document created using the fonts or their derivatives.
99
- *
100
- * DEFINITIONS
101
- * "Font Software" refers to the set of files released by the Copyright
102
- * Holder(s) under this license and clearly marked as such. This may
103
- * include source files, build scripts and documentation.
104
- *
105
- * "Reserved Font Name" refers to any names specified as such after the
106
- * copyright statement(s).
107
- *
108
- * "Original Version" refers to the collection of Font Software components as
109
- * distributed by the Copyright Holder(s).
110
- *
111
- * "Modified Version" refers to any derivative made by adding to, deleting,
112
- * or substituting -- in part or in whole -- any of the components of the
113
- * Original Version, by changing formats or by porting the Font Software to a
114
- * new environment.
115
- *
116
- * "Author" refers to any designer, engineer, programmer, technical
117
- * writer or other person who contributed to the Font Software.
118
- *
119
- * PERMISSION & CONDITIONS
120
- * Permission is hereby granted, free of charge, to any person obtaining
121
- * a copy of the Font Software, to use, study, copy, merge, embed, modify,
122
- * redistribute, and sell modified and unmodified copies of the Font
123
- * Software, subject to the following conditions:
124
- *
125
- * 1) Neither the Font Software nor any of its individual components,
126
- * in Original or Modified Versions, may be sold by itself.
127
- *
128
- * 2) Original or Modified Versions of the Font Software may be bundled,
129
- * redistributed and/or sold with any software, provided that each copy
130
- * contains the above copyright notice and this license. These can be
131
- * included either as stand-alone text files, human-readable headers or
132
- * in the appropriate machine-readable metadata fields within text or
133
- * binary files as long as those fields can be easily viewed by the user.
134
- *
135
- * 3) No Modified Version of the Font Software may use the Reserved Font
136
- * Name(s) unless explicit written permission is granted by the corresponding
137
- * Copyright Holder. This restriction only applies to the primary font name as
138
- * presented to the users.
139
- *
140
- * 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
141
- * Software shall not be used to promote, endorse or advertise any
142
- * Modified Version, except to acknowledge the contribution(s) of the
143
- * Copyright Holder(s) and the Author(s) or with their explicit written
144
- * permission.
145
- *
146
- * 5) The Font Software, modified or unmodified, in part or in whole,
147
- * must be distributed entirely under this license, and must not be
148
- * distributed under any other license. The requirement for fonts to
149
- * remain under this license does not apply to any document created
150
- * using the Font Software.
151
- *
152
- * TERMINATION
153
- * This license becomes null and void if any of the above conditions are
154
- * not met.
155
- *
156
- * DISCLAIMER
157
- * THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
158
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
159
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
160
- * OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
161
- * COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
162
- * INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
163
- * DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
164
- * FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
165
- * OTHER DEALINGS IN THE FONT SOFTWARE.
166
- */
167
-
Binary file
Binary file