go-picasa-go 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +135 -0
- data/Rakefile +16 -0
- data/TODO +10 -0
- data/VERSION +1 -0
- data/bin/go-picasa-go +64 -0
- data/examples/rails-example/README +243 -0
- data/examples/rails-example/Rakefile +10 -0
- data/examples/rails-example/app/controllers/albums_controller.rb +62 -0
- data/examples/rails-example/app/controllers/application_controller.rb +10 -0
- data/examples/rails-example/app/controllers/photos_controller.rb +77 -0
- data/examples/rails-example/app/helpers/albums_helper.rb +9 -0
- data/examples/rails-example/app/helpers/application_helper.rb +3 -0
- data/examples/rails-example/app/models/my_user.rb +9 -0
- data/examples/rails-example/app/views/albums/_form.html.erb +15 -0
- data/examples/rails-example/app/views/albums/edit.html.erb +10 -0
- data/examples/rails-example/app/views/albums/index.html.erb +50 -0
- data/examples/rails-example/app/views/albums/new.html.erb +10 -0
- data/examples/rails-example/app/views/photos/index.html.erb +30 -0
- data/examples/rails-example/app/views/photos/new.html.erb +8 -0
- data/examples/rails-example/app/views/photos/show.html.erb +19 -0
- data/examples/rails-example/config/boot.rb +110 -0
- data/examples/rails-example/config/database.yml +22 -0
- data/examples/rails-example/config/environment.rb +42 -0
- data/examples/rails-example/config/environments/development.rb +17 -0
- data/examples/rails-example/config/environments/production.rb +28 -0
- data/examples/rails-example/config/environments/test.rb +28 -0
- data/examples/rails-example/config/initializers/backtrace_silencers.rb +7 -0
- data/examples/rails-example/config/initializers/inflections.rb +10 -0
- data/examples/rails-example/config/initializers/mime_types.rb +5 -0
- data/examples/rails-example/config/initializers/new_rails_defaults.rb +21 -0
- data/examples/rails-example/config/initializers/session_store.rb +15 -0
- data/examples/rails-example/config/locales/en.yml +5 -0
- data/examples/rails-example/config/routes.rb +49 -0
- data/examples/rails-example/db/seeds.rb +7 -0
- data/examples/rails-example/doc/README_FOR_APP +2 -0
- data/examples/rails-example/log/development.log +6923 -0
- data/examples/rails-example/log/production.log +0 -0
- data/examples/rails-example/log/server.log +0 -0
- data/examples/rails-example/log/test.log +0 -0
- data/examples/rails-example/public/404.html +30 -0
- data/examples/rails-example/public/422.html +30 -0
- data/examples/rails-example/public/500.html +30 -0
- data/examples/rails-example/public/favicon.ico +0 -0
- data/examples/rails-example/public/images/rails.png +0 -0
- data/examples/rails-example/public/index.html +275 -0
- data/examples/rails-example/public/javascripts/application.js +2 -0
- data/examples/rails-example/public/javascripts/controls.js +963 -0
- data/examples/rails-example/public/javascripts/dragdrop.js +973 -0
- data/examples/rails-example/public/javascripts/effects.js +1128 -0
- data/examples/rails-example/public/javascripts/prototype.js +4320 -0
- data/examples/rails-example/public/robots.txt +5 -0
- data/examples/rails-example/script/about +4 -0
- data/examples/rails-example/script/console +3 -0
- data/examples/rails-example/script/dbconsole +3 -0
- data/examples/rails-example/script/destroy +3 -0
- data/examples/rails-example/script/generate +3 -0
- data/examples/rails-example/script/performance/benchmarker +3 -0
- data/examples/rails-example/script/performance/profiler +3 -0
- data/examples/rails-example/script/plugin +3 -0
- data/examples/rails-example/script/runner +3 -0
- data/examples/rails-example/script/server +3 -0
- data/examples/rails-example/test/functional/albums_controller_test.rb +8 -0
- data/examples/rails-example/test/performance/browsing_test.rb +9 -0
- data/examples/rails-example/test/test_helper.rb +38 -0
- data/examples/rails-example/test/unit/helpers/albums_helper_test.rb +4 -0
- data/go_picasa_go.gemspec +184 -0
- data/init.rb +1 -0
- data/lib/generators/authentication_token_generator.rb +12 -0
- data/lib/generators/template/user_class.erb +9 -0
- data/lib/generators/user_class_generator.rb +50 -0
- data/lib/go_picasa_go.rb +26 -0
- data/lib/patchs/object.rb +21 -0
- data/lib/patchs/ssl.rb +9 -0
- data/lib/picasa/album.rb +267 -0
- data/lib/picasa/authentication.rb +19 -0
- data/lib/picasa/default_album.rb +9 -0
- data/lib/picasa/default_photo.rb +6 -0
- data/lib/picasa/default_user.rb +6 -0
- data/lib/picasa/http/album.rb +113 -0
- data/lib/picasa/http/authentication.rb +40 -0
- data/lib/picasa/http/photo.rb +117 -0
- data/lib/picasa/missing.rb +22 -0
- data/lib/picasa/photo.rb +190 -0
- data/lib/picasa/template/album.xml.erb +20 -0
- data/lib/picasa/template/photo.erb +15 -0
- data/lib/picasa/user.rb +57 -0
- data/lib/picasa/util.rb +33 -0
- data/script.rb +46 -0
- data/spec/album_spec.rb +245 -0
- data/spec/authentication_spec.rb +19 -0
- data/spec/default_classes_spec.rb +50 -0
- data/spec/fixture/photo.jpg +0 -0
- data/spec/fixture/photo2.jpg +0 -0
- data/spec/generators/user_class_generator_spec.rb +40 -0
- data/spec/http/album_spec.rb +129 -0
- data/spec/http/authentication_spec.rb +15 -0
- data/spec/http/photo_spec.rb +78 -0
- data/spec/http_response_helper.rb +23 -0
- data/spec/mock_helper.rb +113 -0
- data/spec/photo_spec.rb +201 -0
- data/spec/spec_helper.rb +151 -0
- data/spec/suites/all.rb +14 -0
- data/spec/suites/all_mocked.rb +5 -0
- data/spec/user_spec.rb +74 -0
- metadata +222 -0
data/spec/suites/all.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'authentication_spec'
|
2
|
+
require 'user_spec'
|
3
|
+
require 'album_spec'
|
4
|
+
require 'photo_spec'
|
5
|
+
require 'generators/user_class_generator_spec'
|
6
|
+
|
7
|
+
require 'http/authentication_spec'
|
8
|
+
require 'http/album_spec'
|
9
|
+
require 'http/photo_spec'
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
data/spec/user_spec.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'Picasa::User' do
|
4
|
+
|
5
|
+
it 'should raise exception when missconfigurate the class that includes User module' do
|
6
|
+
lambda {
|
7
|
+
class UserObject
|
8
|
+
act_as_picasa_user
|
9
|
+
|
10
|
+
# The class_name param should be String not class
|
11
|
+
has_many_picasa_albums :class_name => String.class
|
12
|
+
end
|
13
|
+
}.should raise_exception
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should authenticate an user and set the auth_token attribute' do
|
17
|
+
mock_authentication
|
18
|
+
|
19
|
+
user = UserObject.new
|
20
|
+
user.picasa_id = "bandmanagertest"
|
21
|
+
user.password = "$bandmanager$"
|
22
|
+
auth_token = user.authenticate
|
23
|
+
|
24
|
+
auth_token.should_not be_nil
|
25
|
+
auth_token.should_not be_empty
|
26
|
+
|
27
|
+
user.auth_token.should == auth_token
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should find all albums from a user' do
|
31
|
+
mock_authentication
|
32
|
+
mock_post_album
|
33
|
+
mock_get_albums
|
34
|
+
|
35
|
+
user = UserObject.new
|
36
|
+
user.picasa_id = 'bandmanagertest'
|
37
|
+
user.password = "$bandmanager$"
|
38
|
+
user.authenticate.should_not be_nil
|
39
|
+
|
40
|
+
album1 = create_album
|
41
|
+
|
42
|
+
albums = user.albums
|
43
|
+
albums.should_not be_nil
|
44
|
+
albums.size.should > 0
|
45
|
+
|
46
|
+
albums.each do |album|
|
47
|
+
album.user.picasa_id.should == user.picasa_id
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should find an album from a user' do
|
52
|
+
mock_post_album
|
53
|
+
mock_get_album
|
54
|
+
|
55
|
+
user = UserObject.new
|
56
|
+
user.picasa_id = 'bandmanagertest'
|
57
|
+
user.auth_token = "DQAAAHsAAAAdMyvdNfPg_iTFD-T_u6bBb-9BegOP7CGWnjah7FCJvnu8aiOoHXJMAJ-6HS_8vOE"+
|
58
|
+
"2zFLXaSzp3oe4mB9lJexTpxxM-CmChSTs-9OBd6nAwNji5yWnLUFv_Q7-ibXMx7820aFdnU7mr6"+
|
59
|
+
"qqvHUhXESdhBEnD1QP_o8dqsP-6T-oig"
|
60
|
+
|
61
|
+
album1 = create_album
|
62
|
+
|
63
|
+
album2 = user.find_album album1.picasa_id
|
64
|
+
album2.should_not be_nil
|
65
|
+
album2.picasa_id.should == album1.picasa_id
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'should have the album_class method' do
|
69
|
+
UserObject.album_class.should == AlbumObject
|
70
|
+
|
71
|
+
user = UserObject.new
|
72
|
+
user.album_class.should == AlbumObject
|
73
|
+
end
|
74
|
+
end
|
metadata
ADDED
@@ -0,0 +1,222 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: go-picasa-go
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Pedro Dias
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-10-25 00:00:00 -02:00
|
19
|
+
default_executable: go-picasa-go
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: nokogiri
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 113
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 4
|
33
|
+
- 3
|
34
|
+
- 1
|
35
|
+
version: 1.4.3.1
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id001
|
38
|
+
description: Go Picasa go is intended as library written in ruby to manipulate Picasa albums and photos in a easy way. The idea is to provide behaviors to ordinary objects so they can create, retrieve, update and delete albums and photos in a more object oritented way, lefting behind all the HTTP talk that was necessary previouly to interect with this service provided by Google.
|
39
|
+
email: pedro.capaca@gmail.com
|
40
|
+
executables:
|
41
|
+
- go-picasa-go
|
42
|
+
extensions: []
|
43
|
+
|
44
|
+
extra_rdoc_files:
|
45
|
+
- README.rdoc
|
46
|
+
- TODO
|
47
|
+
files:
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- TODO
|
51
|
+
- VERSION
|
52
|
+
- bin/go-picasa-go
|
53
|
+
- examples/rails-example/README
|
54
|
+
- examples/rails-example/Rakefile
|
55
|
+
- examples/rails-example/app/controllers/albums_controller.rb
|
56
|
+
- examples/rails-example/app/controllers/application_controller.rb
|
57
|
+
- examples/rails-example/app/controllers/photos_controller.rb
|
58
|
+
- examples/rails-example/app/helpers/albums_helper.rb
|
59
|
+
- examples/rails-example/app/helpers/application_helper.rb
|
60
|
+
- examples/rails-example/app/models/my_user.rb
|
61
|
+
- examples/rails-example/app/views/albums/_form.html.erb
|
62
|
+
- examples/rails-example/app/views/albums/edit.html.erb
|
63
|
+
- examples/rails-example/app/views/albums/index.html.erb
|
64
|
+
- examples/rails-example/app/views/albums/new.html.erb
|
65
|
+
- examples/rails-example/app/views/photos/index.html.erb
|
66
|
+
- examples/rails-example/app/views/photos/new.html.erb
|
67
|
+
- examples/rails-example/app/views/photos/show.html.erb
|
68
|
+
- examples/rails-example/config/boot.rb
|
69
|
+
- examples/rails-example/config/database.yml
|
70
|
+
- examples/rails-example/config/environment.rb
|
71
|
+
- examples/rails-example/config/environments/development.rb
|
72
|
+
- examples/rails-example/config/environments/production.rb
|
73
|
+
- examples/rails-example/config/environments/test.rb
|
74
|
+
- examples/rails-example/config/initializers/backtrace_silencers.rb
|
75
|
+
- examples/rails-example/config/initializers/inflections.rb
|
76
|
+
- examples/rails-example/config/initializers/mime_types.rb
|
77
|
+
- examples/rails-example/config/initializers/new_rails_defaults.rb
|
78
|
+
- examples/rails-example/config/initializers/session_store.rb
|
79
|
+
- examples/rails-example/config/locales/en.yml
|
80
|
+
- examples/rails-example/config/routes.rb
|
81
|
+
- examples/rails-example/db/seeds.rb
|
82
|
+
- examples/rails-example/doc/README_FOR_APP
|
83
|
+
- examples/rails-example/log/development.log
|
84
|
+
- examples/rails-example/log/production.log
|
85
|
+
- examples/rails-example/log/server.log
|
86
|
+
- examples/rails-example/log/test.log
|
87
|
+
- examples/rails-example/public/404.html
|
88
|
+
- examples/rails-example/public/422.html
|
89
|
+
- examples/rails-example/public/500.html
|
90
|
+
- examples/rails-example/public/favicon.ico
|
91
|
+
- examples/rails-example/public/images/rails.png
|
92
|
+
- examples/rails-example/public/index.html
|
93
|
+
- examples/rails-example/public/javascripts/application.js
|
94
|
+
- examples/rails-example/public/javascripts/controls.js
|
95
|
+
- examples/rails-example/public/javascripts/dragdrop.js
|
96
|
+
- examples/rails-example/public/javascripts/effects.js
|
97
|
+
- examples/rails-example/public/javascripts/prototype.js
|
98
|
+
- examples/rails-example/public/robots.txt
|
99
|
+
- examples/rails-example/script/about
|
100
|
+
- examples/rails-example/script/console
|
101
|
+
- examples/rails-example/script/dbconsole
|
102
|
+
- examples/rails-example/script/destroy
|
103
|
+
- examples/rails-example/script/generate
|
104
|
+
- examples/rails-example/script/performance/benchmarker
|
105
|
+
- examples/rails-example/script/performance/profiler
|
106
|
+
- examples/rails-example/script/plugin
|
107
|
+
- examples/rails-example/script/runner
|
108
|
+
- examples/rails-example/script/server
|
109
|
+
- examples/rails-example/test/functional/albums_controller_test.rb
|
110
|
+
- examples/rails-example/test/performance/browsing_test.rb
|
111
|
+
- examples/rails-example/test/test_helper.rb
|
112
|
+
- examples/rails-example/test/unit/helpers/albums_helper_test.rb
|
113
|
+
- go_picasa_go.gemspec
|
114
|
+
- init.rb
|
115
|
+
- lib/generators/authentication_token_generator.rb
|
116
|
+
- lib/generators/template/user_class.erb
|
117
|
+
- lib/generators/user_class_generator.rb
|
118
|
+
- lib/go_picasa_go.rb
|
119
|
+
- lib/patchs/object.rb
|
120
|
+
- lib/patchs/ssl.rb
|
121
|
+
- lib/picasa/album.rb
|
122
|
+
- lib/picasa/authentication.rb
|
123
|
+
- lib/picasa/default_album.rb
|
124
|
+
- lib/picasa/default_photo.rb
|
125
|
+
- lib/picasa/default_user.rb
|
126
|
+
- lib/picasa/http/album.rb
|
127
|
+
- lib/picasa/http/authentication.rb
|
128
|
+
- lib/picasa/http/photo.rb
|
129
|
+
- lib/picasa/missing.rb
|
130
|
+
- lib/picasa/photo.rb
|
131
|
+
- lib/picasa/template/album.xml.erb
|
132
|
+
- lib/picasa/template/photo.erb
|
133
|
+
- lib/picasa/user.rb
|
134
|
+
- lib/picasa/util.rb
|
135
|
+
- script.rb
|
136
|
+
- spec/album_spec.rb
|
137
|
+
- spec/authentication_spec.rb
|
138
|
+
- spec/default_classes_spec.rb
|
139
|
+
- spec/fixture/photo.jpg
|
140
|
+
- spec/fixture/photo2.jpg
|
141
|
+
- spec/generators/user_class_generator_spec.rb
|
142
|
+
- spec/http/album_spec.rb
|
143
|
+
- spec/http/authentication_spec.rb
|
144
|
+
- spec/http/photo_spec.rb
|
145
|
+
- spec/http_response_helper.rb
|
146
|
+
- spec/mock_helper.rb
|
147
|
+
- spec/photo_spec.rb
|
148
|
+
- spec/spec_helper.rb
|
149
|
+
- spec/suites/all.rb
|
150
|
+
- spec/suites/all_mocked.rb
|
151
|
+
- spec/user_spec.rb
|
152
|
+
has_rdoc: true
|
153
|
+
homepage: http://github.com/capaca/go-picasa-go
|
154
|
+
licenses: []
|
155
|
+
|
156
|
+
post_install_message:
|
157
|
+
rdoc_options:
|
158
|
+
- --charset=UTF-8
|
159
|
+
require_paths:
|
160
|
+
- lib
|
161
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
hash: 3
|
167
|
+
segments:
|
168
|
+
- 0
|
169
|
+
version: "0"
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
hash: 3
|
176
|
+
segments:
|
177
|
+
- 0
|
178
|
+
version: "0"
|
179
|
+
requirements: []
|
180
|
+
|
181
|
+
rubyforge_project:
|
182
|
+
rubygems_version: 1.3.7
|
183
|
+
signing_key:
|
184
|
+
specification_version: 3
|
185
|
+
summary: API to easly manipulate picasa albums and photos
|
186
|
+
test_files:
|
187
|
+
- spec/mock_helper.rb
|
188
|
+
- spec/default_classes_spec.rb
|
189
|
+
- spec/user_spec.rb
|
190
|
+
- spec/http_response_helper.rb
|
191
|
+
- spec/http/photo_spec.rb
|
192
|
+
- spec/http/authentication_spec.rb
|
193
|
+
- spec/http/album_spec.rb
|
194
|
+
- spec/generators/user_class_generator_spec.rb
|
195
|
+
- spec/photo_spec.rb
|
196
|
+
- spec/authentication_spec.rb
|
197
|
+
- spec/spec_helper.rb
|
198
|
+
- spec/album_spec.rb
|
199
|
+
- spec/suites/all_mocked.rb
|
200
|
+
- spec/suites/all.rb
|
201
|
+
- examples/rails-example/db/seeds.rb
|
202
|
+
- examples/rails-example/config/environments/production.rb
|
203
|
+
- examples/rails-example/config/environments/test.rb
|
204
|
+
- examples/rails-example/config/environments/development.rb
|
205
|
+
- examples/rails-example/config/routes.rb
|
206
|
+
- examples/rails-example/config/boot.rb
|
207
|
+
- examples/rails-example/config/initializers/session_store.rb
|
208
|
+
- examples/rails-example/config/initializers/new_rails_defaults.rb
|
209
|
+
- examples/rails-example/config/initializers/backtrace_silencers.rb
|
210
|
+
- examples/rails-example/config/initializers/mime_types.rb
|
211
|
+
- examples/rails-example/config/initializers/inflections.rb
|
212
|
+
- examples/rails-example/config/environment.rb
|
213
|
+
- examples/rails-example/test/performance/browsing_test.rb
|
214
|
+
- examples/rails-example/test/test_helper.rb
|
215
|
+
- examples/rails-example/test/functional/albums_controller_test.rb
|
216
|
+
- examples/rails-example/test/unit/helpers/albums_helper_test.rb
|
217
|
+
- examples/rails-example/app/controllers/photos_controller.rb
|
218
|
+
- examples/rails-example/app/controllers/application_controller.rb
|
219
|
+
- examples/rails-example/app/controllers/albums_controller.rb
|
220
|
+
- examples/rails-example/app/helpers/albums_helper.rb
|
221
|
+
- examples/rails-example/app/helpers/application_helper.rb
|
222
|
+
- examples/rails-example/app/models/my_user.rb
|