sofa_gallery 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/.document +5 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +106 -0
  4. data/LICENSE +20 -0
  5. data/README.md +30 -0
  6. data/Rakefile +21 -0
  7. data/VERSION +1 -0
  8. data/app/assets/images/sofa_gallery/jcrop.gif +0 -0
  9. data/app/assets/javascripts/sofa_gallery/application.js +15 -0
  10. data/app/assets/javascripts/sofa_gallery/jquery.jcrop.js +246 -0
  11. data/app/assets/javascripts/sofa_gallery/jquery.js +18 -0
  12. data/app/assets/javascripts/sofa_gallery/jquery_ui.js +248 -0
  13. data/app/assets/javascripts/sofa_gallery/rails.js +315 -0
  14. data/app/assets/stylesheets/sofa_gallery/application.css +68 -0
  15. data/app/assets/stylesheets/sofa_gallery/jquery.jcrop.css +32 -0
  16. data/app/assets/stylesheets/sofa_gallery/reset.css +1 -0
  17. data/app/controllers/application_controller.rb +6 -0
  18. data/app/controllers/gallery_admin/base_controller.rb +3 -0
  19. data/app/controllers/gallery_admin/galleries_controller.rb +59 -0
  20. data/app/controllers/gallery_admin/photos_controller.rb +76 -0
  21. data/app/helpers/sofa_gallery_helper.rb +11 -0
  22. data/app/models/sofa/gallery.rb +17 -0
  23. data/app/models/sofa/photo.rb +64 -0
  24. data/app/views/gallery_admin/_navigation.html.erb +1 -0
  25. data/app/views/gallery_admin/galleries/_form.html.erb +11 -0
  26. data/app/views/gallery_admin/galleries/edit.html.erb +5 -0
  27. data/app/views/gallery_admin/galleries/index.html.erb +28 -0
  28. data/app/views/gallery_admin/galleries/new.html.erb +5 -0
  29. data/app/views/gallery_admin/photos/_form.html.erb +13 -0
  30. data/app/views/gallery_admin/photos/crop.html.erb +32 -0
  31. data/app/views/gallery_admin/photos/edit.html.erb +5 -0
  32. data/app/views/gallery_admin/photos/index.html.erb +24 -0
  33. data/app/views/gallery_admin/photos/new.html.erb +5 -0
  34. data/app/views/layouts/gallery_admin/application.html.erb +16 -0
  35. data/config.ru +4 -0
  36. data/config/application.rb +51 -0
  37. data/config/boot.rb +13 -0
  38. data/config/database.yml +16 -0
  39. data/config/environment.rb +5 -0
  40. data/config/environments/development.rb +25 -0
  41. data/config/environments/production.rb +52 -0
  42. data/config/environments/test.rb +39 -0
  43. data/config/initializers/paperclip.rb +3 -0
  44. data/config/initializers/sofa_gallery.rb +15 -0
  45. data/config/routes.rb +12 -0
  46. data/db/migrate/01_create_sofa_gallery.rb +35 -0
  47. data/lib/generators/README +10 -0
  48. data/lib/generators/sofa_gallery_generator.rb +33 -0
  49. data/lib/paperclip_processors/cropper.rb +18 -0
  50. data/lib/sofa_gallery.rb +23 -0
  51. data/lib/sofa_gallery/configuration.rb +26 -0
  52. data/lib/sofa_gallery/engine.rb +21 -0
  53. data/lib/sofa_gallery/form_builder.rb +50 -0
  54. data/script/rails +6 -0
  55. data/sofa_gallery.gemspec +113 -0
  56. data/test/fixtures/files/default.jpg +0 -0
  57. data/test/fixtures/files/default.txt +1 -0
  58. data/test/fixtures/sofa/galleries.yml +10 -0
  59. data/test/fixtures/sofa/photos.yml +9 -0
  60. data/test/functional/galleries_controller_test.rb +87 -0
  61. data/test/functional/photos_controller_test.rb +123 -0
  62. data/test/test_helper.rb +36 -0
  63. data/test/unit/configuration_test.rb +18 -0
  64. data/test/unit/gallery_test.rb +33 -0
  65. data/test/unit/photo_test.rb +29 -0
  66. metadata +167 -0
@@ -0,0 +1,18 @@
1
+ require File.expand_path('../test_helper', File.dirname(__FILE__))
2
+
3
+ class ConfigurationTest < ActiveSupport::TestCase
4
+
5
+ def test_configuration_presense
6
+ assert config = SofaGallery.configuration
7
+ assert_equal nil, config.upload_options
8
+ assert_equal 'admin', config.admin_route_prefix
9
+ assert_equal 'ApplicationController', config.admin_controller
10
+ assert_equal 'SofaGallery::FormBuilder', config.form_builder
11
+ end
12
+
13
+ def test_initialization_overrides
14
+ SofaGallery.configuration.admin_route_prefix = 'admin'
15
+ assert_equal 'admin', SofaGallery.configuration.admin_route_prefix
16
+ end
17
+
18
+ end
@@ -0,0 +1,33 @@
1
+ require File.expand_path('../test_helper', File.dirname(__FILE__))
2
+
3
+ class GalleryTest < ActiveSupport::TestCase
4
+
5
+ def test_fixtures_validity
6
+ Sofa::Gallery.all.each do |gallery|
7
+ assert gallery.valid?, gallery.errors.full_messages.to_s
8
+ end
9
+ end
10
+
11
+ def test_validations
12
+ gallery = Sofa::Gallery.new
13
+ assert gallery.invalid?
14
+ assert_has_errors_on gallery, [:title, :slug]
15
+ end
16
+
17
+ def test_creation
18
+ assert_difference 'Sofa::Gallery.count' do
19
+ Sofa::Gallery.create!(
20
+ :title => 'Test Gallery',
21
+ :slug => 'test-gallery'
22
+ )
23
+ end
24
+ end
25
+
26
+ def test_destoy
27
+ gallery = sofa_galleries(:default)
28
+ assert_difference ['Sofa::Gallery.count', 'Sofa::Photo.count'], -1 do
29
+ gallery.destroy
30
+ end
31
+ end
32
+
33
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../test_helper', File.dirname(__FILE__))
2
+
3
+ class PhotoTest < ActiveSupport::TestCase
4
+
5
+ def test_fixtures_validity
6
+ Sofa::Photo.all.each do |photo|
7
+ assert photo.valid?, photo.errors.full_messages.to_s
8
+ end
9
+ end
10
+
11
+ def test_validations
12
+ photo = Sofa::Photo.new
13
+ assert photo.invalid?
14
+ assert_has_errors_on photo, :image_file_name
15
+ end
16
+
17
+ def test_creation
18
+ gallery = sofa_galleries(:default)
19
+ assert_difference 'Sofa::Photo.count' do
20
+ Sofa::Photo.create!(
21
+ :gallery => gallery,
22
+ :title => 'Test Photo',
23
+ :slug => 'test-photo',
24
+ :image => fixture_file_upload('/files/default.jpg', 'image/jpeg')
25
+ )
26
+ end
27
+ end
28
+
29
+ end
metadata ADDED
@@ -0,0 +1,167 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sofa_gallery
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.0
6
+ platform: ruby
7
+ authors:
8
+ - Oleg Khabarov
9
+ - Stephen McLeod
10
+ - The Working Group Inc.
11
+ autorequire:
12
+ bindir: bin
13
+ cert_chain: []
14
+
15
+ date: 2011-06-16 00:00:00 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ name: rails
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: 3.1.0.rc4
25
+ type: :runtime
26
+ prerelease: false
27
+ version_requirements: *id001
28
+ - !ruby/object:Gem::Dependency
29
+ name: paperclip
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ type: :runtime
37
+ prerelease: false
38
+ version_requirements: *id002
39
+ - !ruby/object:Gem::Dependency
40
+ name: sqlite3
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: *id003
50
+ - !ruby/object:Gem::Dependency
51
+ name: jeweler
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ type: :development
59
+ prerelease: false
60
+ version_requirements: *id004
61
+ description: ""
62
+ email: stephen@theworkinggroup.ca
63
+ executables: []
64
+
65
+ extensions: []
66
+
67
+ extra_rdoc_files:
68
+ - LICENSE
69
+ - README.md
70
+ files:
71
+ - .document
72
+ - Gemfile
73
+ - Gemfile.lock
74
+ - LICENSE
75
+ - README.md
76
+ - Rakefile
77
+ - VERSION
78
+ - app/assets/images/sofa_gallery/jcrop.gif
79
+ - app/assets/javascripts/sofa_gallery/application.js
80
+ - app/assets/javascripts/sofa_gallery/jquery.jcrop.js
81
+ - app/assets/javascripts/sofa_gallery/jquery.js
82
+ - app/assets/javascripts/sofa_gallery/jquery_ui.js
83
+ - app/assets/javascripts/sofa_gallery/rails.js
84
+ - app/assets/stylesheets/sofa_gallery/application.css
85
+ - app/assets/stylesheets/sofa_gallery/jquery.jcrop.css
86
+ - app/assets/stylesheets/sofa_gallery/reset.css
87
+ - app/controllers/application_controller.rb
88
+ - app/controllers/gallery_admin/base_controller.rb
89
+ - app/controllers/gallery_admin/galleries_controller.rb
90
+ - app/controllers/gallery_admin/photos_controller.rb
91
+ - app/helpers/sofa_gallery_helper.rb
92
+ - app/models/sofa/gallery.rb
93
+ - app/models/sofa/photo.rb
94
+ - app/views/gallery_admin/_navigation.html.erb
95
+ - app/views/gallery_admin/galleries/_form.html.erb
96
+ - app/views/gallery_admin/galleries/edit.html.erb
97
+ - app/views/gallery_admin/galleries/index.html.erb
98
+ - app/views/gallery_admin/galleries/new.html.erb
99
+ - app/views/gallery_admin/photos/_form.html.erb
100
+ - app/views/gallery_admin/photos/crop.html.erb
101
+ - app/views/gallery_admin/photos/edit.html.erb
102
+ - app/views/gallery_admin/photos/index.html.erb
103
+ - app/views/gallery_admin/photos/new.html.erb
104
+ - app/views/layouts/gallery_admin/application.html.erb
105
+ - config.ru
106
+ - config/application.rb
107
+ - config/boot.rb
108
+ - config/database.yml
109
+ - config/environment.rb
110
+ - config/environments/development.rb
111
+ - config/environments/production.rb
112
+ - config/environments/test.rb
113
+ - config/initializers/paperclip.rb
114
+ - config/initializers/sofa_gallery.rb
115
+ - config/routes.rb
116
+ - db/migrate/01_create_sofa_gallery.rb
117
+ - lib/generators/README
118
+ - lib/generators/sofa_gallery_generator.rb
119
+ - lib/paperclip_processors/cropper.rb
120
+ - lib/sofa_gallery.rb
121
+ - lib/sofa_gallery/configuration.rb
122
+ - lib/sofa_gallery/engine.rb
123
+ - lib/sofa_gallery/form_builder.rb
124
+ - script/rails
125
+ - sofa_gallery.gemspec
126
+ - test/fixtures/files/default.jpg
127
+ - test/fixtures/files/default.txt
128
+ - test/fixtures/sofa/galleries.yml
129
+ - test/fixtures/sofa/photos.yml
130
+ - test/functional/galleries_controller_test.rb
131
+ - test/functional/photos_controller_test.rb
132
+ - test/test_helper.rb
133
+ - test/unit/configuration_test.rb
134
+ - test/unit/gallery_test.rb
135
+ - test/unit/photo_test.rb
136
+ homepage: http://github.com/twg/sofa-gallery
137
+ licenses:
138
+ - MIT
139
+ post_install_message:
140
+ rdoc_options: []
141
+
142
+ require_paths:
143
+ - lib
144
+ required_ruby_version: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ hash: 982299135969207028
150
+ segments:
151
+ - 0
152
+ version: "0"
153
+ required_rubygems_version: !ruby/object:Gem::Requirement
154
+ none: false
155
+ requirements:
156
+ - - ">="
157
+ - !ruby/object:Gem::Version
158
+ version: "0"
159
+ requirements: []
160
+
161
+ rubyforge_project:
162
+ rubygems_version: 1.7.2
163
+ signing_key:
164
+ specification_version: 3
165
+ summary: SofaGallery is an image gallery engine for Rails 3.1 apps (and ComfortableMexicanSofa)
166
+ test_files: []
167
+