media_magick 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.gitignore +2 -1
  2. data/.travis.yml +7 -3
  3. data/CHANGELOG.md +92 -1
  4. data/README.md +1 -1
  5. data/app/assets/javascripts/media_magick/plupload_it.js +30 -9
  6. data/app/controllers/media_magick/attach_controller.rb +16 -28
  7. data/app/helpers/media_magick/application_helper.rb +46 -5
  8. data/app/views/_file.html.erb +2 -2
  9. data/app/views/_image.html.erb +3 -3
  10. data/app/views/_upload.html.erb +3 -10
  11. data/app/views/_video.html.erb +8 -0
  12. data/gemfiles/mongoid-3.0.gemfile +7 -0
  13. data/lib/media_magick.rb +1 -5
  14. data/lib/media_magick/controller/helpers.rb +20 -0
  15. data/lib/media_magick/engine.rb +1 -1
  16. data/lib/media_magick/model.rb +41 -48
  17. data/lib/media_magick/version.rb +1 -1
  18. data/lib/media_magick/video/parser.rb +62 -0
  19. data/media_magick.gemspec +8 -4
  20. data/spec/controllers/media_magick/attach_controller_spec.rb +12 -11
  21. data/spec/dummy/app/assets/javascripts/application.js +5 -0
  22. data/spec/dummy/app/assets/javascripts/posts.js +2 -0
  23. data/spec/dummy/app/assets/stylesheets/posts.css +4 -0
  24. data/spec/dummy/app/controllers/posts_controller.rb +83 -0
  25. data/spec/dummy/app/helpers/posts_helper.rb +2 -0
  26. data/spec/dummy/app/models/album.rb +3 -1
  27. data/spec/dummy/app/models/post.rb +10 -0
  28. data/spec/dummy/app/models/track.rb +1 -0
  29. data/spec/dummy/app/uploaders/post_uploader.rb +17 -0
  30. data/spec/dummy/app/views/posts/_form.html.erb +47 -0
  31. data/spec/dummy/app/views/posts/edit.html.erb +6 -0
  32. data/spec/dummy/app/views/posts/index.html.erb +25 -0
  33. data/spec/dummy/app/views/posts/new.html.erb +5 -0
  34. data/spec/dummy/app/views/posts/show.html.erb +15 -0
  35. data/spec/dummy/app/views/users/index.html.erb +1 -1
  36. data/spec/dummy/config/mongoid.yml +65 -17
  37. data/spec/dummy/config/routes.rb +3 -0
  38. data/spec/helpers/media_magick/application_helper_spec.rb +90 -27
  39. data/spec/integration/images_spec.rb +1 -1
  40. data/spec/lib/media_magick/controller/helper_spec.rb +37 -0
  41. data/spec/lib/media_magick/model_spec.rb +41 -9
  42. data/spec/lib/media_magick/video/parser_spec.rb +67 -0
  43. data/spec/spec_helper.rb +11 -8
  44. data/spec/views/_upload.html.erb_spec.rb +26 -0
  45. metadata +76 -21
  46. data/.rvmrc +0 -1
  47. data/spec/dummy/app/helpers/users_helper.rb +0 -2
data/spec/spec_helper.rb CHANGED
@@ -24,17 +24,20 @@ RSpec.configure do |config|
24
24
  config.infer_base_class_for_anonymous_controllers = false
25
25
 
26
26
  config.before :suite do
27
- Mongoid.configure do |config|
28
- config.master = Mongo::Connection.new.db('media_magick')
27
+ if Mongoid::VERSION < '3'
28
+ Mongoid.configure do |config|
29
+ config.master = Mongo::Connection.new.db('media_magick')
30
+ end
31
+ else
32
+ Mongoid.connect_to('media_magick')
29
33
  end
30
34
  end
31
35
 
32
36
  config.after :each do
33
- Mongoid.master.collections.select { |c| c.name !~ /^system/ }.each(&:drop)
34
- end
35
-
36
- config.after :suite do
37
- Mongoid.master.connection.drop_database('media_magick')
38
- Mongoid.master.connection.close
37
+ if Mongoid::VERSION < '3'
38
+ Mongoid.master.collections.select { |c| c.name !~ /^system/ }.each(&:drop)
39
+ else
40
+ Mongoid::Config.purge!
41
+ end
39
42
  end
40
43
  end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe '_upload' do
4
+ let(:album) { stub_model(Album) }
5
+ let(:album_with_photos) { stub_model(Album, photos: [stub_model(AlbumPhotos)]) }
6
+
7
+ def default_attributes
8
+ { newAttachments: {}, loadedAttachments: {}, partial: '/image', model: album, relations: 'photos' }
9
+ end
10
+
11
+ it 'should personalize css classes attributes of newAttachments element' do
12
+ render 'upload', default_attributes.merge(newAttachments: { class: 'thumbnails' })
13
+ rendered.should =~ /<div class="newAttachments thumbnails">/
14
+ end
15
+
16
+ it 'should personalize css classes attributes of loadedAttachments element' do
17
+ render 'upload', default_attributes.merge(loadedAttachments: { class: 'span3' })
18
+ rendered.should =~ /<ul class="loadedAttachments span3">/
19
+ end
20
+
21
+ it 'should render the partial passed' do
22
+ stub_template 'albums/_photo' => 'my partial'
23
+ render 'upload', default_attributes.merge(model: album_with_photos, partial: 'albums/photo')
24
+ rendered.should =~ /my partial/
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: media_magick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-06-12 00:00:00.000000000 Z
14
+ date: 2012-10-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: carrierwave
@@ -34,17 +34,17 @@ dependencies:
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  none: false
36
36
  requirements:
37
- - - ~>
37
+ - - ! '>='
38
38
  - !ruby/object:Gem::Version
39
- version: 2.4.0
39
+ version: '2.4'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
45
- - - ~>
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.4.0
47
+ version: '2.4'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: plupload-rails
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -84,7 +84,7 @@ dependencies:
84
84
  requirements:
85
85
  - - ~>
86
86
  - !ruby/object:Gem::Version
87
- version: 1.6.0
87
+ version: 1.7.0
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
@@ -92,7 +92,7 @@ dependencies:
92
92
  requirements:
93
93
  - - ~>
94
94
  - !ruby/object:Gem::Version
95
- version: 1.6.0
95
+ version: 1.7.0
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: mini_magick
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +132,7 @@ dependencies:
132
132
  requirements:
133
133
  - - ~>
134
134
  - !ruby/object:Gem::Version
135
- version: 2.10.1
135
+ version: 2.11.0
136
136
  type: :development
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
@@ -140,7 +140,7 @@ dependencies:
140
140
  requirements:
141
141
  - - ~>
142
142
  - !ruby/object:Gem::Version
143
- version: 2.10.1
143
+ version: 2.11.0
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: simplecov
146
146
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +148,39 @@ dependencies:
148
148
  requirements:
149
149
  - - ~>
150
150
  - !ruby/object:Gem::Version
151
- version: 0.6.1
151
+ version: 0.7.0
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ none: false
156
+ requirements:
157
+ - - ~>
158
+ - !ruby/object:Gem::Version
159
+ version: 0.7.0
160
+ - !ruby/object:Gem::Dependency
161
+ name: flog
162
+ requirement: !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - ~>
166
+ - !ruby/object:Gem::Version
167
+ version: 3.0.0.b2
168
+ type: :development
169
+ prerelease: false
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ~>
174
+ - !ruby/object:Gem::Version
175
+ version: 3.0.0.b2
176
+ - !ruby/object:Gem::Dependency
177
+ name: flay
178
+ requirement: !ruby/object:Gem::Requirement
179
+ none: false
180
+ requirements:
181
+ - - ~>
182
+ - !ruby/object:Gem::Version
183
+ version: 2.0.0.b1
152
184
  type: :development
153
185
  prerelease: false
154
186
  version_requirements: !ruby/object:Gem::Requirement
@@ -156,7 +188,7 @@ dependencies:
156
188
  requirements:
157
189
  - - ~>
158
190
  - !ruby/object:Gem::Version
159
- version: 0.6.1
191
+ version: 2.0.0.b1
160
192
  description: MediaMagick aims to make dealing with multimedia resources a very easy
161
193
  task – like magic.
162
194
  email:
@@ -169,7 +201,6 @@ extra_rdoc_files: []
169
201
  files:
170
202
  - .gitignore
171
203
  - .rspec
172
- - .rvmrc
173
204
  - .travis.yml
174
205
  - CHANGELOG.md
175
206
  - Gemfile
@@ -187,16 +218,20 @@ files:
187
218
  - app/views/_file.html.erb
188
219
  - app/views/_image.html.erb
189
220
  - app/views/_upload.html.erb
221
+ - app/views/_video.html.erb
190
222
  - app/views/layouts/media_magick/application.html.erb
191
223
  - config/locales/en.yml
192
224
  - config/locales/pt-BR.yml
193
225
  - config/routes.rb
226
+ - gemfiles/mongoid-3.0.gemfile
194
227
  - lib/carrierwave/mongoid.rb
195
228
  - lib/media_magick.rb
196
229
  - lib/media_magick/attachment_uploader.rb
230
+ - lib/media_magick/controller/helpers.rb
197
231
  - lib/media_magick/engine.rb
198
232
  - lib/media_magick/model.rb
199
233
  - lib/media_magick/version.rb
234
+ - lib/media_magick/video/parser.rb
200
235
  - lib/tasks/media_magick_tasks.rake
201
236
  - media_magick.gemspec
202
237
  - script/rails
@@ -204,22 +239,32 @@ files:
204
239
  - spec/dummy/README.rdoc
205
240
  - spec/dummy/Rakefile
206
241
  - spec/dummy/app/assets/javascripts/application.js
242
+ - spec/dummy/app/assets/javascripts/posts.js
207
243
  - spec/dummy/app/assets/javascripts/users.js
208
244
  - spec/dummy/app/assets/stylesheets/application.css
245
+ - spec/dummy/app/assets/stylesheets/posts.css
209
246
  - spec/dummy/app/assets/stylesheets/scaffold.css
210
247
  - spec/dummy/app/assets/stylesheets/users.css
211
248
  - spec/dummy/app/controllers/application_controller.rb
249
+ - spec/dummy/app/controllers/posts_controller.rb
212
250
  - spec/dummy/app/controllers/users_controller.rb
213
251
  - spec/dummy/app/helpers/application_helper.rb
214
- - spec/dummy/app/helpers/users_helper.rb
252
+ - spec/dummy/app/helpers/posts_helper.rb
215
253
  - spec/dummy/app/mailers/.gitkeep
216
254
  - spec/dummy/app/models/album.rb
255
+ - spec/dummy/app/models/post.rb
217
256
  - spec/dummy/app/models/product.rb
218
257
  - spec/dummy/app/models/track.rb
219
258
  - spec/dummy/app/models/user.rb
220
259
  - spec/dummy/app/uploaders/picture_uploader.rb
260
+ - spec/dummy/app/uploaders/post_uploader.rb
221
261
  - spec/dummy/app/views/albums/_photo.html.erb
222
262
  - spec/dummy/app/views/layouts/application.html.erb
263
+ - spec/dummy/app/views/posts/_form.html.erb
264
+ - spec/dummy/app/views/posts/edit.html.erb
265
+ - spec/dummy/app/views/posts/index.html.erb
266
+ - spec/dummy/app/views/posts/new.html.erb
267
+ - spec/dummy/app/views/posts/show.html.erb
223
268
  - spec/dummy/app/views/users/_form.html.erb
224
269
  - spec/dummy/app/views/users/edit.html.erb
225
270
  - spec/dummy/app/views/users/index.html.erb
@@ -250,11 +295,14 @@ files:
250
295
  - spec/dummy/script/rails
251
296
  - spec/helpers/media_magick/application_helper_spec.rb
252
297
  - spec/integration/images_spec.rb
298
+ - spec/lib/media_magick/controller/helper_spec.rb
253
299
  - spec/lib/media_magick/model_spec.rb
300
+ - spec/lib/media_magick/video/parser_spec.rb
254
301
  - spec/routing/attach_spec.rb
255
302
  - spec/spec_helper.rb
256
303
  - spec/support/fixtures/nu.jpg
257
304
  - spec/support/fixtures/nu.txt
305
+ - spec/views/_upload.html.erb_spec.rb
258
306
  homepage: https://github.com/nudesign/media_magick
259
307
  licenses: []
260
308
  post_install_message:
@@ -267,18 +315,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
267
315
  - - ! '>='
268
316
  - !ruby/object:Gem::Version
269
317
  version: '0'
270
- segments:
271
- - 0
272
- hash: -141377081064224492
273
318
  required_rubygems_version: !ruby/object:Gem::Requirement
274
319
  none: false
275
320
  requirements:
276
321
  - - ! '>='
277
322
  - !ruby/object:Gem::Version
278
323
  version: '0'
279
- segments:
280
- - 0
281
- hash: -141377081064224492
282
324
  requirements: []
283
325
  rubyforge_project:
284
326
  rubygems_version: 1.8.24
@@ -292,22 +334,32 @@ test_files:
292
334
  - spec/dummy/README.rdoc
293
335
  - spec/dummy/Rakefile
294
336
  - spec/dummy/app/assets/javascripts/application.js
337
+ - spec/dummy/app/assets/javascripts/posts.js
295
338
  - spec/dummy/app/assets/javascripts/users.js
296
339
  - spec/dummy/app/assets/stylesheets/application.css
340
+ - spec/dummy/app/assets/stylesheets/posts.css
297
341
  - spec/dummy/app/assets/stylesheets/scaffold.css
298
342
  - spec/dummy/app/assets/stylesheets/users.css
299
343
  - spec/dummy/app/controllers/application_controller.rb
344
+ - spec/dummy/app/controllers/posts_controller.rb
300
345
  - spec/dummy/app/controllers/users_controller.rb
301
346
  - spec/dummy/app/helpers/application_helper.rb
302
- - spec/dummy/app/helpers/users_helper.rb
347
+ - spec/dummy/app/helpers/posts_helper.rb
303
348
  - spec/dummy/app/mailers/.gitkeep
304
349
  - spec/dummy/app/models/album.rb
350
+ - spec/dummy/app/models/post.rb
305
351
  - spec/dummy/app/models/product.rb
306
352
  - spec/dummy/app/models/track.rb
307
353
  - spec/dummy/app/models/user.rb
308
354
  - spec/dummy/app/uploaders/picture_uploader.rb
355
+ - spec/dummy/app/uploaders/post_uploader.rb
309
356
  - spec/dummy/app/views/albums/_photo.html.erb
310
357
  - spec/dummy/app/views/layouts/application.html.erb
358
+ - spec/dummy/app/views/posts/_form.html.erb
359
+ - spec/dummy/app/views/posts/edit.html.erb
360
+ - spec/dummy/app/views/posts/index.html.erb
361
+ - spec/dummy/app/views/posts/new.html.erb
362
+ - spec/dummy/app/views/posts/show.html.erb
311
363
  - spec/dummy/app/views/users/_form.html.erb
312
364
  - spec/dummy/app/views/users/edit.html.erb
313
365
  - spec/dummy/app/views/users/index.html.erb
@@ -338,8 +390,11 @@ test_files:
338
390
  - spec/dummy/script/rails
339
391
  - spec/helpers/media_magick/application_helper_spec.rb
340
392
  - spec/integration/images_spec.rb
393
+ - spec/lib/media_magick/controller/helper_spec.rb
341
394
  - spec/lib/media_magick/model_spec.rb
395
+ - spec/lib/media_magick/video/parser_spec.rb
342
396
  - spec/routing/attach_spec.rb
343
397
  - spec/spec_helper.rb
344
398
  - spec/support/fixtures/nu.jpg
345
399
  - spec/support/fixtures/nu.txt
400
+ - spec/views/_upload.html.erb_spec.rb
data/.rvmrc DELETED
@@ -1 +0,0 @@
1
- rvm use 1.9.3@media_magick --create
@@ -1,2 +0,0 @@
1
- module UsersHelper
2
- end