uploader 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +1 -1
- data/Rakefile +3 -3
- data/VERSION +1 -1
- data/lib/uploader/config.rb +2 -2
- data/lib/uploader/engine.rb +4 -0
- data/test/rails_test/Gemfile.lock +1 -1
- data/test/rails_test/Rakefile +2 -0
- data/test/rails_test/config/application.rb +0 -4
- data/test/rails_test/db/schema.rb +47 -0
- data/test/rails_test/test/functional/uploads_controller_test.rb +19 -6
- data/test/rails_test/test/unit/user_test.rb +26 -0
- data/uploader.gemspec +6 -5
- metadata +7 -6
- data/test/rails_test/config/global_config.yml +0 -18
- data/test/rails_test/vendor/plugins/.gitkeep +0 -0
data/README.rdoc
CHANGED
@@ -36,7 +36,7 @@ Uploader.configure do |config|
|
|
36
36
|
# These are the settings that will be passed to Paperclip:
|
37
37
|
config.has_attached_file_options = {
|
38
38
|
:url => "/system/:attachment/:id_partition/:style/:basename.:extension",
|
39
|
-
:path => ":
|
39
|
+
:path => ":rails_test/public/system/:attachment/:id_partition/:style/:basename.:extension",
|
40
40
|
:styles => { :icon => "30x30!",
|
41
41
|
:thumb => "100>",
|
42
42
|
:small => "150>",
|
data/Rakefile
CHANGED
@@ -8,8 +8,8 @@ task :default => :test
|
|
8
8
|
desc 'Test the uploader gem.'
|
9
9
|
Rake::TestTask.new(:test) do |t|
|
10
10
|
t.libs << 'lib'
|
11
|
-
t.libs << 'test/
|
12
|
-
t.pattern = 'test/
|
11
|
+
t.libs << 'test/rails_test/test'
|
12
|
+
t.pattern = 'test/rails_test/test/**/*_test.rb'
|
13
13
|
t.verbose = true
|
14
14
|
end
|
15
15
|
|
@@ -37,7 +37,7 @@ begin
|
|
37
37
|
gemspec.homepage = "http://github.com/jbasdf/uploader"
|
38
38
|
gemspec.description = "Uploader gem that makes it simple add multiple file uploads to your Rails project using SWFUpload, Uploadify and Paperclip"
|
39
39
|
gemspec.authors = ["Justin Ball", "Joel Duffin", "David South"]
|
40
|
-
gemspec.files.include %w( test/
|
40
|
+
gemspec.files.include %w( test/rails_test/db/schema.rb )
|
41
41
|
gemspec.rubyforge_project = 'uploader'
|
42
42
|
gemspec.add_dependency "mime-types"
|
43
43
|
gemspec.add_dependency "rack"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.1
|
data/lib/uploader/config.rb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
# config.keep_local_file = true
|
8
8
|
# config.has_attached_file_options = {
|
9
9
|
# :url => "/system/:attachment/:id_partition/:style/:basename.:extension",
|
10
|
-
# :path => ":
|
10
|
+
# :path => ":rails_test/public/system/:attachment/:id_partition/:style/:basename.:extension",
|
11
11
|
# :styles => { :icon => "30x30!",
|
12
12
|
# :thumb => "100>",
|
13
13
|
# :small => "150>",
|
@@ -49,7 +49,7 @@ module Uploader
|
|
49
49
|
@disable_halt_nonimage_processing = false
|
50
50
|
@has_attached_file_options = {
|
51
51
|
:url => "/system/:attachment/:id_partition/:style/:basename.:extension",
|
52
|
-
:path => ":
|
52
|
+
:path => ":rails_test/public/system/:attachment/:id_partition/:style/:basename.:extension",
|
53
53
|
:styles => { :icon => "30x30!",
|
54
54
|
:thumb => "100>",
|
55
55
|
:small => "150>",
|
data/lib/uploader/engine.rb
CHANGED
@@ -4,6 +4,10 @@ require 'rails'
|
|
4
4
|
module Uploader
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
|
7
|
+
def muck_name
|
8
|
+
'uploader'
|
9
|
+
end
|
10
|
+
|
7
11
|
initializer "uploader.add_middleware" do |app|
|
8
12
|
app.middleware.insert_before(ActionDispatch::Session::CookieStore,
|
9
13
|
Uploader::FlashSessionCookieMiddleware,
|
data/test/rails_test/Rakefile
CHANGED
@@ -6,10 +6,6 @@ require 'rails/all'
|
|
6
6
|
# you've limited to :test, :development, or :production.
|
7
7
|
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
8
|
|
9
|
-
require 'ostruct'
|
10
|
-
require 'yaml'
|
11
|
-
::GlobalConfig = OpenStruct.new(YAML.load_file(File.expand_path('../global_config.yml', __FILE__))[Rails.env])
|
12
|
-
|
13
9
|
module RailsTest
|
14
10
|
class Application < Rails::Application
|
15
11
|
# Settings in config/environments/* take precedence over those specified here.
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# This file is auto-generated from the current state of the database. Instead of editing this file,
|
2
|
+
# please use the migrations feature of Active Record to incrementally modify your database, and
|
3
|
+
# then regenerate this schema definition.
|
4
|
+
#
|
5
|
+
# Note that this schema.rb definition is the authoritative source for your database schema. If you need
|
6
|
+
# to create the application database on another system, you should be using db:schema:load, not running
|
7
|
+
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
8
|
+
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
9
|
+
#
|
10
|
+
# It's strongly recommended to check this file into your version control system.
|
11
|
+
|
12
|
+
ActiveRecord::Schema.define(:version => 20090602041838) do
|
13
|
+
|
14
|
+
create_table "uploads", :force => true do |t|
|
15
|
+
t.integer "creator_id"
|
16
|
+
t.string "name"
|
17
|
+
t.string "caption", :limit => 1000
|
18
|
+
t.text "description"
|
19
|
+
t.boolean "is_public", :default => true
|
20
|
+
t.integer "uploadable_id"
|
21
|
+
t.string "uploadable_type"
|
22
|
+
t.string "width"
|
23
|
+
t.string "height"
|
24
|
+
t.string "local_file_name"
|
25
|
+
t.string "local_content_type"
|
26
|
+
t.integer "local_file_size"
|
27
|
+
t.datetime "local_updated_at"
|
28
|
+
t.string "remote_file_name"
|
29
|
+
t.string "remote_content_type"
|
30
|
+
t.integer "remote_file_size"
|
31
|
+
t.datetime "remote_updated_at"
|
32
|
+
t.datetime "created_at"
|
33
|
+
t.datetime "updated_at"
|
34
|
+
end
|
35
|
+
|
36
|
+
add_index "uploads", ["creator_id"], :name => "index_uploads_on_creator_id"
|
37
|
+
add_index "uploads", ["local_content_type"], :name => "index_uploads_on_local_content_type"
|
38
|
+
add_index "uploads", ["uploadable_id"], :name => "index_uploads_on_uploadable_id"
|
39
|
+
add_index "uploads", ["uploadable_type"], :name => "index_uploads_on_uploadable_type"
|
40
|
+
|
41
|
+
create_table "users", :force => true do |t|
|
42
|
+
t.string "name"
|
43
|
+
t.datetime "created_at"
|
44
|
+
t.datetime "updated_at"
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -91,13 +91,26 @@ class UploadsControllerTest < ActionController::TestCase
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
context 'on POST to :multiupload' do
|
94
|
-
|
95
|
-
|
94
|
+
context 'js' do
|
95
|
+
setup do
|
96
|
+
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'js' }
|
97
|
+
end
|
98
|
+
should respond_with :success
|
99
|
+
should "add an upload" do
|
100
|
+
assert_difference "Upload.count", 1 do
|
101
|
+
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'js' }
|
102
|
+
end
|
103
|
+
end
|
96
104
|
end
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
105
|
+
context 'json' do
|
106
|
+
setup do
|
107
|
+
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'json' }
|
108
|
+
end
|
109
|
+
should respond_with :success
|
110
|
+
should "add an upload" do
|
111
|
+
assert_difference "Upload.count", 1 do
|
112
|
+
post :multiupload, { :Filedata => VALID_FILE, :parent_type => 'User', :parent_id => @user.to_param, :format => 'json' }
|
113
|
+
end
|
101
114
|
end
|
102
115
|
end
|
103
116
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
|
3
|
+
class UserTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
context "user" do
|
6
|
+
|
7
|
+
context 'user instance' do
|
8
|
+
setup do
|
9
|
+
@user = Factory(:user)
|
10
|
+
end
|
11
|
+
|
12
|
+
should have_many :uploads
|
13
|
+
|
14
|
+
should 'be able to upload' do
|
15
|
+
assert @user.can_upload?(@user)
|
16
|
+
end
|
17
|
+
|
18
|
+
should 'not have methods from uploader mixin' do
|
19
|
+
assert !defined?(User.is_public)
|
20
|
+
assert !defined?(@user.is_image?)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
data/uploader.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{uploader}
|
8
|
-
s.version = "3.0.
|
8
|
+
s.version = "3.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball", "Joel Duffin", "David South"]
|
12
|
-
s.date = %q{2010-09-
|
12
|
+
s.date = %q{2010-09-16}
|
13
13
|
s.description = %q{Uploader gem that makes it simple add multiple file uploads to your Rails project using SWFUpload, Uploadify and Paperclip}
|
14
14
|
s.email = %q{justinball@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -174,7 +174,6 @@ Gem::Specification.new do |s|
|
|
174
174
|
"test/rails_test/config/environments/development.rb",
|
175
175
|
"test/rails_test/config/environments/production.rb",
|
176
176
|
"test/rails_test/config/environments/test.rb",
|
177
|
-
"test/rails_test/config/global_config.yml",
|
178
177
|
"test/rails_test/config/initializers/backtrace_silencers.rb",
|
179
178
|
"test/rails_test/config/initializers/inflections.rb",
|
180
179
|
"test/rails_test/config/initializers/mime_types.rb",
|
@@ -186,6 +185,7 @@ Gem::Specification.new do |s|
|
|
186
185
|
"test/rails_test/db/.keep",
|
187
186
|
"test/rails_test/db/migrate/20090517040220_create_uploads.rb",
|
188
187
|
"test/rails_test/db/migrate/20090602041838_create_users.rb",
|
188
|
+
"test/rails_test/db/schema.rb",
|
189
189
|
"test/rails_test/db/seeds.rb",
|
190
190
|
"test/rails_test/doc/README_FOR_APP",
|
191
191
|
"test/rails_test/features/step_definitions/webrat_steps.rb",
|
@@ -292,7 +292,7 @@ Gem::Specification.new do |s|
|
|
292
292
|
"test/rails_test/test/test_helper.rb",
|
293
293
|
"test/rails_test/test/unit/.keep",
|
294
294
|
"test/rails_test/test/unit/upload_test.rb",
|
295
|
-
"test/rails_test/
|
295
|
+
"test/rails_test/test/unit/user_test.rb",
|
296
296
|
"uninstall.rb",
|
297
297
|
"uploader.gemspec"
|
298
298
|
]
|
@@ -333,7 +333,8 @@ Gem::Specification.new do |s|
|
|
333
333
|
"test/rails_test/test/performance/browsing_test.rb",
|
334
334
|
"test/rails_test/test/shoulda_macros/paperclip.rb",
|
335
335
|
"test/rails_test/test/test_helper.rb",
|
336
|
-
"test/rails_test/test/unit/upload_test.rb"
|
336
|
+
"test/rails_test/test/unit/upload_test.rb",
|
337
|
+
"test/rails_test/test/unit/user_test.rb"
|
337
338
|
]
|
338
339
|
|
339
340
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uploader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.
|
9
|
+
- 1
|
10
|
+
version: 3.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Ball
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-09-
|
20
|
+
date: 2010-09-16 00:00:00 -06:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -243,7 +243,6 @@ files:
|
|
243
243
|
- test/rails_test/config/environments/development.rb
|
244
244
|
- test/rails_test/config/environments/production.rb
|
245
245
|
- test/rails_test/config/environments/test.rb
|
246
|
-
- test/rails_test/config/global_config.yml
|
247
246
|
- test/rails_test/config/initializers/backtrace_silencers.rb
|
248
247
|
- test/rails_test/config/initializers/inflections.rb
|
249
248
|
- test/rails_test/config/initializers/mime_types.rb
|
@@ -255,6 +254,7 @@ files:
|
|
255
254
|
- test/rails_test/db/.keep
|
256
255
|
- test/rails_test/db/migrate/20090517040220_create_uploads.rb
|
257
256
|
- test/rails_test/db/migrate/20090602041838_create_users.rb
|
257
|
+
- test/rails_test/db/schema.rb
|
258
258
|
- test/rails_test/db/seeds.rb
|
259
259
|
- test/rails_test/doc/README_FOR_APP
|
260
260
|
- test/rails_test/features/step_definitions/webrat_steps.rb
|
@@ -361,7 +361,7 @@ files:
|
|
361
361
|
- test/rails_test/test/test_helper.rb
|
362
362
|
- test/rails_test/test/unit/.keep
|
363
363
|
- test/rails_test/test/unit/upload_test.rb
|
364
|
-
- test/rails_test/
|
364
|
+
- test/rails_test/test/unit/user_test.rb
|
365
365
|
- uninstall.rb
|
366
366
|
- uploader.gemspec
|
367
367
|
has_rdoc: true
|
@@ -430,3 +430,4 @@ test_files:
|
|
430
430
|
- test/rails_test/test/shoulda_macros/paperclip.rb
|
431
431
|
- test/rails_test/test/test_helper.rb
|
432
432
|
- test/rails_test/test/unit/upload_test.rb
|
433
|
+
- test/rails_test/test/unit/user_test.rb
|
@@ -1,18 +0,0 @@
|
|
1
|
-
#The account plugin needs to be configured. The following values may be used to customize the account
|
2
|
-
|
3
|
-
default: &DEFAULT
|
4
|
-
|
5
|
-
application_url: localhost:3000
|
6
|
-
|
7
|
-
# session key information
|
8
|
-
session_key: _uploader_session
|
9
|
-
session_secret: ea55c4d5e105735fdfb1caec46711b3dd14ec976d0ba95b4c0f575cb046cc358bce7a335ee36eb29253fb680ef8b838d871f6baeff48220fee8e9e42ab84774b
|
10
|
-
|
11
|
-
production:
|
12
|
-
<<: *DEFAULT
|
13
|
-
|
14
|
-
development:
|
15
|
-
<<: *DEFAULT
|
16
|
-
|
17
|
-
test:
|
18
|
-
<<: *DEFAULT
|
File without changes
|