card 1.19.3 → 1.19.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/VERSION +1 -1
- data/card.gemspec +1 -3
- data/db/migrate_core_cards/20160914132636_fix_mod_files.rb +25 -0
- data/lib/card.rb +0 -2
- data/lib/card/content/diff.rb +3 -4
- data/lib/card/format/error.rb +1 -1
- data/mod/admin/set/self/admin.rb +2 -2
- data/mod/admin/set/self/trash.rb +9 -3
- data/mod/basic_types/set/type/html.rb +1 -1
- data/mod/bootstrap/set/all/bootstrap/layout.rb +58 -0
- data/mod/bootstrap/spec/set/all/bootstrap/layout_spec.rb +32 -0
- data/mod/carrierwave/lib/carrier_wave/cardmount.rb +0 -2
- data/mod/carrierwave/set/abstract/attachment/upload_cache.rb +2 -1
- data/mod/core/set/all/stages.rb +6 -4
- data/mod/history/lib/card/act.rb +8 -7
- data/mod/history/set/all/history.rb +10 -8
- data/mod/machines/set/abstract/script.rb +1 -1
- data/mod/machines/set/type/css.rb +1 -1
- data/mod/pointer/set/abstract/01_pointer.rb +1 -1
- data/mod/standard/file/credit_image/image-icon.png +0 -0
- data/mod/standard/file/credit_image/image-large.png +0 -0
- data/mod/standard/file/credit_image/image-medium.png +0 -0
- data/mod/standard/file/credit_image/image-small.png +0 -0
- data/mod/standard/file/favicon/image-icon.png +0 -0
- data/mod/standard/file/favicon/image-large.png +0 -0
- data/mod/standard/file/favicon/image-medium.png +0 -0
- data/mod/standard/file/favicon/image-small.png +0 -0
- data/mod/standard/file/logo/image-icon.png +0 -0
- data/mod/standard/file/logo/image-large.png +0 -0
- data/mod/standard/file/logo/image-medium.png +0 -0
- data/mod/standard/file/logo/image-small.png +0 -0
- data/mod/standard/set/self/recent.rb +2 -2
- data/spec/lib/card/diff_spec.rb +9 -9
- metadata +19 -156
- data/vendor/carrierwave/.gitignore +0 -19
- data/vendor/carrierwave/.rubocop.yml +0 -262
- data/vendor/carrierwave/.travis.yml +0 -58
- data/vendor/carrierwave/CHANGELOG.md +0 -81
- data/vendor/carrierwave/CONTRIBUTING.md +0 -37
- data/vendor/carrierwave/Gemfile +0 -5
- data/vendor/carrierwave/README.md +0 -995
- data/vendor/carrierwave/Rakefile +0 -26
- data/vendor/carrierwave/carrierwave.gemspec +0 -45
- data/vendor/carrierwave/cucumber.yml +0 -2
- data/vendor/carrierwave/features/caching.feature +0 -28
- data/vendor/carrierwave/features/download.feature +0 -20
- data/vendor/carrierwave/features/file_storage.feature +0 -37
- data/vendor/carrierwave/features/file_storage_overridden_filename.feature +0 -38
- data/vendor/carrierwave/features/file_storage_overridden_store_dir.feature +0 -38
- data/vendor/carrierwave/features/file_storage_reversing_processor.feature +0 -43
- data/vendor/carrierwave/features/fixtures/bork.txt +0 -1
- data/vendor/carrierwave/features/fixtures/monkey.txt +0 -1
- data/vendor/carrierwave/features/fixtures/upcased_bork.txt +0 -1
- data/vendor/carrierwave/features/mount_activerecord.feature +0 -46
- data/vendor/carrierwave/features/step_definitions/activerecord_steps.rb +0 -20
- data/vendor/carrierwave/features/step_definitions/caching_steps.rb +0 -12
- data/vendor/carrierwave/features/step_definitions/datamapper_steps.rb +0 -27
- data/vendor/carrierwave/features/step_definitions/download_steps.rb +0 -8
- data/vendor/carrierwave/features/step_definitions/file_steps.rb +0 -51
- data/vendor/carrierwave/features/step_definitions/general_steps.rb +0 -102
- data/vendor/carrierwave/features/step_definitions/mount_steps.rb +0 -17
- data/vendor/carrierwave/features/step_definitions/store_steps.rb +0 -16
- data/vendor/carrierwave/features/support/activerecord.rb +0 -18
- data/vendor/carrierwave/features/support/env.rb +0 -19
- data/vendor/carrierwave/features/versions_basics.feature +0 -50
- data/vendor/carrierwave/features/versions_caching_from_versions.feature +0 -32
- data/vendor/carrierwave/features/versions_nested_versions.feature +0 -70
- data/vendor/carrierwave/features/versions_overridden_filename.feature +0 -51
- data/vendor/carrierwave/features/versions_overriden_store_dir.feature +0 -41
- data/vendor/carrierwave/gemfiles/rails-4-0-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-4-1-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-4-2-stable.gemfile +0 -5
- data/vendor/carrierwave/gemfiles/rails-master.gemfile +0 -11
- data/vendor/carrierwave/lib/carrierwave.rb +0 -93
- data/vendor/carrierwave/lib/carrierwave/compatibility/paperclip.rb +0 -103
- data/vendor/carrierwave/lib/carrierwave/error.rb +0 -8
- data/vendor/carrierwave/lib/carrierwave/locale/cs.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/de.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/el.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/en.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/es.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/fr-CA.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/fr.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/id.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/ja.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/nb.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/nl.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pl.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pt-BR.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/pt-PT.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/ru.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/sk.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/tr.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/zh-CN.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/locale/zh-TW.yml +0 -14
- data/vendor/carrierwave/lib/carrierwave/mount.rb +0 -444
- data/vendor/carrierwave/lib/carrierwave/mounter.rb +0 -163
- data/vendor/carrierwave/lib/carrierwave/orm/activerecord.rb +0 -103
- data/vendor/carrierwave/lib/carrierwave/processing.rb +0 -2
- data/vendor/carrierwave/lib/carrierwave/processing/mini_magick.rb +0 -328
- data/vendor/carrierwave/lib/carrierwave/processing/rmagick.rb +0 -379
- data/vendor/carrierwave/lib/carrierwave/sanitized_file.rb +0 -348
- data/vendor/carrierwave/lib/carrierwave/storage.rb +0 -2
- data/vendor/carrierwave/lib/carrierwave/storage/abstract.rb +0 -43
- data/vendor/carrierwave/lib/carrierwave/storage/file.rb +0 -118
- data/vendor/carrierwave/lib/carrierwave/storage/fog.rb +0 -462
- data/vendor/carrierwave/lib/carrierwave/test/matchers.rb +0 -394
- data/vendor/carrierwave/lib/carrierwave/uploader.rb +0 -67
- data/vendor/carrierwave/lib/carrierwave/uploader/cache.rb +0 -207
- data/vendor/carrierwave/lib/carrierwave/uploader/callbacks.rb +0 -33
- data/vendor/carrierwave/lib/carrierwave/uploader/configuration.rb +0 -203
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_blacklist.rb +0 -48
- data/vendor/carrierwave/lib/carrierwave/uploader/content_type_whitelist.rb +0 -48
- data/vendor/carrierwave/lib/carrierwave/uploader/default_url.rb +0 -17
- data/vendor/carrierwave/lib/carrierwave/uploader/download.rb +0 -92
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_blacklist.rb +0 -51
- data/vendor/carrierwave/lib/carrierwave/uploader/extension_whitelist.rb +0 -51
- data/vendor/carrierwave/lib/carrierwave/uploader/file_size.rb +0 -41
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_blacklist.rb +0 -94
- data/vendor/carrierwave/lib/carrierwave/uploader/magic_mime_whitelist.rb +0 -94
- data/vendor/carrierwave/lib/carrierwave/uploader/mountable.rb +0 -38
- data/vendor/carrierwave/lib/carrierwave/uploader/processing.rb +0 -88
- data/vendor/carrierwave/lib/carrierwave/uploader/proxy.rb +0 -86
- data/vendor/carrierwave/lib/carrierwave/uploader/remove.rb +0 -21
- data/vendor/carrierwave/lib/carrierwave/uploader/serialization.rb +0 -28
- data/vendor/carrierwave/lib/carrierwave/uploader/store.rb +0 -93
- data/vendor/carrierwave/lib/carrierwave/uploader/url.rb +0 -41
- data/vendor/carrierwave/lib/carrierwave/uploader/versions.rb +0 -295
- data/vendor/carrierwave/lib/carrierwave/utilities.rb +0 -6
- data/vendor/carrierwave/lib/carrierwave/utilities/uri.rb +0 -21
- data/vendor/carrierwave/lib/carrierwave/validations/active_model.rb +0 -78
- data/vendor/carrierwave/lib/carrierwave/version.rb +0 -3
- data/vendor/carrierwave/lib/generators/templates/uploader.rb +0 -49
- data/vendor/carrierwave/lib/generators/uploader_generator.rb +0 -7
- data/vendor/carrierwave/script/console +0 -10
- data/vendor/carrierwave/script/destroy +0 -14
- data/vendor/carrierwave/script/generate +0 -14
- data/vendor/carrierwave/spec/compatibility/paperclip_spec.rb +0 -138
- data/vendor/carrierwave/spec/fixtures/Uppercase.jpg +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.ttxt +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/bork.txtt +0 -1
- data/vendor/carrierwave/spec/fixtures/case.JPG +0 -1
- data/vendor/carrierwave/spec/fixtures/landscape.jpg +0 -0
- data/vendor/carrierwave/spec/fixtures/multi_page.pdf +0 -0
- data/vendor/carrierwave/spec/fixtures/new.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/new.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/old.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/old.txt +0 -1
- data/vendor/carrierwave/spec/fixtures/portrait.jpg +0 -0
- data/vendor/carrierwave/spec/fixtures/ruby.gif +0 -0
- data/vendor/carrierwave/spec/fixtures/sponsored.doc +0 -1
- data/vendor/carrierwave/spec/fixtures/test+.jpg +0 -1
- data/vendor/carrierwave/spec/fixtures/test.jpeg +0 -1
- data/vendor/carrierwave/spec/fixtures/test.jpg +0 -1
- data/vendor/carrierwave/spec/generators/uploader_generator_spec.rb +0 -19
- data/vendor/carrierwave/spec/mount_multiple_spec.rb +0 -913
- data/vendor/carrierwave/spec/mount_single_spec.rb +0 -793
- data/vendor/carrierwave/spec/orm/activerecord_spec.rb +0 -1556
- data/vendor/carrierwave/spec/processing/mini_magick_spec.rb +0 -210
- data/vendor/carrierwave/spec/processing/rmagick_spec.rb +0 -250
- data/vendor/carrierwave/spec/sanitized_file_spec.rb +0 -805
- data/vendor/carrierwave/spec/spec_helper.rb +0 -105
- data/vendor/carrierwave/spec/storage/file_spec.rb +0 -82
- data/vendor/carrierwave/spec/storage/fog_credentials.rb +0 -46
- data/vendor/carrierwave/spec/storage/fog_helper.rb +0 -428
- data/vendor/carrierwave/spec/storage/fog_spec.rb +0 -48
- data/vendor/carrierwave/spec/support/activerecord.rb +0 -31
- data/vendor/carrierwave/spec/support/file_utils_helper.rb +0 -15
- data/vendor/carrierwave/spec/uploader/cache_spec.rb +0 -324
- data/vendor/carrierwave/spec/uploader/callback_spec.rb +0 -30
- data/vendor/carrierwave/spec/uploader/configuration_spec.rb +0 -133
- data/vendor/carrierwave/spec/uploader/content_type_blacklist_spec.rb +0 -61
- data/vendor/carrierwave/spec/uploader/content_type_whitelist_spec.rb +0 -63
- data/vendor/carrierwave/spec/uploader/default_url_spec.rb +0 -77
- data/vendor/carrierwave/spec/uploader/download_spec.rb +0 -204
- data/vendor/carrierwave/spec/uploader/extension_blacklist_spec.rb +0 -112
- data/vendor/carrierwave/spec/uploader/extension_whitelist_spec.rb +0 -102
- data/vendor/carrierwave/spec/uploader/file_size_spec.rb +0 -52
- data/vendor/carrierwave/spec/uploader/mountable_spec.rb +0 -26
- data/vendor/carrierwave/spec/uploader/overrides_spec.rb +0 -71
- data/vendor/carrierwave/spec/uploader/paths_spec.rb +0 -18
- data/vendor/carrierwave/spec/uploader/processing_spec.rb +0 -159
- data/vendor/carrierwave/spec/uploader/proxy_spec.rb +0 -79
- data/vendor/carrierwave/spec/uploader/remove_spec.rb +0 -71
- data/vendor/carrierwave/spec/uploader/store_spec.rb +0 -400
- data/vendor/carrierwave/spec/uploader/url_spec.rb +0 -273
- data/vendor/carrierwave/spec/uploader/versions_spec.rb +0 -633
data/vendor/carrierwave/Rakefile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
begin
|
3
|
-
require 'bundler/setup'
|
4
|
-
rescue LoadError
|
5
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
-
end
|
7
|
-
|
8
|
-
require 'bundler'
|
9
|
-
Bundler::GemHelper.install_tasks
|
10
|
-
|
11
|
-
require 'rake'
|
12
|
-
require 'rspec/core/rake_task'
|
13
|
-
require 'cucumber'
|
14
|
-
require 'cucumber/rake/task'
|
15
|
-
|
16
|
-
desc "Run all examples"
|
17
|
-
RSpec::Core::RakeTask.new(:spec) do |t|
|
18
|
-
t.rspec_opts = %w[--color]
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "Run cucumber features"
|
22
|
-
Cucumber::Rake::Task.new(:features) do |t|
|
23
|
-
t.cucumber_opts = "features --format progress"
|
24
|
-
end
|
25
|
-
|
26
|
-
task :default => [:spec, :features]
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib/', __FILE__)
|
3
|
-
$:.unshift lib unless $:.include?(lib)
|
4
|
-
|
5
|
-
require 'carrierwave/version'
|
6
|
-
|
7
|
-
Gem::Specification.new do |s|
|
8
|
-
s.name = "carrierwave"
|
9
|
-
s.version = CarrierWave::VERSION
|
10
|
-
|
11
|
-
s.authors = ["Jonas Nicklas"]
|
12
|
-
s.description = "Upload files in your Ruby applications, map them to a range of ORMs, store them on different backends."
|
13
|
-
s.summary = "Ruby file upload library"
|
14
|
-
s.email = ["jonas.nicklas@gmail.com"]
|
15
|
-
s.extra_rdoc_files = ["README.md"]
|
16
|
-
s.files = Dir["{bin,lib}/**/*", "README.md"]
|
17
|
-
s.homepage = %q{https://github.com/carrierwaveuploader/carrierwave}
|
18
|
-
s.rdoc_options = ["--main"]
|
19
|
-
s.require_paths = ["lib"]
|
20
|
-
s.licenses = ["MIT"]
|
21
|
-
|
22
|
-
s.required_ruby_version = ">= 2.0.0"
|
23
|
-
|
24
|
-
s.add_dependency "activesupport", ">= 4.0.0"
|
25
|
-
s.add_dependency "activemodel", ">= 4.0.0"
|
26
|
-
s.add_dependency "mime-types", ">= 1.16"
|
27
|
-
if RUBY_ENGINE == 'jruby'
|
28
|
-
s.add_development_dependency 'activerecord-jdbcpostgresql-adapter'
|
29
|
-
else
|
30
|
-
s.add_development_dependency "pg"
|
31
|
-
end
|
32
|
-
s.add_development_dependency "rails", ">= 4.0.0"
|
33
|
-
s.add_development_dependency "cucumber", "~> 2.3.2"
|
34
|
-
s.add_development_dependency "rspec", "~> 3.4.0"
|
35
|
-
s.add_development_dependency "webmock"
|
36
|
-
s.add_development_dependency "fog", ">= 1.28.0"
|
37
|
-
s.add_development_dependency "mini_magick", ">= 3.6.0"
|
38
|
-
if RUBY_ENGINE != 'jruby'
|
39
|
-
s.add_development_dependency "rmagick"
|
40
|
-
end
|
41
|
-
s.add_development_dependency "nokogiri", "~> 1.6.3"
|
42
|
-
s.add_development_dependency "timecop", "0.7.1"
|
43
|
-
s.add_development_dependency "generator_spec"
|
44
|
-
s.add_development_dependency "pry"
|
45
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
Feature: uploader with file storage
|
2
|
-
In order to be able to temporarily store files to disk
|
3
|
-
As a developer using CarrierWave
|
4
|
-
I want to cache files
|
5
|
-
|
6
|
-
Scenario: cache a file
|
7
|
-
Given an uploader class that uses the 'file' storage
|
8
|
-
And an instance of that class
|
9
|
-
When I cache the file 'fixtures/bork.txt'
|
10
|
-
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
11
|
-
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
12
|
-
|
13
|
-
Scenario: cache two files in succession
|
14
|
-
Given an uploader class that uses the 'file' storage
|
15
|
-
And an instance of that class
|
16
|
-
When I cache the file 'fixtures/bork.txt'
|
17
|
-
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
18
|
-
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
19
|
-
When I cache the file 'fixtures/monkey.txt'
|
20
|
-
Then there should be a file called 'monkey.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
21
|
-
And the file called 'monkey.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/monkey.txt'
|
22
|
-
|
23
|
-
Scenario: retrieving a file from cache
|
24
|
-
Given an uploader class that uses the 'file' storage
|
25
|
-
And an instance of that class
|
26
|
-
And the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
27
|
-
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
28
|
-
Then the uploader should have 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt' as its current path
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Feature: downloading files
|
2
|
-
In order to allow users to upload remote files
|
3
|
-
As a developer using CarrierWave
|
4
|
-
I want to download files to the filesystem via HTTP
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given an uploader class that uses the 'file' storage
|
8
|
-
And an instance of that class
|
9
|
-
|
10
|
-
Scenario: download a file
|
11
|
-
When I download the file 'http://s3.amazonaws.com/Monkey/testfile.txt'
|
12
|
-
Then there should be a file called 'testfile.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
13
|
-
And the file called 'testfile.txt' in a subdirectory of 'public/uploads/tmp' should contain 'S3 Remote File'
|
14
|
-
|
15
|
-
Scenario: downloading a file then storing
|
16
|
-
When I download the file 'http://s3.amazonaws.com/Monkey/testfile.txt'
|
17
|
-
And I store the file
|
18
|
-
Then there should be a file at 'public/uploads/testfile.txt'
|
19
|
-
And the file at 'public/uploads/testfile.txt' should contain 'S3 Remote File'
|
20
|
-
|
@@ -1,37 +0,0 @@
|
|
1
|
-
Feature: uploader with file storage
|
2
|
-
In order to be awesome
|
3
|
-
As a developer using CarrierWave
|
4
|
-
I want to upload files to the filesystem
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given an uploader class that uses the 'file' storage
|
8
|
-
And an instance of that class
|
9
|
-
|
10
|
-
Scenario: store a file
|
11
|
-
When I store the file 'fixtures/bork.txt'
|
12
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
13
|
-
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
14
|
-
|
15
|
-
Scenario: store two files in succession
|
16
|
-
When I store the file 'fixtures/bork.txt'
|
17
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
18
|
-
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
19
|
-
When I store the file 'fixtures/monkey.txt'
|
20
|
-
Then there should be a file at 'public/uploads/monkey.txt'
|
21
|
-
And the file at 'public/uploads/monkey.txt' should be identical to the file at 'fixtures/monkey.txt'
|
22
|
-
|
23
|
-
Scenario: cache a file and then store it
|
24
|
-
When I cache the file 'fixtures/bork.txt'
|
25
|
-
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
26
|
-
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
27
|
-
And there should not be a file at 'public/uploads/bork.txt'
|
28
|
-
When I store the file
|
29
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
30
|
-
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
31
|
-
|
32
|
-
Scenario: retrieving a file from cache then storing
|
33
|
-
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
34
|
-
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
35
|
-
And I store the file
|
36
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
37
|
-
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
@@ -1,38 +0,0 @@
|
|
1
|
-
Feature: uploader with file storage and overriden filename
|
2
|
-
In order to be awesome
|
3
|
-
As a developer using CarrierWave
|
4
|
-
I want to upload files to the filesystem with an overriden filename
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given an uploader class that uses the 'file' storage
|
8
|
-
And that the uploader reverses the filename
|
9
|
-
And an instance of that class
|
10
|
-
|
11
|
-
Scenario: store a file
|
12
|
-
When I store the file 'fixtures/bork.txt'
|
13
|
-
Then there should be a file at 'public/uploads/txt.krob'
|
14
|
-
And the file at 'public/uploads/txt.krob' should be identical to the file at 'fixtures/bork.txt'
|
15
|
-
|
16
|
-
Scenario: store two files in succession
|
17
|
-
When I store the file 'fixtures/bork.txt'
|
18
|
-
Then there should be a file at 'public/uploads/txt.krob'
|
19
|
-
And the file at 'public/uploads/txt.krob' should be identical to the file at 'fixtures/bork.txt'
|
20
|
-
When I store the file 'fixtures/monkey.txt'
|
21
|
-
Then there should be a file at 'public/uploads/txt.yeknom'
|
22
|
-
And the file at 'public/uploads/txt.yeknom' should be identical to the file at 'fixtures/monkey.txt'
|
23
|
-
|
24
|
-
Scenario: cache a file and then store it
|
25
|
-
When I cache the file 'fixtures/bork.txt'
|
26
|
-
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
27
|
-
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
28
|
-
And there should not be a file at 'public/uploads/txt.krob'
|
29
|
-
When I store the file
|
30
|
-
Then there should be a file at 'public/uploads/txt.krob'
|
31
|
-
And the file at 'public/uploads/txt.krob' should be identical to the file at 'fixtures/bork.txt'
|
32
|
-
|
33
|
-
Scenario: retrieving a file from cache then storing
|
34
|
-
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
35
|
-
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
36
|
-
And I store the file
|
37
|
-
Then there should be a file at 'public/uploads/txt.krob'
|
38
|
-
And the file at 'public/uploads/txt.krob' should be identical to the file at 'fixtures/bork.txt'
|
@@ -1,38 +0,0 @@
|
|
1
|
-
Feature: uploader with file storage and overridden store dir
|
2
|
-
In order to be awesome
|
3
|
-
As a developer using CarrierWave
|
4
|
-
I want to upload files to the filesystem
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given an uploader class that uses the 'file' storage
|
8
|
-
And that the uploader has the store_dir overridden to 'public/monkey/llama'
|
9
|
-
And an instance of that class
|
10
|
-
|
11
|
-
Scenario: store a file
|
12
|
-
When I store the file 'fixtures/bork.txt'
|
13
|
-
Then there should be a file at 'public/monkey/llama/bork.txt'
|
14
|
-
And the file at 'public/monkey/llama/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
15
|
-
|
16
|
-
Scenario: store two files in succession
|
17
|
-
When I store the file 'fixtures/bork.txt'
|
18
|
-
Then there should be a file at 'public/monkey/llama/bork.txt'
|
19
|
-
And the file at 'public/monkey/llama/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
20
|
-
When I store the file 'fixtures/monkey.txt'
|
21
|
-
Then there should be a file at 'public/monkey/llama/monkey.txt'
|
22
|
-
And the file at 'public/monkey/llama/monkey.txt' should be identical to the file at 'fixtures/monkey.txt'
|
23
|
-
|
24
|
-
Scenario: cache a file and then store it
|
25
|
-
When I cache the file 'fixtures/bork.txt'
|
26
|
-
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
27
|
-
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
28
|
-
And there should not be a file at 'public/monkey/llama/bork.txt'
|
29
|
-
When I store the file
|
30
|
-
Then there should be a file at 'public/monkey/llama/bork.txt'
|
31
|
-
And the file at 'public/monkey/llama/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
32
|
-
|
33
|
-
Scenario: retrieving a file from cache then storing
|
34
|
-
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
35
|
-
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
36
|
-
And I store the file
|
37
|
-
Then there should be a file at 'public/monkey/llama/bork.txt'
|
38
|
-
And the file at 'public/monkey/llama/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
@@ -1,43 +0,0 @@
|
|
1
|
-
Feature: uploader with file storage and a processor that reverses the file
|
2
|
-
In order to be awesome
|
3
|
-
As a developer using CarrierWave
|
4
|
-
I want to upload files to the filesystem
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given an uploader class that uses the 'file' storage
|
8
|
-
And an instance of that class
|
9
|
-
And the class has a method called 'reverse' that reverses the contents of a file
|
10
|
-
And the class will process 'reverse'
|
11
|
-
|
12
|
-
Scenario: store a file
|
13
|
-
When I store the file 'fixtures/bork.txt'
|
14
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
15
|
-
And the file at 'public/uploads/bork.txt' should not be identical to the file at 'fixtures/bork.txt'
|
16
|
-
And the file at 'public/uploads/bork.txt' should be the reverse of the file at 'fixtures/bork.txt'
|
17
|
-
|
18
|
-
Scenario: store two files in succession
|
19
|
-
When I store the file 'fixtures/bork.txt'
|
20
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
21
|
-
And the file at 'public/uploads/bork.txt' should not be identical to the file at 'fixtures/bork.txt'
|
22
|
-
And the file at 'public/uploads/bork.txt' should be the reverse of the file at 'fixtures/bork.txt'
|
23
|
-
When I store the file 'fixtures/monkey.txt'
|
24
|
-
Then there should be a file at 'public/uploads/monkey.txt'
|
25
|
-
And the file at 'public/uploads/monkey.txt' should not be identical to the file at 'fixtures/monkey.txt'
|
26
|
-
And the file at 'public/uploads/monkey.txt' should be the reverse of the file at 'fixtures/monkey.txt'
|
27
|
-
|
28
|
-
Scenario: cache a file and then store it
|
29
|
-
When I cache the file 'fixtures/bork.txt'
|
30
|
-
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
31
|
-
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should not be identical to the file at 'fixtures/bork.txt'
|
32
|
-
And there should not be a file at 'public/uploads/bork.txt'
|
33
|
-
When I store the file
|
34
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
35
|
-
And the file at 'public/uploads/bork.txt' should not be identical to the file at 'fixtures/bork.txt'
|
36
|
-
And the file at 'public/uploads/bork.txt' should be the reverse of the file at 'fixtures/bork.txt'
|
37
|
-
|
38
|
-
Scenario: retrieving a file from cache then storing
|
39
|
-
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
|
40
|
-
When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
|
41
|
-
And I store the file
|
42
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
43
|
-
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
@@ -1 +0,0 @@
|
|
1
|
-
this is a file
|
@@ -1 +0,0 @@
|
|
1
|
-
this is another file
|
@@ -1 +0,0 @@
|
|
1
|
-
THIS IS A FILE
|
@@ -1,46 +0,0 @@
|
|
1
|
-
Feature: Mount an Uploader on ActiveRecord class
|
2
|
-
In order to easily attach files to a form
|
3
|
-
As a web developer using CarrierWave
|
4
|
-
I want to mount an uploader on an ActiveRecord class
|
5
|
-
|
6
|
-
Background:
|
7
|
-
Given an uploader class that uses the 'file' storage
|
8
|
-
And an activerecord class that uses the 'users' table
|
9
|
-
And the uploader class is mounted on the 'avatar' column
|
10
|
-
And an instance of the activerecord class
|
11
|
-
|
12
|
-
Scenario: assign a file
|
13
|
-
When I assign the file 'fixtures/bork.txt' to the 'avatar' column
|
14
|
-
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
|
15
|
-
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/bork.txt'
|
16
|
-
|
17
|
-
Scenario: assign a file and save the record
|
18
|
-
When I assign the file 'fixtures/bork.txt' to the 'avatar' column
|
19
|
-
And I save the active record
|
20
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
21
|
-
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
22
|
-
And the url for the column 'avatar' should be '/uploads/bork.txt'
|
23
|
-
|
24
|
-
Scenario: assign a file and retrieve it from cache
|
25
|
-
When I assign the file 'fixtures/bork.txt' to the 'avatar' column
|
26
|
-
And I retrieve the file later from the cache name for the column 'avatar'
|
27
|
-
And I save the active record
|
28
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
29
|
-
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
|
30
|
-
And the url for the column 'avatar' should be '/uploads/bork.txt'
|
31
|
-
|
32
|
-
Scenario: store a file and retrieve it later
|
33
|
-
When I assign the file 'fixtures/bork.txt' to the 'avatar' column
|
34
|
-
And I retrieve the file later from the cache name for the column 'avatar'
|
35
|
-
And I save the active record
|
36
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
37
|
-
When I reload the active record
|
38
|
-
Then the url for the column 'avatar' should be '/uploads/bork.txt'
|
39
|
-
|
40
|
-
Scenario: store a file and delete the record
|
41
|
-
When I assign the file 'fixtures/bork.txt' to the 'avatar' column
|
42
|
-
And I retrieve the file later from the cache name for the column 'avatar'
|
43
|
-
And I save the active record
|
44
|
-
Then there should be a file at 'public/uploads/bork.txt'
|
45
|
-
When I delete the active record
|
46
|
-
Then there should not be a file at 'public/uploads/bork.txt'
|
@@ -1,20 +0,0 @@
|
|
1
|
-
Given /^an activerecord class that uses the '([^\']*)' table$/ do |name|
|
2
|
-
@mountee_klass = Class.new(ActiveRecord::Base)
|
3
|
-
@mountee_klass.table_name = name
|
4
|
-
end
|
5
|
-
|
6
|
-
Given /^an instance of the activerecord class$/ do
|
7
|
-
@instance = @mountee_klass.new
|
8
|
-
end
|
9
|
-
|
10
|
-
When /^I save the active record$/ do
|
11
|
-
@instance.save!
|
12
|
-
end
|
13
|
-
|
14
|
-
When /^I reload the active record$/ do
|
15
|
-
@instance = @instance.class.find(@instance.id)
|
16
|
-
end
|
17
|
-
|
18
|
-
When /^I delete the active record$/ do
|
19
|
-
@instance.destroy
|
20
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Given /^the file '(.*?)' is cached file at '(.*?)'$/ do |file, cached|
|
2
|
-
FileUtils.mkdir_p(File.dirname(file_path(cached)))
|
3
|
-
FileUtils.cp(file_path(file), file_path(cached))
|
4
|
-
end
|
5
|
-
|
6
|
-
When /^I cache the file '(.*?)'$/ do |file|
|
7
|
-
@uploader.cache!(File.open(file_path(file)))
|
8
|
-
end
|
9
|
-
|
10
|
-
When /^I retrieve the cache name '(.*?)' from the cache$/ do |name|
|
11
|
-
@uploader.retrieve_from_cache!(name)
|
12
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
Given /^a datamapper class that has a '([^\']*)' column$/ do |column|
|
2
|
-
@mountee_klass = Class.new do
|
3
|
-
include DataMapper::Resource
|
4
|
-
|
5
|
-
storage_names[:default] = 'users'
|
6
|
-
|
7
|
-
property :id, DataMapper::Types::Serial
|
8
|
-
property column.to_sym, String
|
9
|
-
end
|
10
|
-
@mountee_klass.auto_migrate!
|
11
|
-
end
|
12
|
-
|
13
|
-
Given /^an instance of the datamapper class$/ do
|
14
|
-
@instance = @mountee_klass.new
|
15
|
-
end
|
16
|
-
|
17
|
-
When /^I save the datamapper record$/ do
|
18
|
-
@instance.save
|
19
|
-
end
|
20
|
-
|
21
|
-
When /^I reload the datamapper record$/ do
|
22
|
-
@instance = @instance.class.first(:id => @instance.key)
|
23
|
-
end
|
24
|
-
|
25
|
-
When /^I delete the datamapper record$/ do
|
26
|
-
@instance.destroy
|
27
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
###
|
2
|
-
# EXISTENCE
|
3
|
-
|
4
|
-
Then /^there should be a file at '(.*?)'$/ do |file|
|
5
|
-
File.exist?(file_path(file)).should be_truthy
|
6
|
-
end
|
7
|
-
|
8
|
-
Then /^there should not be a file at '(.*?)'$/ do |file|
|
9
|
-
File.exist?(file_path(file)).should be_falsey
|
10
|
-
end
|
11
|
-
|
12
|
-
Then /^there should be a file called '(.*?)' somewhere in a subdirectory of '(.*?)'$/ do |file, directory|
|
13
|
-
Dir.glob(File.join(file_path(directory), '**', file)).any?.should be_truthy
|
14
|
-
end
|
15
|
-
|
16
|
-
###
|
17
|
-
# IDENTICAL
|
18
|
-
|
19
|
-
Then /^the file at '(.*?)' should be identical to the file at '(.*?)'$/ do |one, two|
|
20
|
-
File.read(file_path(one)).should == File.read(file_path(two))
|
21
|
-
end
|
22
|
-
|
23
|
-
Then /^the file at '(.*?)' should not be identical to the file at '(.*?)'$/ do |one, two|
|
24
|
-
File.read(file_path(one)).should_not == File.read(file_path(two))
|
25
|
-
end
|
26
|
-
|
27
|
-
Then /^the file called '(.*?)' in a subdirectory of '(.*?)' should be identical to the file at '(.*?)'$/ do |file, directory, other|
|
28
|
-
File.read(Dir.glob(File.join(file_path(directory), '**', file)).first).should == File.read(file_path(other))
|
29
|
-
end
|
30
|
-
|
31
|
-
Then /^the file called '(.*?)' in a subdirectory of '(.*?)' should not be identical to the file at '(.*?)'$/ do |file, directory, other|
|
32
|
-
File.read(Dir.glob(File.join(file_path(directory), '**', file)).first).should_not == File.read(file_path(other))
|
33
|
-
end
|
34
|
-
|
35
|
-
###
|
36
|
-
# CONTENT
|
37
|
-
|
38
|
-
Then /^the file called '([^']+)' in a subdirectory of '([^']+)' should contain '([^']+)'$/ do |file, directory, content|
|
39
|
-
File.read(Dir.glob(File.join(file_path(directory), '**', file)).first).should include(content)
|
40
|
-
end
|
41
|
-
|
42
|
-
Then /^the file at '([^']+)' should contain '([^']+)'$/ do |path, content|
|
43
|
-
File.read(file_path(path)).should include(content)
|
44
|
-
end
|
45
|
-
|
46
|
-
###
|
47
|
-
# REVERSING
|
48
|
-
|
49
|
-
Then /^the file at '(.*?)' should be the reverse of the file at '(.*?)'$/ do |one, two|
|
50
|
-
File.read(file_path(one)).should == File.read(file_path(two)).reverse
|
51
|
-
end
|