media_magick 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/CHANGELOG.md +7 -2
- data/Gemfile +2 -1
- data/app/assets/javascripts/media_magick/plupload_it.js +25 -23
- data/config/routes.rb +4 -4
- data/gemfiles/mongoid-master.gemfile +6 -0
- data/lib/media_magick/version.rb +1 -1
- data/media_magick.gemspec +7 -7
- data/spec/dummy/Rakefile +0 -1
- data/spec/dummy/app/controllers/posts_controller.rb +8 -2
- data/spec/dummy/app/controllers/users_controller.rb +8 -2
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/application.rb +7 -42
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/environment.rb +2 -2
- data/spec/dummy/config/environments/development.rb +10 -14
- data/spec/dummy/config/environments/production.rb +40 -27
- data/spec/dummy/config/environments/test.rb +13 -11
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +6 -5
- data/spec/dummy/config/initializers/secret_token.rb +7 -2
- data/spec/dummy/config/initializers/session_store.rb +0 -5
- data/spec/dummy/config/initializers/wrap_parameters.rb +2 -7
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/public/404.html +43 -11
- data/spec/dummy/public/422.html +43 -11
- data/spec/dummy/public/500.html +43 -11
- data/spec/lib/media_magick/image/dimensions_spec.rb +1 -1
- data/spec/routing/attach_spec.rb +5 -5
- metadata +24 -32
- data/gemfiles/mongoid-3.0.gemfile +0 -6
- data/spec/dummy/log/.gitkeep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1962fba734c6fbafcae0bc35b6264134e386dafd
|
4
|
+
data.tar.gz: c97e7014de863bdb54726111ad67fd9adf8eadcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09340ffcda973cc403a34ac87a9e78e7a75fabb63e67c7fe669d8d743e17ebb1a3482394eed3deeb1c5ae2ff721763a3ca96ea8f4ef3fc70ba17ed510b61439f
|
7
|
+
data.tar.gz: bfd22e4e1c753d99224258246ed1281d453833593721048314f08565f17c89a44c6df0be90d871a8d3b6949183b090ff750d77b448bb78e9b7e877a4547a95ed
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
-
## Next Release
|
1
|
+
## Next Release
|
2
2
|
|
3
|
-
*
|
3
|
+
* see issues - https://github.com/nudesign/media_magick/issues
|
4
|
+
|
5
|
+
## 0.4.0 - October 29, 2013
|
6
|
+
|
7
|
+
* now supports just rails 4
|
8
|
+
* bug fix - http verbs for attachment upload
|
4
9
|
|
5
10
|
## 0.3.3 - October 7, 2013
|
6
11
|
|
data/Gemfile
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
//= require
|
2
|
-
|
3
|
-
// optional, only needed if you'd like to use plupload localized
|
4
|
-
//= require plupload/i18n/pt-br
|
1
|
+
//= require moxie
|
2
|
+
//= require plupload.dev
|
5
3
|
|
6
4
|
// optional, but recommended. it sets generic settings like flash url, etc.
|
7
5
|
//= require plupload.settings
|
@@ -9,12 +7,6 @@
|
|
9
7
|
// optional, only if you want to use the jquery integration
|
10
8
|
//= require jquery.plupload.queue
|
11
9
|
|
12
|
-
// optional, choose the ones you'd like to use
|
13
|
-
//= require plupload.flash
|
14
|
-
//= require plupload.html4
|
15
|
-
//= require plupload.html5
|
16
|
-
//= require plupload.gears
|
17
|
-
|
18
10
|
(function($) {
|
19
11
|
|
20
12
|
$.fn.pluploadIt = function (options) {
|
@@ -132,7 +124,10 @@ $(function() {
|
|
132
124
|
var $videoField = $container.find(".attachmentVideoUploaderField");
|
133
125
|
var modelAndRelation = $container.data('model').replace(/::/g,'-') + "-" + $container.data('relation');
|
134
126
|
|
135
|
-
$.
|
127
|
+
$.ajax({
|
128
|
+
type: 'POST',
|
129
|
+
url: '/upload',
|
130
|
+
data: {
|
136
131
|
model: $container.data('model'),
|
137
132
|
id: $container.data('id'),
|
138
133
|
relation: $container.data('relation'),
|
@@ -141,9 +136,11 @@ $(function() {
|
|
141
136
|
embedded_in_id: $container.data('embedded-in-id'),
|
142
137
|
partial: $container.data('partial') === undefined ? '' : $container.data('partial'),
|
143
138
|
video: $videoField.val()
|
144
|
-
},
|
145
|
-
|
146
|
-
|
139
|
+
},
|
140
|
+
success: function(data) {
|
141
|
+
$('#' + modelAndRelation + '-loadedAttachments').append(data);
|
142
|
+
$videoField.val("");
|
143
|
+
}
|
147
144
|
});
|
148
145
|
});
|
149
146
|
|
@@ -156,15 +153,20 @@ $(function() {
|
|
156
153
|
var $container = $(this).parents('.loadedAttachments');
|
157
154
|
var $attachment = $(this).parents('.attachment');
|
158
155
|
|
159
|
-
$.
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
156
|
+
$.ajax({
|
157
|
+
type: 'DELETE',
|
158
|
+
url: '/remove',
|
159
|
+
data: {
|
160
|
+
model: $container.data('model'),
|
161
|
+
id: $container.data('id'),
|
162
|
+
relation: $container.data('relation'),
|
163
|
+
relation_id: $attachment.data('id'),
|
164
|
+
embedded_in_model: $container.data('embedded-in-model'),
|
165
|
+
embedded_in_id: $container.data('embedded-in-id')
|
166
|
+
},
|
167
|
+
success: function(data) {
|
168
|
+
$attachment.remove();
|
169
|
+
}
|
168
170
|
});
|
169
171
|
}
|
170
172
|
});
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
post 'upload' => 'media_magick/attach#create'
|
3
|
+
delete 'remove' => 'media_magick/attach#destroy'
|
4
|
+
put 'update_priority' => 'media_magick/attach#update_priority'
|
5
|
+
put 'recreate_versions' => 'media_magick/attach#recreate_versions', as: 'recreate_versions'
|
6
6
|
end
|
data/lib/media_magick/version.rb
CHANGED
data/media_magick.gemspec
CHANGED
@@ -16,14 +16,14 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.version = MediaMagick::VERSION
|
17
17
|
|
18
18
|
gem.add_dependency 'carrierwave', '~> 0.9.0'
|
19
|
-
gem.add_dependency 'mongoid', '>= 2.7.0'
|
20
|
-
gem.add_dependency 'plupload-rails', '~> 1.0
|
21
|
-
gem.add_dependency 'rails', '~>
|
19
|
+
# gem.add_dependency 'mongoid', '>= 2.7.0'
|
20
|
+
gem.add_dependency 'plupload-rails', '~> 1.1.0'
|
21
|
+
gem.add_dependency 'rails', '~> 4.0.0'
|
22
22
|
gem.add_dependency 'mini_magick', '~> 3.6.0'
|
23
23
|
|
24
24
|
gem.add_development_dependency 'rake', '~> 10.1.0'
|
25
|
-
gem.add_development_dependency 'rspec-rails', '~> 2.
|
26
|
-
gem.add_development_dependency 'simplecov', '~> 0.7.
|
27
|
-
gem.add_development_dependency 'guard-rspec', '~>
|
28
|
-
gem.add_development_dependency 'rb-fsevent', '~> 0.9.
|
25
|
+
gem.add_development_dependency 'rspec-rails', '~> 2.14.0'
|
26
|
+
gem.add_development_dependency 'simplecov', '~> 0.7.0'
|
27
|
+
gem.add_development_dependency 'guard-rspec', '~> 4.0.0'
|
28
|
+
gem.add_development_dependency 'rb-fsevent', '~> 0.9.0'
|
29
29
|
end
|
data/spec/dummy/Rakefile
CHANGED
@@ -40,7 +40,7 @@ class PostsController < ApplicationController
|
|
40
40
|
# POST /posts
|
41
41
|
# POST /posts.json
|
42
42
|
def create
|
43
|
-
@post = Post.new(
|
43
|
+
@post = Post.new(post_params)
|
44
44
|
|
45
45
|
respond_to do |format|
|
46
46
|
if @post.save
|
@@ -59,7 +59,7 @@ class PostsController < ApplicationController
|
|
59
59
|
@post = Post.find(params[:id])
|
60
60
|
|
61
61
|
respond_to do |format|
|
62
|
-
if @post.update_attributes(
|
62
|
+
if @post.update_attributes(post_params)
|
63
63
|
format.html { redirect_to @post, notice: 'Post was successfully updated.' }
|
64
64
|
format.json { head :no_content }
|
65
65
|
else
|
@@ -80,4 +80,10 @@ class PostsController < ApplicationController
|
|
80
80
|
format.json { head :no_content }
|
81
81
|
end
|
82
82
|
end
|
83
|
+
|
84
|
+
private
|
85
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
86
|
+
def post_params
|
87
|
+
params.require(:post).permit(:title, :text)
|
88
|
+
end
|
83
89
|
end
|
@@ -41,7 +41,7 @@ class UsersController < ApplicationController
|
|
41
41
|
# POST /users
|
42
42
|
# POST /users.json
|
43
43
|
def create
|
44
|
-
@user = User.new(
|
44
|
+
@user = User.new(user_params)
|
45
45
|
|
46
46
|
respond_to do |format|
|
47
47
|
if @user.save
|
@@ -60,7 +60,7 @@ class UsersController < ApplicationController
|
|
60
60
|
@user = User.find(params[:id])
|
61
61
|
|
62
62
|
respond_to do |format|
|
63
|
-
if @user.update_attributes(
|
63
|
+
if @user.update_attributes(user_params)
|
64
64
|
format.html { redirect_to @user, notice: 'User was successfully updated.' }
|
65
65
|
format.json { head :no_content }
|
66
66
|
else
|
@@ -81,4 +81,10 @@ class UsersController < ApplicationController
|
|
81
81
|
format.json { head :no_content }
|
82
82
|
end
|
83
83
|
end
|
84
|
+
|
85
|
+
private
|
86
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
87
|
+
def user_params
|
88
|
+
params.require(:user).permit(:name)
|
89
|
+
end
|
84
90
|
end
|
data/spec/dummy/bin/rake
ADDED
data/spec/dummy/config.ru
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
3
|
# Pick the frameworks you want:
|
4
|
-
# require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
9
|
-
# require 'rails/test_unit/railtie'
|
4
|
+
# require "active_record/railtie"
|
5
|
+
require "action_controller/railtie"
|
6
|
+
require "action_mailer/railtie"
|
7
|
+
require "sprockets/railtie"
|
8
|
+
# require "rails/test_unit/railtie"
|
10
9
|
|
11
|
-
Bundler.require
|
12
|
-
require
|
10
|
+
Bundler.require(*Rails.groups)
|
11
|
+
require "media_magick"
|
13
12
|
|
14
13
|
module Dummy
|
15
14
|
class Application < Rails::Application
|
@@ -17,16 +16,6 @@ module Dummy
|
|
17
16
|
# Application configuration should go into files in config/initializers
|
18
17
|
# -- all .rb files in that directory are automatically loaded.
|
19
18
|
|
20
|
-
# Custom directories with classes and modules you want to be autoloadable.
|
21
|
-
# config.autoload_paths += %W(#{config.root}/extras)
|
22
|
-
|
23
|
-
# Only load the plugins named here, in the order given (default is alphabetical).
|
24
|
-
# :all can be used as a placeholder for all plugins not explicitly named.
|
25
|
-
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
26
|
-
|
27
|
-
# Activate observers that should always be running.
|
28
|
-
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
29
|
-
|
30
19
|
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
31
20
|
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
32
21
|
# config.time_zone = 'Central Time (US & Canada)'
|
@@ -34,29 +23,5 @@ module Dummy
|
|
34
23
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
35
24
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
36
25
|
# config.i18n.default_locale = :de
|
37
|
-
|
38
|
-
# Configure the default encoding used in templates for Ruby 1.9.
|
39
|
-
config.encoding = "utf-8"
|
40
|
-
|
41
|
-
# Configure sensitive parameters which will be filtered from the log file.
|
42
|
-
config.filter_parameters += [:password]
|
43
|
-
|
44
|
-
# Use SQL instead of Active Record's schema dumper when creating the database.
|
45
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
46
|
-
# like if you have constraints or database-specific column types
|
47
|
-
# config.active_record.schema_format = :sql
|
48
|
-
|
49
|
-
# Enforce whitelist mode for mass assignment.
|
50
|
-
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
51
|
-
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
52
|
-
# parameters by using an attr_accessible or attr_protected declaration.
|
53
|
-
# config.active_record.whitelist_attributes = true
|
54
|
-
|
55
|
-
# Enable the asset pipeline
|
56
|
-
config.assets.enabled = true
|
57
|
-
|
58
|
-
# Version of your assets, change this if you want to expire all your assets
|
59
|
-
config.assets.version = '1.0'
|
60
26
|
end
|
61
27
|
end
|
62
|
-
|
data/spec/dummy/config/boot.rb
CHANGED
@@ -1,10 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# Set up gems listed in the Gemfile.
|
2
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
|
3
3
|
|
4
|
-
if File.
|
5
|
-
|
6
|
-
require 'bundler'
|
7
|
-
Bundler.setup
|
8
|
-
end
|
9
|
-
|
10
|
-
$:.unshift File.expand_path('../../../../lib', __FILE__)
|
4
|
+
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
5
|
+
$LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
|
@@ -1,31 +1,27 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
5
|
# every request. This slows down response time but is perfect for development
|
6
6
|
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
|
-
#
|
10
|
-
config.
|
9
|
+
# Do not eager load code on boot.
|
10
|
+
config.eager_load = false
|
11
11
|
|
12
|
-
# Show full error reports and disable caching
|
12
|
+
# Show full error reports and disable caching.
|
13
13
|
config.consider_all_requests_local = true
|
14
14
|
config.action_controller.perform_caching = false
|
15
15
|
|
16
|
-
# Don't care if the mailer can't send
|
16
|
+
# Don't care if the mailer can't send.
|
17
17
|
config.action_mailer.raise_delivery_errors = false
|
18
18
|
|
19
|
-
# Print deprecation notices to the Rails logger
|
19
|
+
# Print deprecation notices to the Rails logger.
|
20
20
|
config.active_support.deprecation = :log
|
21
21
|
|
22
|
-
# Only use best-standards-support built into browsers
|
23
|
-
config.action_dispatch.best_standards_support = :builtin
|
24
|
-
|
25
|
-
# Do not compress assets
|
26
|
-
config.assets.compress = false
|
27
|
-
|
28
|
-
# Expands the lines which load the assets
|
29
|
-
config.assets.debug = false #true
|
30
22
|
|
23
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
24
|
+
# This option may cause significant delays in view rendering with a large
|
25
|
+
# number of complex assets.
|
26
|
+
config.assets.debug = true
|
31
27
|
end
|
@@ -1,67 +1,80 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
|
-
# Code is not reloaded between requests
|
4
|
+
# Code is not reloaded between requests.
|
5
5
|
config.cache_classes = true
|
6
6
|
|
7
|
-
#
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both thread web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
8
14
|
config.consider_all_requests_local = false
|
9
15
|
config.action_controller.perform_caching = true
|
10
16
|
|
11
|
-
#
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
|
20
|
+
# config.action_dispatch.rack_cache = true
|
21
|
+
|
22
|
+
# Disable Rails's static asset server (Apache or nginx will already do this).
|
12
23
|
config.serve_static_assets = false
|
13
24
|
|
14
|
-
# Compress JavaScripts and CSS
|
15
|
-
config.assets.
|
25
|
+
# Compress JavaScripts and CSS.
|
26
|
+
config.assets.js_compressor = :uglifier
|
27
|
+
# config.assets.css_compressor = :sass
|
16
28
|
|
17
|
-
#
|
29
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
18
30
|
config.assets.compile = false
|
19
31
|
|
20
|
-
# Generate digests for assets URLs
|
32
|
+
# Generate digests for assets URLs.
|
21
33
|
config.assets.digest = true
|
22
34
|
|
23
|
-
#
|
24
|
-
|
35
|
+
# Version of your assets, change this if you want to expire all your assets.
|
36
|
+
config.assets.version = '1.0'
|
25
37
|
|
26
|
-
# Specifies the header that your server uses for sending files
|
38
|
+
# Specifies the header that your server uses for sending files.
|
27
39
|
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
40
|
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
41
|
|
30
42
|
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
43
|
# config.force_ssl = true
|
32
44
|
|
33
|
-
#
|
34
|
-
|
45
|
+
# Set to :debug to see everything in the log.
|
46
|
+
config.log_level = :info
|
35
47
|
|
36
|
-
# Prepend all log lines with the following tags
|
48
|
+
# Prepend all log lines with the following tags.
|
37
49
|
# config.log_tags = [ :subdomain, :uuid ]
|
38
50
|
|
39
|
-
# Use a different logger for distributed setups
|
51
|
+
# Use a different logger for distributed setups.
|
40
52
|
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
53
|
|
42
|
-
# Use a different cache store in production
|
54
|
+
# Use a different cache store in production.
|
43
55
|
# config.cache_store = :mem_cache_store
|
44
56
|
|
45
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
57
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
46
58
|
# config.action_controller.asset_host = "http://assets.example.com"
|
47
59
|
|
48
|
-
# Precompile additional assets
|
60
|
+
# Precompile additional assets.
|
61
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
49
62
|
# config.assets.precompile += %w( search.js )
|
50
63
|
|
51
|
-
#
|
64
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
65
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
52
66
|
# config.action_mailer.raise_delivery_errors = false
|
53
67
|
|
54
|
-
# Enable threaded mode
|
55
|
-
# config.threadsafe!
|
56
|
-
|
57
68
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
-
# the I18n.default_locale when a translation can not be found)
|
69
|
+
# the I18n.default_locale when a translation can not be found).
|
59
70
|
config.i18n.fallbacks = true
|
60
71
|
|
61
|
-
# Send deprecation notices to registered listeners
|
72
|
+
# Send deprecation notices to registered listeners.
|
62
73
|
config.active_support.deprecation = :notify
|
63
74
|
|
64
|
-
#
|
65
|
-
#
|
66
|
-
|
75
|
+
# Disable automatic flushing of the log to improve performance.
|
76
|
+
# config.autoflush_log = false
|
77
|
+
|
78
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
79
|
+
config.log_formatter = ::Logger::Formatter.new
|
67
80
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
5
|
# test suite. You never need to work with it otherwise. Remember that
|
@@ -7,28 +7,30 @@ Dummy::Application.configure do
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
11
|
-
|
12
|
-
|
10
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
13
14
|
|
14
|
-
#
|
15
|
-
config.
|
15
|
+
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_assets = true
|
17
|
+
config.static_cache_control = "public, max-age=3600"
|
16
18
|
|
17
|
-
# Show full error reports and disable caching
|
19
|
+
# Show full error reports and disable caching.
|
18
20
|
config.consider_all_requests_local = true
|
19
21
|
config.action_controller.perform_caching = false
|
20
22
|
|
21
|
-
# Raise exceptions instead of rendering exception templates
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
22
24
|
config.action_dispatch.show_exceptions = false
|
23
25
|
|
24
|
-
# Disable request forgery protection in test environment
|
25
|
-
config.action_controller.allow_forgery_protection
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
26
28
|
|
27
29
|
# Tell Action Mailer not to deliver emails to the real world.
|
28
30
|
# The :test delivery method accumulates sent emails in the
|
29
31
|
# ActionMailer::Base.deliveries array.
|
30
32
|
config.action_mailer.delivery_method = :test
|
31
33
|
|
32
|
-
# Print deprecation notices to the stderr
|
34
|
+
# Print deprecation notices to the stderr.
|
33
35
|
config.active_support.deprecation = :stderr
|
34
36
|
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Add new inflection rules using the following format
|
4
|
-
#
|
5
|
-
#
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
6
7
|
# inflect.plural /^(ox)$/i, '\1en'
|
7
8
|
# inflect.singular /^(ox)en/i, '\1'
|
8
9
|
# inflect.irregular 'person', 'people'
|
9
10
|
# inflect.uncountable %w( fish sheep )
|
10
11
|
# end
|
11
|
-
|
12
|
+
|
12
13
|
# These inflection rules are supported but not enabled by default:
|
13
|
-
# ActiveSupport::Inflector.inflections do |inflect|
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
14
15
|
# inflect.acronym 'RESTful'
|
15
16
|
# end
|
@@ -1,7 +1,12 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
# Your secret key for verifying the integrity of signed cookies.
|
3
|
+
# Your secret key is used for verifying the integrity of signed cookies.
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
|
5
6
|
# Make sure the secret is at least 30 characters and all random,
|
6
7
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
|
8
|
+
# You can use `rake secret` to generate a secure secret key.
|
9
|
+
|
10
|
+
# Make sure your secret_key_base is kept private
|
11
|
+
# if you're sharing your code publicly.
|
12
|
+
Dummy::Application.config.secret_key_base = '86950f41ac18916d081e5ce66f46d4ac7e1a449f8d06afbf8fa8fb0810984bdaaae156bda397ce903d3894a935c219ffbf907f6feb82404d769fceedd60ae004'
|
@@ -1,8 +1,3 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
3
|
Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
|
4
|
-
|
5
|
-
# Use the database for sessions instead of the cookie-based default,
|
6
|
-
# which shouldn't be used to store highly confidential information
|
7
|
-
# (create the session table with "rails generate session_migration")
|
8
|
-
# Dummy::Application.config.session_store :active_record_store
|
@@ -1,14 +1,9 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
|
-
|
2
|
+
|
3
3
|
# This file contains settings for ActionController::ParamsWrapper which
|
4
4
|
# is enabled by default.
|
5
5
|
|
6
6
|
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
7
|
ActiveSupport.on_load(:action_controller) do
|
8
|
-
wrap_parameters format: [:json]
|
9
|
-
end
|
10
|
-
|
11
|
-
# Disable root element in JSON by default.
|
12
|
-
ActiveSupport.on_load(:active_record) do
|
13
|
-
self.include_root_in_json = false
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
14
9
|
end
|
data/spec/dummy/config/routes.rb
CHANGED
data/spec/dummy/public/404.html
CHANGED
@@ -2,17 +2,48 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
-
<style
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
background-color: #EFEFEF;
|
8
|
+
color: #2E2F30;
|
9
|
+
text-align: center;
|
10
|
+
font-family: arial, sans-serif;
|
11
|
+
}
|
12
|
+
|
13
|
+
div.dialog {
|
14
|
+
width: 25em;
|
15
|
+
margin: 4em auto 0 auto;
|
16
|
+
border: 1px solid #CCC;
|
17
|
+
border-right-color: #999;
|
18
|
+
border-left-color: #999;
|
19
|
+
border-bottom-color: #BBB;
|
20
|
+
border-top: #B00100 solid 4px;
|
21
|
+
border-top-left-radius: 9px;
|
22
|
+
border-top-right-radius: 9px;
|
23
|
+
background-color: white;
|
24
|
+
padding: 7px 4em 0 4em;
|
25
|
+
}
|
26
|
+
|
27
|
+
h1 {
|
28
|
+
font-size: 100%;
|
29
|
+
color: #730E15;
|
30
|
+
line-height: 1.5em;
|
31
|
+
}
|
32
|
+
|
33
|
+
body > p {
|
34
|
+
width: 33em;
|
35
|
+
margin: 0 auto 1em;
|
36
|
+
padding: 1em 0;
|
37
|
+
background-color: #F7F7F7;
|
38
|
+
border: 1px solid #CCC;
|
39
|
+
border-right-color: #999;
|
40
|
+
border-bottom-color: #999;
|
41
|
+
border-bottom-left-radius: 4px;
|
42
|
+
border-bottom-right-radius: 4px;
|
43
|
+
border-top-color: #DADADA;
|
44
|
+
color: #666;
|
45
|
+
box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
|
46
|
+
}
|
16
47
|
</style>
|
17
48
|
</head>
|
18
49
|
|
@@ -22,5 +53,6 @@
|
|
22
53
|
<h1>The page you were looking for doesn't exist.</h1>
|
23
54
|
<p>You may have mistyped the address or the page may have moved.</p>
|
24
55
|
</div>
|
56
|
+
<p>If you are the application owner check the logs for more information.</p>
|
25
57
|
</body>
|
26
58
|
</html>
|
data/spec/dummy/public/422.html
CHANGED
@@ -2,17 +2,48 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>The change you wanted was rejected (422)</title>
|
5
|
-
<style
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
background-color: #EFEFEF;
|
8
|
+
color: #2E2F30;
|
9
|
+
text-align: center;
|
10
|
+
font-family: arial, sans-serif;
|
11
|
+
}
|
12
|
+
|
13
|
+
div.dialog {
|
14
|
+
width: 25em;
|
15
|
+
margin: 4em auto 0 auto;
|
16
|
+
border: 1px solid #CCC;
|
17
|
+
border-right-color: #999;
|
18
|
+
border-left-color: #999;
|
19
|
+
border-bottom-color: #BBB;
|
20
|
+
border-top: #B00100 solid 4px;
|
21
|
+
border-top-left-radius: 9px;
|
22
|
+
border-top-right-radius: 9px;
|
23
|
+
background-color: white;
|
24
|
+
padding: 7px 4em 0 4em;
|
25
|
+
}
|
26
|
+
|
27
|
+
h1 {
|
28
|
+
font-size: 100%;
|
29
|
+
color: #730E15;
|
30
|
+
line-height: 1.5em;
|
31
|
+
}
|
32
|
+
|
33
|
+
body > p {
|
34
|
+
width: 33em;
|
35
|
+
margin: 0 auto 1em;
|
36
|
+
padding: 1em 0;
|
37
|
+
background-color: #F7F7F7;
|
38
|
+
border: 1px solid #CCC;
|
39
|
+
border-right-color: #999;
|
40
|
+
border-bottom-color: #999;
|
41
|
+
border-bottom-left-radius: 4px;
|
42
|
+
border-bottom-right-radius: 4px;
|
43
|
+
border-top-color: #DADADA;
|
44
|
+
color: #666;
|
45
|
+
box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
|
46
|
+
}
|
16
47
|
</style>
|
17
48
|
</head>
|
18
49
|
|
@@ -22,5 +53,6 @@
|
|
22
53
|
<h1>The change you wanted was rejected.</h1>
|
23
54
|
<p>Maybe you tried to change something you didn't have access to.</p>
|
24
55
|
</div>
|
56
|
+
<p>If you are the application owner check the logs for more information.</p>
|
25
57
|
</body>
|
26
58
|
</html>
|
data/spec/dummy/public/500.html
CHANGED
@@ -2,17 +2,48 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>We're sorry, but something went wrong (500)</title>
|
5
|
-
<style
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
5
|
+
<style>
|
6
|
+
body {
|
7
|
+
background-color: #EFEFEF;
|
8
|
+
color: #2E2F30;
|
9
|
+
text-align: center;
|
10
|
+
font-family: arial, sans-serif;
|
11
|
+
}
|
12
|
+
|
13
|
+
div.dialog {
|
14
|
+
width: 25em;
|
15
|
+
margin: 4em auto 0 auto;
|
16
|
+
border: 1px solid #CCC;
|
17
|
+
border-right-color: #999;
|
18
|
+
border-left-color: #999;
|
19
|
+
border-bottom-color: #BBB;
|
20
|
+
border-top: #B00100 solid 4px;
|
21
|
+
border-top-left-radius: 9px;
|
22
|
+
border-top-right-radius: 9px;
|
23
|
+
background-color: white;
|
24
|
+
padding: 7px 4em 0 4em;
|
25
|
+
}
|
26
|
+
|
27
|
+
h1 {
|
28
|
+
font-size: 100%;
|
29
|
+
color: #730E15;
|
30
|
+
line-height: 1.5em;
|
31
|
+
}
|
32
|
+
|
33
|
+
body > p {
|
34
|
+
width: 33em;
|
35
|
+
margin: 0 auto 1em;
|
36
|
+
padding: 1em 0;
|
37
|
+
background-color: #F7F7F7;
|
38
|
+
border: 1px solid #CCC;
|
39
|
+
border-right-color: #999;
|
40
|
+
border-bottom-color: #999;
|
41
|
+
border-bottom-left-radius: 4px;
|
42
|
+
border-bottom-right-radius: 4px;
|
43
|
+
border-top-color: #DADADA;
|
44
|
+
color: #666;
|
45
|
+
box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
|
46
|
+
}
|
16
47
|
</style>
|
17
48
|
</head>
|
18
49
|
|
@@ -21,5 +52,6 @@
|
|
21
52
|
<div class="dialog">
|
22
53
|
<h1>We're sorry, but something went wrong.</h1>
|
23
54
|
</div>
|
55
|
+
<p>If you are the application owner check the logs for more information.</p>
|
24
56
|
</body>
|
25
57
|
</html>
|
data/spec/routing/attach_spec.rb
CHANGED
@@ -2,23 +2,23 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe 'routes for Attach' do
|
4
4
|
it 'routes /upload to create action' do
|
5
|
-
|
5
|
+
post('/upload').should route_to('media_magick/attach#create')
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'routes /remove to destroy action' do
|
9
|
-
|
9
|
+
delete('/remove').should route_to('media_magick/attach#destroy')
|
10
10
|
end
|
11
11
|
|
12
12
|
it 'routes /update_priority to update_priority action' do
|
13
|
-
|
13
|
+
put('/update_priority').should route_to('media_magick/attach#update_priority')
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'routes /recreate_versions to recreate_versions action' do
|
17
|
-
|
17
|
+
put('/recreate_versions').should route_to('media_magick/attach#recreate_versions')
|
18
18
|
end
|
19
19
|
|
20
20
|
it 'routes recreate_versions_path to recreate_versions action' do
|
21
|
-
|
21
|
+
put(recreate_versions_path).should route_to('media_magick/attach#recreate_versions')
|
22
22
|
end
|
23
23
|
|
24
24
|
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.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Renan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: carrierwave
|
@@ -25,48 +25,34 @@ dependencies:
|
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 0.9.0
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: mongoid
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - '>='
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: 2.7.0
|
35
|
-
type: :runtime
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - '>='
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: 2.7.0
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: plupload-rails
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
45
31
|
requirements:
|
46
32
|
- - ~>
|
47
33
|
- !ruby/object:Gem::Version
|
48
|
-
version: 1.0
|
34
|
+
version: 1.1.0
|
49
35
|
type: :runtime
|
50
36
|
prerelease: false
|
51
37
|
version_requirements: !ruby/object:Gem::Requirement
|
52
38
|
requirements:
|
53
39
|
- - ~>
|
54
40
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.0
|
41
|
+
version: 1.1.0
|
56
42
|
- !ruby/object:Gem::Dependency
|
57
43
|
name: rails
|
58
44
|
requirement: !ruby/object:Gem::Requirement
|
59
45
|
requirements:
|
60
46
|
- - ~>
|
61
47
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
48
|
+
version: 4.0.0
|
63
49
|
type: :runtime
|
64
50
|
prerelease: false
|
65
51
|
version_requirements: !ruby/object:Gem::Requirement
|
66
52
|
requirements:
|
67
53
|
- - ~>
|
68
54
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
55
|
+
version: 4.0.0
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
57
|
name: mini_magick
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,56 +87,56 @@ dependencies:
|
|
101
87
|
requirements:
|
102
88
|
- - ~>
|
103
89
|
- !ruby/object:Gem::Version
|
104
|
-
version: 2.
|
90
|
+
version: 2.14.0
|
105
91
|
type: :development
|
106
92
|
prerelease: false
|
107
93
|
version_requirements: !ruby/object:Gem::Requirement
|
108
94
|
requirements:
|
109
95
|
- - ~>
|
110
96
|
- !ruby/object:Gem::Version
|
111
|
-
version: 2.
|
97
|
+
version: 2.14.0
|
112
98
|
- !ruby/object:Gem::Dependency
|
113
99
|
name: simplecov
|
114
100
|
requirement: !ruby/object:Gem::Requirement
|
115
101
|
requirements:
|
116
102
|
- - ~>
|
117
103
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.7.
|
104
|
+
version: 0.7.0
|
119
105
|
type: :development
|
120
106
|
prerelease: false
|
121
107
|
version_requirements: !ruby/object:Gem::Requirement
|
122
108
|
requirements:
|
123
109
|
- - ~>
|
124
110
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.7.
|
111
|
+
version: 0.7.0
|
126
112
|
- !ruby/object:Gem::Dependency
|
127
113
|
name: guard-rspec
|
128
114
|
requirement: !ruby/object:Gem::Requirement
|
129
115
|
requirements:
|
130
116
|
- - ~>
|
131
117
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
118
|
+
version: 4.0.0
|
133
119
|
type: :development
|
134
120
|
prerelease: false
|
135
121
|
version_requirements: !ruby/object:Gem::Requirement
|
136
122
|
requirements:
|
137
123
|
- - ~>
|
138
124
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
125
|
+
version: 4.0.0
|
140
126
|
- !ruby/object:Gem::Dependency
|
141
127
|
name: rb-fsevent
|
142
128
|
requirement: !ruby/object:Gem::Requirement
|
143
129
|
requirements:
|
144
130
|
- - ~>
|
145
131
|
- !ruby/object:Gem::Version
|
146
|
-
version: 0.9.
|
132
|
+
version: 0.9.0
|
147
133
|
type: :development
|
148
134
|
prerelease: false
|
149
135
|
version_requirements: !ruby/object:Gem::Requirement
|
150
136
|
requirements:
|
151
137
|
- - ~>
|
152
138
|
- !ruby/object:Gem::Version
|
153
|
-
version: 0.9.
|
139
|
+
version: 0.9.0
|
154
140
|
description: MediaMagick aims to make dealing with multimedia resources a very easy
|
155
141
|
task – like magic.
|
156
142
|
email:
|
@@ -184,7 +170,7 @@ files:
|
|
184
170
|
- config/locales/en.yml
|
185
171
|
- config/locales/pt-BR.yml
|
186
172
|
- config/routes.rb
|
187
|
-
- gemfiles/mongoid-
|
173
|
+
- gemfiles/mongoid-master.gemfile
|
188
174
|
- lib/carrierwave/mongoid.rb
|
189
175
|
- lib/media_magick.rb
|
190
176
|
- lib/media_magick/attachment_uploader.rb
|
@@ -242,6 +228,9 @@ files:
|
|
242
228
|
- spec/dummy/app/views/users/index.html.erb
|
243
229
|
- spec/dummy/app/views/users/new.html.erb
|
244
230
|
- spec/dummy/app/views/users/show.html.erb
|
231
|
+
- spec/dummy/bin/bundle
|
232
|
+
- spec/dummy/bin/rails
|
233
|
+
- spec/dummy/bin/rake
|
245
234
|
- spec/dummy/config.ru
|
246
235
|
- spec/dummy/config/application.rb
|
247
236
|
- spec/dummy/config/boot.rb
|
@@ -250,6 +239,7 @@ files:
|
|
250
239
|
- spec/dummy/config/environments/production.rb
|
251
240
|
- spec/dummy/config/environments/test.rb
|
252
241
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
242
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
253
243
|
- spec/dummy/config/initializers/inflections.rb
|
254
244
|
- spec/dummy/config/initializers/mime_types.rb
|
255
245
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -259,7 +249,6 @@ files:
|
|
259
249
|
- spec/dummy/config/mongoid.yml
|
260
250
|
- spec/dummy/config/routes.rb
|
261
251
|
- spec/dummy/lib/assets/.gitkeep
|
262
|
-
- spec/dummy/log/.gitkeep
|
263
252
|
- spec/dummy/public/404.html
|
264
253
|
- spec/dummy/public/422.html
|
265
254
|
- spec/dummy/public/500.html
|
@@ -297,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
297
286
|
version: '0'
|
298
287
|
requirements: []
|
299
288
|
rubyforge_project:
|
300
|
-
rubygems_version: 2.
|
289
|
+
rubygems_version: 2.1.10
|
301
290
|
signing_key:
|
302
291
|
specification_version: 4
|
303
292
|
summary: MediaMagick aims to make dealing with multimedia resources a very easy task
|
@@ -349,6 +338,9 @@ test_files:
|
|
349
338
|
- spec/dummy/app/views/users/index.html.erb
|
350
339
|
- spec/dummy/app/views/users/new.html.erb
|
351
340
|
- spec/dummy/app/views/users/show.html.erb
|
341
|
+
- spec/dummy/bin/bundle
|
342
|
+
- spec/dummy/bin/rails
|
343
|
+
- spec/dummy/bin/rake
|
352
344
|
- spec/dummy/config.ru
|
353
345
|
- spec/dummy/config/application.rb
|
354
346
|
- spec/dummy/config/boot.rb
|
@@ -357,6 +349,7 @@ test_files:
|
|
357
349
|
- spec/dummy/config/environments/production.rb
|
358
350
|
- spec/dummy/config/environments/test.rb
|
359
351
|
- spec/dummy/config/initializers/backtrace_silencers.rb
|
352
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
360
353
|
- spec/dummy/config/initializers/inflections.rb
|
361
354
|
- spec/dummy/config/initializers/mime_types.rb
|
362
355
|
- spec/dummy/config/initializers/secret_token.rb
|
@@ -366,7 +359,6 @@ test_files:
|
|
366
359
|
- spec/dummy/config/mongoid.yml
|
367
360
|
- spec/dummy/config/routes.rb
|
368
361
|
- spec/dummy/lib/assets/.gitkeep
|
369
|
-
- spec/dummy/log/.gitkeep
|
370
362
|
- spec/dummy/public/404.html
|
371
363
|
- spec/dummy/public/422.html
|
372
364
|
- spec/dummy/public/500.html
|
data/spec/dummy/log/.gitkeep
DELETED
File without changes
|