tb_photos 1.0.3 → 1.0.4
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.
- checksums.yaml +6 -14
- data/app/assets/javascripts/admin/photos/photos.js +3 -0
- data/app/assets/stylesheets/admin/photos/application.css.scss +2 -0
- data/app/controllers/admin/photo_albums_controller.rb +9 -6
- data/app/controllers/admin/photo_galleries_controller.rb +9 -4
- data/app/controllers/admin/photos_controller.rb +8 -5
- data/app/controllers/photo_albums_controller.rb +0 -6
- data/app/controllers/photo_galleries_controller.rb +1 -7
- data/app/models/spud_photo.rb +0 -2
- data/app/models/spud_photo_album.rb +4 -6
- data/app/models/spud_photo_albums_photo.rb +2 -3
- data/app/models/spud_photo_galleries_album.rb +2 -3
- data/app/models/spud_photo_gallery.rb +1 -3
- data/app/views/admin/photo_albums/_album.html.erb +1 -1
- data/app/views/photo_albums/index.html.erb +13 -13
- data/app/views/photo_albums/show.html.erb +13 -17
- data/app/views/photo_galleries/index.html.erb +13 -11
- data/config/routes.rb +1 -1
- data/lib/spud_photos/configuration.rb +1 -1
- data/lib/spud_photos/engine.rb +0 -1
- data/lib/spud_photos/version.rb +1 -1
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +57 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +15 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +36 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +8 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/spec_helper.rb +40 -0
- metadata +91 -34
- data/app/models/spud_photo_sweeper.rb +0 -39
@@ -0,0 +1,26 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/422.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
|
+
</div>
|
25
|
+
</body>
|
26
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Track code coverage
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start 'rails' do
|
4
|
+
# root "dummy/"
|
5
|
+
add_filter "/factories/"
|
6
|
+
end
|
7
|
+
|
8
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
9
|
+
ENV["RAILS_ENV"] = 'test'
|
10
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
11
|
+
require 'rspec/rails'
|
12
|
+
require 'rspec/autorun'
|
13
|
+
require 'database_cleaner'
|
14
|
+
require 'shoulda'
|
15
|
+
require 'factory_girl'
|
16
|
+
require 'mocha'
|
17
|
+
|
18
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
19
|
+
# in spec/support/ and its subdirectories.
|
20
|
+
ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
|
21
|
+
Dir[File.join(ENGINE_RAILS_ROOT,"spec/support/**/*.rb"), File.join(ENGINE_RAILS_ROOT,"factories/*")].each {|f| require f}
|
22
|
+
|
23
|
+
RSpec.configure do |config|
|
24
|
+
config.mock_with :mocha
|
25
|
+
config.use_transactional_fixtures = true
|
26
|
+
config.infer_base_class_for_anonymous_controllers = false
|
27
|
+
|
28
|
+
config.before(:suite) do
|
29
|
+
DatabaseCleaner.strategy = :transaction
|
30
|
+
DatabaseCleaner.clean_with(:truncation)
|
31
|
+
end
|
32
|
+
|
33
|
+
config.before(:each) do
|
34
|
+
DatabaseCleaner.start
|
35
|
+
end
|
36
|
+
|
37
|
+
config.after(:each) do
|
38
|
+
DatabaseCleaner.clean
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,71 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_photos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Woods
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tb_core
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: paperclip
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mysql2
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,30 +98,30 @@ dependencies:
|
|
98
98
|
name: shoulda
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: 3.0.1
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 3.0.1
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: factory_girl
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
117
|
+
version: '3.0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
124
|
+
version: '3.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: mocha
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,26 +142,26 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 1.0.0.RC1
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 1.0.0.RC1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: simplecov
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - ~>
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: 0.6.4
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - ~>
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: 0.6.4
|
167
167
|
description: Twice Baked is a feature complete photo management/gallery for the spud
|
@@ -173,6 +173,9 @@ executables: []
|
|
173
173
|
extensions: []
|
174
174
|
extra_rdoc_files: []
|
175
175
|
files:
|
176
|
+
- MIT-LICENSE
|
177
|
+
- README.markdown
|
178
|
+
- Rakefile
|
176
179
|
- app/assets/images/admin/photos/buttons/cog_16x16.png
|
177
180
|
- app/assets/images/admin/photos/buttons/x_16x16.png
|
178
181
|
- app/assets/images/admin/photos/photo_albums_thumb.png
|
@@ -195,7 +198,6 @@ files:
|
|
195
198
|
- app/models/spud_photo_albums_photo.rb
|
196
199
|
- app/models/spud_photo_galleries_album.rb
|
197
200
|
- app/models/spud_photo_gallery.rb
|
198
|
-
- app/models/spud_photo_sweeper.rb
|
199
201
|
- app/views/admin/photo_albums/_album.html.erb
|
200
202
|
- app/views/admin/photo_albums/_form.html.erb
|
201
203
|
- app/views/admin/photo_albums/destroy.js.erb
|
@@ -230,9 +232,35 @@ files:
|
|
230
232
|
- lib/spud_photos/version.rb
|
231
233
|
- lib/tasks/spud_photos_tasks.rake
|
232
234
|
- lib/tb_photos.rb
|
233
|
-
-
|
234
|
-
- Rakefile
|
235
|
-
-
|
235
|
+
- spec/dummy/README.rdoc
|
236
|
+
- spec/dummy/Rakefile
|
237
|
+
- spec/dummy/app/assets/javascripts/application.js
|
238
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
239
|
+
- spec/dummy/app/controllers/application_controller.rb
|
240
|
+
- spec/dummy/app/helpers/application_helper.rb
|
241
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
242
|
+
- spec/dummy/config.ru
|
243
|
+
- spec/dummy/config/application.rb
|
244
|
+
- spec/dummy/config/boot.rb
|
245
|
+
- spec/dummy/config/database.yml
|
246
|
+
- spec/dummy/config/environment.rb
|
247
|
+
- spec/dummy/config/environments/development.rb
|
248
|
+
- spec/dummy/config/environments/production.rb
|
249
|
+
- spec/dummy/config/environments/test.rb
|
250
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
251
|
+
- spec/dummy/config/initializers/inflections.rb
|
252
|
+
- spec/dummy/config/initializers/mime_types.rb
|
253
|
+
- spec/dummy/config/initializers/secret_token.rb
|
254
|
+
- spec/dummy/config/initializers/session_store.rb
|
255
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
256
|
+
- spec/dummy/config/locales/en.yml
|
257
|
+
- spec/dummy/config/routes.rb
|
258
|
+
- spec/dummy/public/404.html
|
259
|
+
- spec/dummy/public/422.html
|
260
|
+
- spec/dummy/public/500.html
|
261
|
+
- spec/dummy/public/favicon.ico
|
262
|
+
- spec/dummy/script/rails
|
263
|
+
- spec/spec_helper.rb
|
236
264
|
homepage: http://bitbucket.org/westlakedesign/tb_photos
|
237
265
|
licenses: []
|
238
266
|
metadata: {}
|
@@ -242,18 +270,47 @@ require_paths:
|
|
242
270
|
- lib
|
243
271
|
required_ruby_version: !ruby/object:Gem::Requirement
|
244
272
|
requirements:
|
245
|
-
- -
|
273
|
+
- - ">="
|
246
274
|
- !ruby/object:Gem::Version
|
247
275
|
version: '0'
|
248
276
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
249
277
|
requirements:
|
250
|
-
- -
|
278
|
+
- - ">="
|
251
279
|
- !ruby/object:Gem::Version
|
252
280
|
version: '0'
|
253
281
|
requirements: []
|
254
282
|
rubyforge_project:
|
255
|
-
rubygems_version: 2.
|
283
|
+
rubygems_version: 2.2.1
|
256
284
|
signing_key:
|
257
285
|
specification_version: 4
|
258
286
|
summary: Twice Baked Engine
|
259
|
-
test_files:
|
287
|
+
test_files:
|
288
|
+
- spec/dummy/app/assets/javascripts/application.js
|
289
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
290
|
+
- spec/dummy/app/controllers/application_controller.rb
|
291
|
+
- spec/dummy/app/helpers/application_helper.rb
|
292
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
293
|
+
- spec/dummy/config/application.rb
|
294
|
+
- spec/dummy/config/boot.rb
|
295
|
+
- spec/dummy/config/database.yml
|
296
|
+
- spec/dummy/config/environment.rb
|
297
|
+
- spec/dummy/config/environments/development.rb
|
298
|
+
- spec/dummy/config/environments/production.rb
|
299
|
+
- spec/dummy/config/environments/test.rb
|
300
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
301
|
+
- spec/dummy/config/initializers/inflections.rb
|
302
|
+
- spec/dummy/config/initializers/mime_types.rb
|
303
|
+
- spec/dummy/config/initializers/secret_token.rb
|
304
|
+
- spec/dummy/config/initializers/session_store.rb
|
305
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
306
|
+
- spec/dummy/config/locales/en.yml
|
307
|
+
- spec/dummy/config/routes.rb
|
308
|
+
- spec/dummy/config.ru
|
309
|
+
- spec/dummy/public/404.html
|
310
|
+
- spec/dummy/public/422.html
|
311
|
+
- spec/dummy/public/500.html
|
312
|
+
- spec/dummy/public/favicon.ico
|
313
|
+
- spec/dummy/Rakefile
|
314
|
+
- spec/dummy/README.rdoc
|
315
|
+
- spec/dummy/script/rails
|
316
|
+
- spec/spec_helper.rb
|
@@ -1,39 +0,0 @@
|
|
1
|
-
class SpudPhotoSweeper < ActionController::Caching::Sweeper
|
2
|
-
|
3
|
-
observe :spud_photo, :spud_photo_album, :spud_photo_gallery
|
4
|
-
|
5
|
-
def after_create(record)
|
6
|
-
expire_cache_for(record)
|
7
|
-
end
|
8
|
-
|
9
|
-
def before_update(record)
|
10
|
-
expire_cache_for(record)
|
11
|
-
end
|
12
|
-
|
13
|
-
def after_destroy(record)
|
14
|
-
expire_cache_for(record)
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def expire_cache_for(record)
|
20
|
-
if Spud::Photos.config.enable_full_page_caching
|
21
|
-
cache_path = File.join(ActionController::Base.page_cache_directory, Spud::Photos.config.base_path)
|
22
|
-
if File.directory?(cache_path)
|
23
|
-
FileUtils.rm_rf(cache_path)
|
24
|
-
end
|
25
|
-
if Spud::Photos.config.galleries_enabled
|
26
|
-
expire_page photo_galleries_path
|
27
|
-
else
|
28
|
-
expire_page photo_albums_path
|
29
|
-
end
|
30
|
-
|
31
|
-
if !Spud::Photos.config.page_caches_to_sweep.blank?
|
32
|
-
Spud::Photos.config.page_caches_to_sweep.each do |route|
|
33
|
-
expire_page(route)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|