media_magick 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/.rvmrc +1 -0
  2. data/CHANGELOG.md +49 -0
  3. data/README.md +77 -6
  4. data/app/assets/javascripts/media_magick/plupload_it.js +8 -2
  5. data/app/controllers/media_magick/attach_controller.rb +40 -7
  6. data/app/helpers/media_magick/application_helper.rb +20 -3
  7. data/app/views/_file.html.erb +2 -0
  8. data/app/views/_image.html.erb +2 -0
  9. data/app/views/_upload.html.erb +5 -3
  10. data/lib/media_magick/model.rb +60 -3
  11. data/lib/media_magick/version.rb +1 -1
  12. data/media_magick.gemspec +2 -2
  13. data/spec/controllers/media_magick/attach_controller_spec.rb +65 -0
  14. data/spec/dummy/app/assets/javascripts/users.js +2 -0
  15. data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
  16. data/spec/dummy/app/assets/stylesheets/users.css +4 -0
  17. data/spec/dummy/app/controllers/users_controller.rb +84 -0
  18. data/spec/dummy/app/helpers/users_helper.rb +2 -0
  19. data/spec/dummy/app/models/album.rb +7 -5
  20. data/spec/dummy/app/models/product.rb +2 -2
  21. data/spec/dummy/app/models/track.rb +8 -0
  22. data/spec/dummy/app/models/user.rb +10 -0
  23. data/spec/dummy/app/views/albums/_photo.html.erb +1 -0
  24. data/spec/dummy/app/views/layouts/application.html.erb +1 -1
  25. data/spec/dummy/app/views/users/_form.html.erb +29 -0
  26. data/spec/dummy/app/views/users/edit.html.erb +6 -0
  27. data/spec/dummy/app/views/users/index.html.erb +23 -0
  28. data/spec/dummy/app/views/users/new.html.erb +5 -0
  29. data/spec/dummy/app/views/users/show.html.erb +15 -0
  30. data/spec/dummy/config/routes.rb +2 -0
  31. data/spec/helpers/media_magick/application_helper_spec.rb +19 -0
  32. data/spec/integration/images_spec.rb +64 -28
  33. data/spec/lib/media_magick/model_spec.rb +65 -10
  34. metadata +36 -10
  35. data/spec/dummy/app/models/.gitkeep +0 -0
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use 1.9.3@media_magick --create
data/CHANGELOG.md ADDED
@@ -0,0 +1,49 @@
1
+ ## 0.1.0 - June 11, 2012
2
+
3
+ ### Improvements
4
+
5
+ * Implementation of `attaches_one`
6
+
7
+ ``` ruby
8
+ class Album
9
+ include Mongoid::Document
10
+ include MediaMagick::Model
11
+
12
+ attaches_one :photo
13
+ end
14
+
15
+ album = Album.create
16
+ album.photo.create(photo: params[:file])
17
+ album.reload.photo.url
18
+ album.reload.photo.filename
19
+ ```
20
+
21
+ * `attachment_container` can personalize the partial
22
+
23
+ ``` erb
24
+ <%= attachment_container @album, :photos, {}, {}, partial: 'albums/photo' %>
25
+ ```
26
+
27
+ * Allows to create an image without a father in related relations
28
+
29
+ ``` ruby
30
+ class Album
31
+ include Mongoid::Document
32
+ include MediaMagick::Model
33
+
34
+ attaches_many :photos, :relation => :referenced
35
+ end
36
+
37
+ album = Album.new
38
+ photo = album.photos.create(photo: params[:file])
39
+ ```
40
+
41
+ * Allow the `attachs_many` to be used in embedded documents
42
+
43
+ ### Deprecations
44
+
45
+ * `MediaMagick::Model#attachs_many` is deprecated in favor of `attaches_many`.
46
+
47
+ ## 0.0.1 - April 11, 2012
48
+
49
+ Initial release.
data/README.md CHANGED
@@ -12,11 +12,42 @@ And then execute:
12
12
 
13
13
  $ bundle
14
14
 
15
- Or install it yourself as:
15
+ ## Getting Started
16
16
 
17
- $ gem install media_magick
17
+ ### Model
18
18
 
19
- ## Usage
19
+ ``` ruby
20
+ class Album
21
+ include Mongoid::Document
22
+ include MediaMagick::Model
23
+
24
+ attachs_many :photos
25
+ end
26
+ ```
27
+
28
+ ### Controller
29
+
30
+ ``` ruby
31
+ def new
32
+ @album = Album.new
33
+ end
34
+ ```
35
+
36
+ ### View
37
+
38
+ ``` erb
39
+ <%= attachment_container @album, :files %>
40
+ ```
41
+
42
+ ### Javascript
43
+
44
+ ``` javascript
45
+ $(document).ready(function () {
46
+ $(".attachmentUploader").pluploadIt();
47
+ });
48
+ ```
49
+
50
+ ## Configuring
20
51
 
21
52
  ### Model
22
53
 
@@ -25,7 +56,7 @@ class Album
25
56
  include Mongoid::Document
26
57
  include MediaMagick::Model
27
58
 
28
- attachs_many :photos, type: 'image'
59
+ attaches_many :photos, type: 'image'
29
60
  end
30
61
 
31
62
  album = Album.create
@@ -34,6 +65,22 @@ album.reload.photos.first.url
34
65
  album.reload.photos.first.filename
35
66
  ```
36
67
 
68
+ #### attaches One
69
+
70
+ ``` ruby
71
+ class Album
72
+ include Mongoid::Document
73
+ include MediaMagick::Model
74
+
75
+ attaches_one :photo, type: 'image'
76
+ end
77
+
78
+ album = Album.create
79
+ album.photo.create(photo: params[:file])
80
+ album.reload.photo.url
81
+ album.reload.photo.filename
82
+ ```
83
+
37
84
  #### Custom classes
38
85
 
39
86
  ``` ruby
@@ -41,7 +88,7 @@ class Album
41
88
  include Mongoid::Document
42
89
  include MediaMagick::Model
43
90
 
44
- attachs_many :photos, type: 'image' do
91
+ attaches_many :photos, type: 'image' do
45
92
  field :tags, type: Array
46
93
  end
47
94
  end
@@ -53,6 +100,8 @@ album.reload.photos.first.tags #=> ['ruby', 'guru']
53
100
 
54
101
  #### Custom uploader
55
102
 
103
+ You also need to add `mini_magick` to your **Gemfile** in order to use it for thumbnail generation.
104
+
56
105
  ``` ruby
57
106
  class PhotoUploader < CarrierWave::Uploader::Base
58
107
  include CarrierWave::MiniMagick
@@ -74,7 +123,7 @@ class Album
74
123
  include Mongoid::Document
75
124
  include MediaMagick::Model
76
125
 
77
- attachs_many :photos, type: 'image', uploader: PhotoUploader
126
+ attaches_many :photos, type: 'image', uploader: PhotoUploader
78
127
  end
79
128
 
80
129
  album = Album.create
@@ -82,6 +131,28 @@ album.photos.create(photo: params[:file])
82
131
  album.reload.photos.first.thumb.url
83
132
  ```
84
133
 
134
+ ### Form View
135
+
136
+ ``` erb
137
+ <%= attachment_container @album, :files %>
138
+
139
+ <%= attachment_container @album, :files, newAttachments: { class: 'thumbnails' }, loadedAttachments: { class: 'span3' } %>
140
+ ```
141
+
142
+ or use a custom layout:
143
+
144
+ ``` html
145
+ <%= attachment_container @album, :photos do %>
146
+
147
+ <a class="pickAttachments btn" href="javascript://">select files</a>
148
+ <a class="uploadAttachments btn" href="javascript://">upload files</a>
149
+
150
+ <ul class="loadedAttachments">
151
+ <%= render :partial => 'photos', :collection => @album.photos, :as => 'photo' %>
152
+ </ul>
153
+ <% end %>
154
+ ```
155
+
85
156
  ## Contributing
86
157
 
87
158
  1. Fork it
@@ -56,7 +56,10 @@
56
56
  multipart_params: {
57
57
  id: $container.data('id'),
58
58
  relation: $container.data('relation'),
59
- model: $container.data('model')
59
+ model: $container.data('model'),
60
+ partial: $container.data('partial'),
61
+ embedded_in_model: $container.data('embedded-in-model'),
62
+ embedded_in_id: $container.data('embedded-in-id')
60
63
  },
61
64
  resize: settings.resize,
62
65
  runtimes: settings.runtimes,
@@ -72,12 +75,15 @@
72
75
  $("a.remove").live('click', function() {
73
76
 
74
77
  var $attachment = $(this).parents('.attachment');
78
+ var $attachmentUploader = $(this).parents('.attachmentUploader');
75
79
 
76
80
  $.get('/remove', {
77
81
  model: $container.data('model'),
78
82
  id: $container.data('id'),
79
83
  relation: $container.data('relation'),
80
- relation_id: $attachment.data('id')
84
+ relation_id: $attachment.data('id'),
85
+ embedded_in_model: $attachmentUploader.data('embedded-in-model'),
86
+ embedded_in_id: $attachmentUploader.data('embedded-in-id')
81
87
  }, function(data) {
82
88
  $attachment.remove();
83
89
  });
@@ -3,15 +3,40 @@ require 'action_controller/railtie'
3
3
  module MediaMagick
4
4
  class AttachController < ActionController::Base
5
5
  def create
6
- klass = params[:model].constantize.find(params[:id])
7
- attachment = klass.send(params[:relation].pluralize).create(params[:relation].singularize => params[:file])
8
- klass.save
6
+ if !params[:embedded_in_model].blank?
7
+ embedded_in = params[:embedded_in_model].constantize.find(params[:embedded_in_id])
8
+ klass = embedded_in.send(params[:model].pluralize.downcase).find(params[:id])
9
+ attachment = klass.send(params[:relation].pluralize).create(params[:relation].singularize => params[:file])
10
+ klass.save
11
+ else
12
+ if params[:model].constantize.relations[params[:relation]][:relation] == Mongoid::Relations::Referenced::Many
13
+ klass = params[:model].constantize.where(id: params[:id])
14
+ klass = klass.empty? ? nil : klass.first
15
+
16
+ if klass
17
+ attachment = klass.send(params[:relation].pluralize).create(params[:relation].singularize => params[:file])
18
+ else
19
+ attachment = params[:model].constantize.relations[params[:relation]][:class_name].constantize.create!(params[:relation].singularize => params[:file])
20
+ end
21
+ else
22
+ klass = params[:model].constantize.find(params[:id])
23
+ attachment = klass.send(params[:relation].pluralize).create(params[:relation].singularize => params[:file])
24
+ klass.save
25
+ end
26
+ end
9
27
 
10
- render :partial => "/#{attachment.class::TYPE}", :locals => {:attachment => attachment}
28
+ partial = params[:partial].blank? ? "/#{attachment.class::TYPE}" : params[:partial]
29
+
30
+ render :partial => partial, :locals => {:model => params[:model], :relation => params[:relation], :attachment => attachment}
11
31
  end
12
32
 
13
33
  def destroy
14
- attachment = params[:model].classify.constantize.find(params[:id]).send(params[:relation].pluralize).find(params[:relation_id])
34
+ if !params[:embedded_in_model].blank?
35
+ attachment = params[:embedded_in_model].classify.constantize.find(params[:embedded_in_id]).send(params[:model].pluralize.downcase).find(params[:id]).send(params[:relation].pluralize).find(params[:relation_id])
36
+ else
37
+ attachment = params[:model].classify.constantize.find(params[:id]).send(params[:relation].pluralize).find(params[:relation_id])
38
+ end
39
+
15
40
  attachment.destroy
16
41
  render nothing: true
17
42
  end
@@ -20,7 +45,11 @@ module MediaMagick
20
45
  attachments = params[:elements]
21
46
  attachments = attachments.split(',') unless attachments.kind_of?(Array)
22
47
 
23
- parent = params[:model].constantize.find(params[:model_id])
48
+ if !params[:embedded_in_model].blank?
49
+ parent = params[:embedded_in_model].classify.constantize.find(params[:embedded_in_id]).send(params[:model].pluralize.downcase).find(params[:model_id])
50
+ else
51
+ parent = params[:model].constantize.find(params[:model_id])
52
+ end
24
53
 
25
54
  attachments.each_with_index do |id, i|
26
55
  attachment = parent.send(params[:relation]).find(id)
@@ -32,7 +61,11 @@ module MediaMagick
32
61
  end
33
62
 
34
63
  def recreate_versions
35
- parent = params[:model].classify.constantize.find(params[:model_id])
64
+ if !params[:embedded_in_model].blank?
65
+ parent = params[:embedded_in_model].classify.constantize.find(params[:embedded_in_id]).send(params[:model].pluralize.downcase).find(params[:model_id])
66
+ else
67
+ parent = params[:model].classify.constantize.find(params[:model_id])
68
+ end
36
69
 
37
70
  errors = []
38
71
  parent.send(params[:relation].pluralize).each do |attachment|
@@ -1,11 +1,28 @@
1
1
  module MediaMagick
2
2
  module ApplicationHelper
3
- def attachment_container(model, relation, newAttachments = {}, loadedAttachments= {})
4
- content_tag :div, id: model.class.to_s.downcase << '-' << relation.to_s, class: 'attachmentUploader ' << relation.to_s, data: { model: model.class.to_s, id: model.id.to_s, relation: relation.to_s } do
3
+ def attachment_container(model, relation, newAttachments = {}, loadedAttachments = {}, options = {})
4
+ data_attributes = {
5
+ model: model.class.to_s,
6
+ id: model.id.to_s,
7
+ relation: relation.to_s
8
+ }
9
+
10
+ data_attributes.merge!(:partial => options[:partial]) if options[:partial]
11
+ data_attributes.merge!(:embedded_in_id => options[:embedded_in].id.to_s, :embedded_in_model => options[:embedded_in].class.to_s) if options[:embedded_in]
12
+
13
+ content_tag :div, id: model.class.to_s.downcase << '-' << relation.to_s, class: 'attachmentUploader ' << relation.to_s, data: data_attributes do
5
14
  if block_given?
6
15
  yield
7
16
  else
8
- render :partial => "/upload", :locals => { model: model, relations: relation, newAttachments: newAttachments, loadedAttachments: loadedAttachments }
17
+ partial_attributes = {
18
+ model: model,
19
+ relations: relation,
20
+ newAttachments: newAttachments,
21
+ loadedAttachments: loadedAttachments,
22
+ partial: options[:partial]
23
+ }
24
+
25
+ render '/upload', partial_attributes
9
26
  end
10
27
  end
11
28
  end
@@ -1,4 +1,6 @@
1
1
  <li class="attachment" data-id="<%= attachment.to_param %>">
2
2
  <%= link_to attachment.filename, attachment.url unless attachment.file.nil? %>
3
3
  <%= link_to t('media_magick.remove'), "javascript://", method: "delete", confirm: t('media_magick.confirm_removal'), class: "remove btn btn-mini btn-danger" %>
4
+
5
+ <%= hidden_field_tag "#{model.parameterize}[#{relation.singularize}_ids][]", attachment.id if model && relation %>
4
6
  </li>
@@ -1,4 +1,6 @@
1
1
  <li class="attachment" id="<%= attachment.to_param %>" data-id="<%= attachment.to_param %>">
2
2
  <%= image_tag attachment.url, alt: attachment.filename %>
3
3
  <%= link_to t('media_magick.remove'), "javascript://", method: "delete", confirm: t('media_magick.confirm_removal'), class: "remove btn btn-mini btn-danger" %>
4
+
5
+ <%= hidden_field_tag "#{model.parameterize}[#{relation.singularize}_ids][]", attachment.id if model && relation %>
4
6
  </li>
@@ -7,11 +7,13 @@
7
7
  <a class="uploadAttachments btn" href="javascript://"><%= t('media_magick.upload') %></a>
8
8
  </div>
9
9
  <ul class="loadedAttachments <%= loadedAttachments[:class] %>">
10
- <% for attachment in model.send(relations).each do %>
11
- <% if attachment.class::TYPE.to_s == 'file' %>
10
+ <% model.send(relations).each do |attachment| %>
11
+ <% if partial %>
12
+ <%= render partial, attachment: attachment %>
13
+ <% elsif attachment.class::TYPE.to_s == 'file' %>
12
14
  <%= render :partial => "/file", :locals => { :attachment => attachment } %>
13
15
  <% elsif attachment.class::TYPE.to_s == 'image' %>
14
- <%= render :partial => "/image", :locals => { :attachment => attachment } %>
16
+ <%= render :partial => "/image", :locals => { :attachment => attachment, :model => nil, :relation => nil } %>
15
17
  <% end %>
16
18
  <% end %>
17
19
  </ul>
@@ -8,6 +8,15 @@ module MediaMagick
8
8
 
9
9
  module ClassMethods
10
10
  def attachs_many(name, options = {}, &block)
11
+ warn "[DEPRECATION] `attachs_many` is deprecated. Please use `attaches_many` instead."
12
+ attaches_many(name, options, &block)
13
+ end
14
+
15
+ #
16
+ # TODO
17
+ # * refactor these methods to remove duplication
18
+ #
19
+ def attaches_many(name, options = {}, &block)
11
20
  klass = Class.new do
12
21
  include Mongoid::Document
13
22
  extend CarrierWave::Mount
@@ -15,9 +24,57 @@ module MediaMagick
15
24
  field :priority, type: Integer, default: 0
16
25
  default_scope asc(:priority)
17
26
 
18
- embedded_in :attachmentable, polymorphic: true
27
+ if options[:relation] == :referenced
28
+ belongs_to :attachmentable, polymorphic: true
29
+ else
30
+ embedded_in :attachmentable, polymorphic: true
31
+ end
32
+
33
+ mount_uploader name.to_s.singularize, (options[:uploader] || AttachmentUploader)
34
+
35
+ self.const_set "TYPE", options[:type] || :image
36
+ self.const_set "ATTACHMENT", name.to_s.singularize
37
+
38
+ class_eval(&block) if block_given?
39
+
40
+ def method_missing(method, args = nil)
41
+ return self.send(self.class::ATTACHMENT).file.filename if method == :filename
42
+ self.send(self.class::ATTACHMENT).send(method)
43
+ end
44
+ end
45
+
46
+ name_camelcase = name.to_s.camelcase
47
+ Object.const_set "#{self}#{name_camelcase}", klass
48
+
49
+ if options[:relation] == :referenced
50
+ klass.collection_name = "#{self.name}_#{name.to_s.camelcase}".parameterize
51
+
52
+ has_many(name, :as => :attachmentable, class_name: "#{self}#{name_camelcase}")
53
+
54
+ field "#{name.to_s.singularize}_ids", type: Array
55
+
56
+ before_create do
57
+ ids = self.send("#{name.to_s.singularize}_ids") || []
58
+
59
+ ids.each do |id|
60
+ "#{self.class}#{name_camelcase}".constantize.find(id).update_attributes(attachmentable: self)
61
+ end
62
+ end
63
+ else
64
+ embeds_many(name, :as => :attachmentable, class_name: "#{self}#{name_camelcase}")
65
+ end
66
+ end
67
+
68
+ def attaches_one(name, options = {}, &block)
69
+ klass = Class.new do
70
+ include Mongoid::Document
71
+ extend CarrierWave::Mount
72
+
73
+ embedded_in name
19
74
  mount_uploader name.to_s.singularize, (options[:uploader] || AttachmentUploader)
20
75
 
76
+ accepts_nested_attributes_for name.to_s.singularize
77
+
21
78
  self.const_set "TYPE", options[:type] || :image
22
79
  self.const_set "ATTACHMENT", name.to_s.singularize
23
80
 
@@ -30,9 +87,9 @@ module MediaMagick
30
87
  end
31
88
 
32
89
  name_camelcase = name.to_s.camelcase
33
- Object.const_set "#{self.name}#{name_camelcase}", klass
90
+ Object.const_set "#{self}#{name_camelcase}", klass
34
91
 
35
- embeds_many(name, :as => :attachmentable, class_name: "#{self}#{name_camelcase}")
92
+ embeds_one name, class_name: "#{self}#{name_camelcase}", cascade_callbacks: true
36
93
  end
37
94
  end
38
95
  end
@@ -1,3 +1,3 @@
1
1
  module MediaMagick
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
data/media_magick.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
6
6
  gem.email = ['contato@lucasrenan.com', 'rbrancher@gmail.com', 'tiagogodinho3@gmail.com']
7
7
  gem.description = %q{MediaMagick aims to make dealing with multimedia resources a very easy task – like magic.}
8
8
  gem.summary = %q{MediaMagick aims to make dealing with multimedia resources a very easy task – like magic. It wraps up robust solutions for upload, associate and display images, videos, audios and files to any model in your rails app.}
9
- gem.homepage = ''
9
+ gem.homepage = 'https://github.com/nudesign/media_magick'
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
12
12
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -23,6 +23,6 @@ Gem::Specification.new do |gem|
23
23
  gem.add_development_dependency 'bson_ext', '~> 1.6.0'
24
24
  gem.add_development_dependency 'mini_magick', '~> 3.4'
25
25
  gem.add_development_dependency 'rake', '~> 0.9'
26
- gem.add_development_dependency 'rspec-rails', '~> 2.9.0'
26
+ gem.add_development_dependency 'rspec-rails', '~> 2.10.1'
27
27
  gem.add_development_dependency 'simplecov', '~> 0.6.1'
28
28
  end
@@ -16,6 +16,36 @@ describe MediaMagick::AttachController do
16
16
 
17
17
  response.body.should =~ /nu.jpg/m
18
18
  end
19
+
20
+ it "creates a new photo for embedded models" do
21
+ album = Album.create
22
+ track = album.tracks.create
23
+
24
+ expect {
25
+ post :create, { embedded_in_id: album.id, embedded_in_model: 'Album', model: 'Track', id: track.id, relation: 'files', file: fixture_file_upload("#{File.expand_path('../../..', __FILE__)}/support/fixtures/nu.jpg") }
26
+ }.to change { track.reload.files.count }.by(1)
27
+
28
+ response.should render_template('_image')
29
+
30
+ response.body.should =~ /nu.jpg/m
31
+ end
32
+
33
+ it "render a personalized partial" do
34
+ album = Album.create
35
+ post :create, { model: 'Album', id: album.id, relation: 'photos', partial: 'albums/photo', file: fixture_file_upload("#{File.expand_path('../../..', __FILE__)}/support/fixtures/nu.jpg") }
36
+ response.should render_template('albums/_photo')
37
+ end
38
+
39
+ it 'creates a new photo without parent' do
40
+ album = Album.new
41
+ album_files = AlbumFiles.create(file: File.new("#{File.expand_path('../../..', __FILE__)}/support/fixtures/nu.jpg"))
42
+
43
+ AlbumFiles.should_receive(:create!).and_return(album_files)
44
+
45
+ post :create, { model: 'Album', id: album.id, relation: 'files', file: fixture_file_upload("#{File.expand_path('../../..', __FILE__)}/support/fixtures/nu.jpg") }
46
+
47
+ response.body.should =~ /nu.jpg/m
48
+ end
19
49
  end
20
50
  end
21
51
 
@@ -28,6 +58,16 @@ describe MediaMagick::AttachController do
28
58
  delete :destroy, { model: 'Album', id: album.id, relation: 'photos', relation_id: photo.id }
29
59
  }.to change { album.reload.photos.count }.by(-1)
30
60
  end
61
+
62
+ it "destroys the requested photo for embedded models" do
63
+ album = Album.create
64
+ track = album.tracks.create
65
+ file = track.files.create(file: File.new(fixture_file_upload("#{File.expand_path('../../..', __FILE__)}/support/fixtures/nu.jpg")))
66
+
67
+ expect {
68
+ delete :destroy, { embedded_in_model: 'Album', embedded_in_id: album.id, model: 'Track', id: track.id, relation: 'files', relation_id: file.id }
69
+ }.to change { track.reload.files.count }.by(-1)
70
+ end
31
71
  end
32
72
 
33
73
  describe "update priority" do
@@ -44,6 +84,21 @@ describe MediaMagick::AttachController do
44
84
  photo1.reload.priority.should eq(0)
45
85
  photo2.reload.priority.should eq(1)
46
86
  end
87
+
88
+ it "updates the attachments priority for embedded models" do
89
+ album = Album.create
90
+ track = album.tracks.create
91
+ file1 = track.files.create(file: File.new(fixture_file_upload("#{File.expand_path('../../..', __FILE__)}/support/fixtures/nu.jpg")))
92
+ file2 = track.files.create(file: File.new(fixture_file_upload("#{File.expand_path('../../..', __FILE__)}/support/fixtures/nu.jpg")))
93
+
94
+ id1 = file1.id.to_s
95
+ id2 = file2.id.to_s
96
+
97
+ put :update_priority, { elements: [id1, id2], embedded_in_model: 'Album', embedded_in_id: album.id, model: 'Track', model_id: track.id.to_s, relation: 'files' }
98
+
99
+ file1.reload.priority.should eq(0)
100
+ file2.reload.priority.should eq(1)
101
+ end
47
102
  end
48
103
 
49
104
  describe "recriate versions" do
@@ -55,5 +110,15 @@ describe MediaMagick::AttachController do
55
110
 
56
111
  response.status.should be(302)
57
112
  end
113
+
114
+ it "recriate images versions for embedded models" do
115
+ album = Album.create
116
+ track = album.tracks.create
117
+
118
+ request.env["HTTP_REFERER"] = "/"
119
+ put :recreate_versions, { embedded_in_model: 'album', embedded_in_id: album.id, model: 'track', model_id: track.id.to_s, relation: 'files' }
120
+
121
+ response.status.should be(302)
122
+ end
58
123
  end
59
124
  end
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,84 @@
1
+ class UsersController < ApplicationController
2
+ # GET /users
3
+ # GET /users.json
4
+ def index
5
+ @users = User.all
6
+
7
+ respond_to do |format|
8
+ format.html # index.html.erb
9
+ format.json { render json: @users }
10
+ end
11
+ end
12
+
13
+ # GET /users/1
14
+ # GET /users/1.json
15
+ def show
16
+ @user = User.find(params[:id])
17
+
18
+ respond_to do |format|
19
+ format.html # show.html.erb
20
+ format.json { render json: @user }
21
+ end
22
+ end
23
+
24
+ # GET /users/new
25
+ # GET /users/new.json
26
+ def new
27
+ @user = User.new
28
+ @user.build_photo
29
+
30
+ respond_to do |format|
31
+ format.html # new.html.erb
32
+ format.json { render json: @user }
33
+ end
34
+ end
35
+
36
+ # GET /users/1/edit
37
+ def edit
38
+ @user = User.find(params[:id])
39
+ end
40
+
41
+ # POST /users
42
+ # POST /users.json
43
+ def create
44
+ @user = User.new(params[:user])
45
+
46
+ respond_to do |format|
47
+ if @user.save
48
+ format.html { redirect_to @user, notice: 'User was successfully created.' }
49
+ format.json { render json: @user, status: :created, location: @user }
50
+ else
51
+ format.html { render action: "new" }
52
+ format.json { render json: @user.errors, status: :unprocessable_entity }
53
+ end
54
+ end
55
+ end
56
+
57
+ # PUT /users/1
58
+ # PUT /users/1.json
59
+ def update
60
+ @user = User.find(params[:id])
61
+
62
+ respond_to do |format|
63
+ if @user.update_attributes(params[:user])
64
+ format.html { redirect_to @user, notice: 'User was successfully updated.' }
65
+ format.json { head :no_content }
66
+ else
67
+ format.html { render action: "edit" }
68
+ format.json { render json: @user.errors, status: :unprocessable_entity }
69
+ end
70
+ end
71
+ end
72
+
73
+ # DELETE /users/1
74
+ # DELETE /users/1.json
75
+ def destroy
76
+ @user = User.find(params[:id])
77
+ @user.destroy
78
+
79
+ respond_to do |format|
80
+ format.html { redirect_to users_url }
81
+ format.json { head :no_content }
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,2 @@
1
+ module UsersHelper
2
+ end
@@ -2,13 +2,15 @@ class Album
2
2
  include Mongoid::Document
3
3
  include MediaMagick::Model
4
4
 
5
- attachs_many :photos
6
- attachs_many :files
7
- attachs_many :compound_name_files
5
+ embeds_many :tracks
8
6
 
9
- attachs_many :images do
7
+ attaches_many :photos
8
+ attaches_many :files, :relation => :referenced
9
+ attaches_many :compound_name_files
10
+
11
+ attaches_many :images do
10
12
  field :tags, type: Array
11
13
  end
12
14
 
13
- attachs_many :pictures, uploader: PictureUploader
15
+ attaches_many :pictures, uploader: PictureUploader
14
16
  end
@@ -2,8 +2,8 @@ class Product
2
2
  include Mongoid::Document
3
3
  include MediaMagick::Model
4
4
 
5
- attachs_many :files
6
- attachs_many :images, uploader: PictureUploader do
5
+ attaches_many :files
6
+ attaches_many :images, uploader: PictureUploader do
7
7
  field :tags, type: Array
8
8
  end
9
9
  end
@@ -0,0 +1,8 @@
1
+ class Track
2
+ include Mongoid::Document
3
+ include MediaMagick::Model
4
+
5
+ embedded_in :album
6
+
7
+ attaches_many :files
8
+ end
@@ -0,0 +1,10 @@
1
+ class User
2
+ include Mongoid::Document
3
+ include MediaMagick::Model
4
+
5
+ field :name, type: String
6
+
7
+ attaches_one :photo, uploader: PictureUploader
8
+ attaches_one :compound_name_file
9
+ attaches_one :file, type: :file
10
+ end
@@ -0,0 +1 @@
1
+ albums/photo
@@ -1,7 +1,7 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <title>Dummy</title>
4
+ <title>MediaMagick</title>
5
5
  <%= stylesheet_link_tag "application", :media => "all" %>
6
6
  <%= javascript_include_tag "application" %>
7
7
  <%= csrf_meta_tags %>
@@ -0,0 +1,29 @@
1
+ <%= form_for(@user, html: {multipart: true}) do |f| %>
2
+ <% if @user.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @user.errors.full_messages.each do |msg| %>
8
+ <li><%= msg %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :name %><br />
16
+ <%= f.text_field :name %>
17
+ </div>
18
+ <%= f.fields_for :photo do |p| %>
19
+ <div class="field">
20
+ <%= p.label :photo %><br />
21
+ <%= p.file_field :photo %>
22
+ <%= p.hidden_field :photo_cache %>
23
+ </div>
24
+ <% end %>
25
+
26
+ <div class="actions">
27
+ <%= f.submit %>
28
+ </div>
29
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @user %> |
6
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,23 @@
1
+ <h1>Listing users</h1>
2
+
3
+ <table>
4
+ <tr>
5
+ <th>Name</th>
6
+ <th></th>
7
+ <th></th>
8
+ <th></th>
9
+ </tr>
10
+
11
+ <% @users.each do |user| %>
12
+ <tr>
13
+ <td><%= user.name %></td>
14
+ <td><%= link_to 'Show', user %></td>
15
+ <td><%= link_to 'Edit', edit_user_path(user) %></td>
16
+ <td><%= link_to 'Destroy', user, confirm: 'Are you sure?', method: :delete %></td>
17
+ </tr>
18
+ <% end %>
19
+ </table>
20
+
21
+ <br />
22
+
23
+ <%= link_to 'New User', new_user_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New user</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', users_path %>
@@ -0,0 +1,15 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <b>Name:</b>
5
+ <%= @user.name %>
6
+ </p>
7
+
8
+ <p>
9
+ <b>Photo:</b>
10
+ <%= image_tag @user.photo.url if @user.photo %>
11
+ </p>
12
+
13
+
14
+ <%= link_to 'Edit', edit_user_path(@user) %> |
15
+ <%= link_to 'Back', users_path %>
@@ -1,4 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
+ resources :users
4
+
3
5
  mount MediaMagick::Engine => "/media_magick"
4
6
  end
@@ -11,6 +11,25 @@ describe MediaMagick do
11
11
  end.should eq('<div class="attachmentUploader photos" data-id="12345678" data-model="Album" data-relation="photos" id="album-photos"></div>')
12
12
  end
13
13
 
14
+ it 'should include partial option on data attributes' do
15
+ album = Album.new
16
+ album.stub(id: '12345678')
17
+
18
+ helper.attachment_container(album, :photos, {}, {}, partial: 'albums/photo') do
19
+ end.should eq('<div class="attachmentUploader photos" data-id="12345678" data-model="Album" data-partial="albums/photo" data-relation="photos" id="album-photos"></div>')
20
+ end
21
+
22
+ it 'should create a div.attachmentUploader.photos for embedded models' do
23
+ album = Album.new
24
+ album.stub(id: '12345678')
25
+
26
+ track = album.tracks.new
27
+ track.stub(id: '87654321')
28
+
29
+ helper.attachment_container(track, :files, {}, {}, embedded_in: album) do
30
+ end.should eq('<div class="attachmentUploader files" data-embedded-in-id="12345678" data-embedded-in-model="Album" data-id="87654321" data-model="Track" data-relation="files" id="track-files"></div>')
31
+ end
32
+
14
33
  it 'should renders default partial if block is not given' do
15
34
  photo = AlbumPhotos.new
16
35
  photo.stub(filename: 'photo.jpg', url: 'url/photo.jpg')
@@ -4,44 +4,80 @@ describe 'Images' do
4
4
  let(:image_file) { File.new("#{File.expand_path('../..', __FILE__)}/support/fixtures/nu.jpg") }
5
5
  let(:non_image_file) { File.new("#{File.expand_path('../..', __FILE__)}/support/fixtures/nu.txt") }
6
6
 
7
- it 'should save the image on mongoid document' do
8
- product = Product.create
9
- product.images.create(image: image_file)
7
+ context "when uploading many files" do
8
+ it 'should save the image on mongoid document' do
9
+ product = Product.create
10
+ product.images.create(image: image_file)
10
11
 
11
- product.reload.images.first.filename.should eq('nu.jpg')
12
- end
12
+ product.reload.images.first.filename.should eq('nu.jpg')
13
+ end
13
14
 
14
- it 'should save the file on mongoid document' do
15
- product = Product.create
16
- file = product.files.create(file: non_image_file)
15
+ it 'should save the file on mongoid document' do
16
+ product = Product.create
17
+ file = product.files.create(file: non_image_file)
17
18
 
18
- product.reload.files.first.url.should eq("/uploads/product_files/file/#{file.id}/nu.txt")
19
- end
19
+ product.reload.files.first.url.should eq("/uploads/product_files/file/#{file.id}/nu.txt")
20
+ end
20
21
 
21
- it 'should access Uploader methods from relation class' do
22
- product = Product.create
23
- image = product.images.create(image: image_file)
22
+ it 'should access Uploader methods from relation class' do
23
+ product = Product.create
24
+ image = product.images.create(image: image_file)
24
25
 
25
- image.url.should eq("/uploads/product_images/image/#{image.id}/nu.jpg")
26
- end
26
+ image.url.should eq("/uploads/product_images/image/#{image.id}/nu.jpg")
27
+ end
27
28
 
28
- it 'should access filename from relation class' do
29
- product = Product.create
30
- product.images.create(image: image_file)
29
+ it 'should access filename from relation class' do
30
+ product = Product.create
31
+ product.images.create(image: image_file)
31
32
 
32
- product.reload.images.first.filename.should eq('nu.jpg')
33
- end
33
+ product.reload.images.first.filename.should eq('nu.jpg')
34
+ end
34
35
 
35
- it 'should add fields on relation class' do
36
- product = Product.create
37
- product.images.create(image: image_file, tags: ['ruby', 'guru'])
36
+ it 'should add fields on relation class' do
37
+ product = Product.create
38
+ product.images.create(image: image_file, tags: ['ruby', 'guru'])
38
39
 
39
- product.reload.images.first.tags.should eq(['ruby', 'guru'])
40
+ product.reload.images.first.tags.should eq(['ruby', 'guru'])
41
+ end
42
+
43
+ it 'should create version of images' do
44
+ product = Product.create
45
+ image = product.images.create(image: image_file)
46
+ product.reload.images.first.thumb.url.should eq("/uploads/product_images/image/#{image.id}/thumb_nu.jpg")
47
+ end
40
48
  end
41
49
 
42
- it 'should create version of images' do
43
- product = Product.create
44
- image = product.images.create(image: image_file)
45
- product.reload.images.first.thumb.url.should eq("/uploads/product_images/image/#{image.id}/thumb_nu.jpg")
50
+ context "when uploading one file" do
51
+ let(:user) { User.create }
52
+
53
+ it 'should save the image on mongoid document' do
54
+ user.create_photo(photo: image_file)
55
+
56
+ user.photo.filename.should eq('nu.jpg')
57
+ end
58
+
59
+ it 'should save the file on mongoid document' do
60
+ file = user.create_file(file: non_image_file)
61
+
62
+ user.file.url.should eq("/uploads/user_file/file/#{file.id}/nu.txt")
63
+ end
64
+
65
+ it 'should access Uploader methods from relation class' do
66
+ photo = user.create_photo(photo: image_file)
67
+
68
+ photo.url.should eq("/uploads/user_photo/photo/#{photo.id}/nu.jpg")
69
+ end
70
+
71
+ it 'should access filename from relation class' do
72
+ user.create_photo(photo: image_file)
73
+
74
+ user.photo.filename.should eq('nu.jpg')
75
+ end
76
+
77
+ it 'should create version of images' do
78
+ photo = user.create_photo(photo: image_file)
79
+
80
+ user.photo.thumb.url.should eq("/uploads/user_photo/photo/#{photo.id}/thumb_nu.jpg")
81
+ end
46
82
  end
47
83
  end
@@ -3,18 +3,36 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  describe MediaMagick::Model do
6
- describe '.attachs_many' do
6
+ describe 'including class methods' do
7
7
  before(:all) do
8
- @class = Album
9
- @instance = @class.new
8
+ @klass = User
9
+ end
10
+
11
+ it "should includes .attaches_many" do
12
+ @klass.should respond_to(:attaches_many)
13
+ end
14
+
15
+ it "should includes .attaches_one" do
16
+ @klass.should respond_to(:attaches_one)
17
+ end
18
+ end
19
+
20
+ describe '.attaches_many' do
21
+ before(:all) do
22
+ @klass = Album
23
+ @instance = @klass.new
24
+ end
25
+
26
+ it 'should create a "has_many" relationship with photos' do
27
+ @klass.relations['files'].relation.should eq(Mongoid::Relations::Referenced::Many)
10
28
  end
11
29
 
12
30
  it 'should create a "embeds_many" relationship with photos' do
13
- @class.relations['photos'].relation.should eq(Mongoid::Relations::Embedded::Many)
31
+ @klass.relations['photos'].relation.should eq(Mongoid::Relations::Embedded::Many)
14
32
  end
15
33
 
16
34
  it 'should create a relationship with photos through AlbumPhotos model' do
17
- @class.relations['photos'].class_name.should eq('AlbumPhotos')
35
+ @klass.relations['photos'].class_name.should eq('AlbumPhotos')
18
36
  end
19
37
 
20
38
  describe "naming relations" do
@@ -30,16 +48,15 @@ describe MediaMagick::Model do
30
48
  it { should be_an_instance_of(AlbumPhotos) }
31
49
 
32
50
  it 'should perform a block in the context of the class' do
33
- @class.attachs_many(:documents) do
34
- def test_method
35
- end
51
+ @klass.attaches_many(:documents) do
52
+ def test_method; end
36
53
  end
37
54
 
38
55
  @instance.documents.new.should respond_to(:test_method)
39
56
  end
40
57
 
41
58
  it "should be ordered by ascending priority" do
42
- @instance = @class.new
59
+ @instance = @klass.new
43
60
 
44
61
  photo2 = @instance.photos.create(priority: 1)
45
62
  photo1 = @instance.photos.create(priority: 0)
@@ -66,7 +83,7 @@ describe MediaMagick::Model do
66
83
  storage :file
67
84
  end
68
85
 
69
- @class.attachs_many :musics, uploader: AmazonS3Uploader
86
+ @klass.attaches_many :musics, uploader: AmazonS3Uploader
70
87
  end
71
88
 
72
89
  subject { @instance.musics.new }
@@ -77,4 +94,42 @@ describe MediaMagick::Model do
77
94
  end
78
95
  end
79
96
  end
97
+
98
+ describe '.attaches_one' do
99
+ before(:all) do
100
+ @klass = User
101
+ @instance = @klass.new
102
+ end
103
+
104
+ it 'should create an embedded model' do
105
+ @klass.relations['photo'].class_name.should eq('UserPhoto')
106
+ end
107
+
108
+ it 'should create a "embeds_one" relation' do
109
+ @klass.relations['photo'].relation.should eq(Mongoid::Relations::Embedded::One)
110
+ end
111
+
112
+ describe "naming relations" do
113
+ it "should transform related compound name classe to camel case" do
114
+ @instance.should respond_to(:compound_name_file)
115
+ @instance.build_compound_name_file.class.should eq(UserCompoundNameFile)
116
+ end
117
+ end
118
+
119
+ describe "related method" do
120
+ subject { @instance.build_photo }
121
+
122
+ it { should be_an_instance_of(UserPhoto) }
123
+
124
+ it 'should perform a block in the context of the class' do
125
+ @klass.attaches_one(:image) do
126
+ def test_method; end
127
+ end
128
+
129
+ @instance.build_image.should respond_to(:test_method)
130
+ end
131
+ end
132
+
133
+ end
134
+
80
135
  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.0.1
4
+ version: 0.1.0
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-04-12 00:00:00.000000000 Z
14
+ date: 2012-06-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: carrierwave
@@ -132,7 +132,7 @@ dependencies:
132
132
  requirements:
133
133
  - - ~>
134
134
  - !ruby/object:Gem::Version
135
- version: 2.9.0
135
+ version: 2.10.1
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.9.0
143
+ version: 2.10.1
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: simplecov
146
146
  requirement: !ruby/object:Gem::Requirement
@@ -169,7 +169,9 @@ extra_rdoc_files: []
169
169
  files:
170
170
  - .gitignore
171
171
  - .rspec
172
+ - .rvmrc
172
173
  - .travis.yml
174
+ - CHANGELOG.md
173
175
  - Gemfile
174
176
  - LICENSE
175
177
  - README.md
@@ -202,15 +204,27 @@ files:
202
204
  - spec/dummy/README.rdoc
203
205
  - spec/dummy/Rakefile
204
206
  - spec/dummy/app/assets/javascripts/application.js
207
+ - spec/dummy/app/assets/javascripts/users.js
205
208
  - spec/dummy/app/assets/stylesheets/application.css
209
+ - spec/dummy/app/assets/stylesheets/scaffold.css
210
+ - spec/dummy/app/assets/stylesheets/users.css
206
211
  - spec/dummy/app/controllers/application_controller.rb
212
+ - spec/dummy/app/controllers/users_controller.rb
207
213
  - spec/dummy/app/helpers/application_helper.rb
214
+ - spec/dummy/app/helpers/users_helper.rb
208
215
  - spec/dummy/app/mailers/.gitkeep
209
- - spec/dummy/app/models/.gitkeep
210
216
  - spec/dummy/app/models/album.rb
211
217
  - spec/dummy/app/models/product.rb
218
+ - spec/dummy/app/models/track.rb
219
+ - spec/dummy/app/models/user.rb
212
220
  - spec/dummy/app/uploaders/picture_uploader.rb
221
+ - spec/dummy/app/views/albums/_photo.html.erb
213
222
  - spec/dummy/app/views/layouts/application.html.erb
223
+ - spec/dummy/app/views/users/_form.html.erb
224
+ - spec/dummy/app/views/users/edit.html.erb
225
+ - spec/dummy/app/views/users/index.html.erb
226
+ - spec/dummy/app/views/users/new.html.erb
227
+ - spec/dummy/app/views/users/show.html.erb
214
228
  - spec/dummy/config.ru
215
229
  - spec/dummy/config/application.rb
216
230
  - spec/dummy/config/boot.rb
@@ -241,7 +255,7 @@ files:
241
255
  - spec/spec_helper.rb
242
256
  - spec/support/fixtures/nu.jpg
243
257
  - spec/support/fixtures/nu.txt
244
- homepage: ''
258
+ homepage: https://github.com/nudesign/media_magick
245
259
  licenses: []
246
260
  post_install_message:
247
261
  rdoc_options: []
@@ -255,7 +269,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
255
269
  version: '0'
256
270
  segments:
257
271
  - 0
258
- hash: 29995181221307107
272
+ hash: -141377081064224492
259
273
  required_rubygems_version: !ruby/object:Gem::Requirement
260
274
  none: false
261
275
  requirements:
@@ -264,10 +278,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
264
278
  version: '0'
265
279
  segments:
266
280
  - 0
267
- hash: 29995181221307107
281
+ hash: -141377081064224492
268
282
  requirements: []
269
283
  rubyforge_project:
270
- rubygems_version: 1.8.21
284
+ rubygems_version: 1.8.24
271
285
  signing_key:
272
286
  specification_version: 3
273
287
  summary: MediaMagick aims to make dealing with multimedia resources a very easy task
@@ -278,15 +292,27 @@ test_files:
278
292
  - spec/dummy/README.rdoc
279
293
  - spec/dummy/Rakefile
280
294
  - spec/dummy/app/assets/javascripts/application.js
295
+ - spec/dummy/app/assets/javascripts/users.js
281
296
  - spec/dummy/app/assets/stylesheets/application.css
297
+ - spec/dummy/app/assets/stylesheets/scaffold.css
298
+ - spec/dummy/app/assets/stylesheets/users.css
282
299
  - spec/dummy/app/controllers/application_controller.rb
300
+ - spec/dummy/app/controllers/users_controller.rb
283
301
  - spec/dummy/app/helpers/application_helper.rb
302
+ - spec/dummy/app/helpers/users_helper.rb
284
303
  - spec/dummy/app/mailers/.gitkeep
285
- - spec/dummy/app/models/.gitkeep
286
304
  - spec/dummy/app/models/album.rb
287
305
  - spec/dummy/app/models/product.rb
306
+ - spec/dummy/app/models/track.rb
307
+ - spec/dummy/app/models/user.rb
288
308
  - spec/dummy/app/uploaders/picture_uploader.rb
309
+ - spec/dummy/app/views/albums/_photo.html.erb
289
310
  - spec/dummy/app/views/layouts/application.html.erb
311
+ - spec/dummy/app/views/users/_form.html.erb
312
+ - spec/dummy/app/views/users/edit.html.erb
313
+ - spec/dummy/app/views/users/index.html.erb
314
+ - spec/dummy/app/views/users/new.html.erb
315
+ - spec/dummy/app/views/users/show.html.erb
290
316
  - spec/dummy/config.ru
291
317
  - spec/dummy/config/application.rb
292
318
  - spec/dummy/config/boot.rb
File without changes