carrierwave-cascade 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 9746a3d779b60a48a92d241387a48d7a857541f0
4
- data.tar.gz: cdd429f82a3125d72c9c9d0d85a6d7ef0b460c17
2
+ SHA256:
3
+ metadata.gz: 159f531b71016527e29e57fea784ee76a842f375b6c158a4f1489b8696d1038f
4
+ data.tar.gz: f719f3ec25817acd89c4de01af9a524dd020280b6332995e7bf23d8858dcda4f
5
5
  SHA512:
6
- metadata.gz: f189001bf4a6f8d50a3e4ca9b77af8f1acee997f0da7266b7d0f5a5daa8fffee401eb85a7889dfb9986c0bf390921e0d7e03d5c918daf82c5cb792c27ffb405d
7
- data.tar.gz: 8bd4c2da7b78642bc8e39773521b0faea85733bfe95d6c0f0ffa77c07711ac7d9826bbe9d3a6374743224b4d32f4dacfdf015979f871d917c62bd9bfe89066e1
6
+ metadata.gz: bd784ecc0cc1257ef1285d2f603bbdaa422c487e72052212f88e2b1a4bc6f11c452278fd4868875ad41c56bd304d497b01e670f6f85ca2c9c4b73a3e3515e6f3
7
+ data.tar.gz: fec7ae9c27d865687279bafafe715fd2311b19d1f345ec1a969d1f82205f596887a76b318663fdaac877a92811840f9d98965d79bd5ca6ebecc15d1c6361a7e3
@@ -1,6 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.3
5
- - 2.0.0
3
+ - 2.4.10
6
4
  script: bundle exec rspec spec
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency 'carrierwave', '>= 0.5.8'
29
29
 
30
- spec.add_development_dependency "bundler", "~> 1.3"
30
+ spec.add_development_dependency "bundler"
31
31
  spec.add_development_dependency "rake"
32
- spec.add_development_dependency 'rspec', '~> 2.12.0'
33
- spec.add_development_dependency 'fog'
32
+ spec.add_development_dependency 'rspec', '~> 3.0'
33
+ spec.add_development_dependency 'fog-aws'
34
34
  end
@@ -1,5 +1,5 @@
1
1
  module Carrierwave
2
2
  module Cascade
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -55,6 +55,10 @@ module CarrierWave
55
55
  def respond_to?(*args)
56
56
  @real_file.respond_to?(*args)
57
57
  end
58
+
59
+ def method(*args)
60
+ real_file.send(:method, *args)
61
+ end
58
62
  end
59
63
 
60
64
  end
@@ -1,9 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe CarrierWave::Uploader::Base do
4
- it { should respond_to :primary_storage }
5
- it { should respond_to :secondary_storage }
6
- it { should respond_to :allow_secondary_file_deletion }
4
+ it { is_expected.to respond_to :primary_storage }
5
+ it { is_expected.to respond_to :secondary_storage }
6
+ it { is_expected.to respond_to :allow_secondary_file_deletion }
7
7
 
8
- its(:storage_engines){ should have_key :cascade }
8
+ describe '#storage_engines' do
9
+ subject { super().storage_engines }
10
+ it { is_expected.to have_key :cascade }
11
+ end
9
12
  end
@@ -14,25 +14,32 @@ describe CarrierWave::Storage::Cascade do
14
14
  subject(:cascade){ CarrierWave::Storage::Cascade.new(uploader) }
15
15
 
16
16
  describe "#initialize" do
17
- its(:primary_storage){ should be_a(CarrierWave::Storage::Fog)}
18
- its(:secondary_storage){ should be_a(CarrierWave::Storage::File)}
17
+ describe '#primary_storage' do
18
+ subject { super().primary_storage }
19
+ it { is_expected.to be_a(CarrierWave::Storage::Fog)}
20
+ end
21
+
22
+ describe '#secondary_storage' do
23
+ subject { super().secondary_storage }
24
+ it { is_expected.to be_a(CarrierWave::Storage::File)}
25
+ end
19
26
  end
20
27
 
21
28
  describe "#store!" do
22
29
  let(:file){ CarrierWave::SanitizedFile.new("hello") }
23
30
 
24
31
  before do
25
- cascade.primary_storage.stub(:store! => file)
26
- cascade.secondary_storage.stub(:store! => file)
32
+ allow(cascade.primary_storage).to receive_messages(:store! => file)
33
+ allow(cascade.secondary_storage).to receive_messages(:store! => file)
27
34
  end
28
35
 
29
36
  it "stores to the primary_storage" do
30
- cascade.primary_storage.should_receive(:store!).with(file)
37
+ expect(cascade.primary_storage).to receive(:store!).with(file)
31
38
  cascade.store!(file)
32
39
  end
33
40
 
34
41
  it "does not store to the secondary_storage" do
35
- cascade.secondary_storage.should_not_receive(:store!)
42
+ expect(cascade.secondary_storage).not_to receive(:store!)
36
43
  cascade.store!(file)
37
44
  end
38
45
  end
@@ -42,32 +49,32 @@ describe CarrierWave::Storage::Cascade do
42
49
  let(:secondary_file){ CarrierWave::SanitizedFile.new("secondary") }
43
50
 
44
51
  before do
45
- cascade.primary_storage.stub(:retrieve! => primary_file)
46
- cascade.secondary_storage.stub(:retrieve! => secondary_file)
52
+ allow(cascade.primary_storage).to receive_messages(:retrieve! => primary_file)
53
+ allow(cascade.secondary_storage).to receive_messages(:retrieve! => secondary_file)
47
54
  end
48
55
 
49
56
  context "when file exists in primary_storage" do
50
57
  before do
51
- primary_file.stub(:exists? => true)
58
+ allow(primary_file).to receive_messages(:exists? => true)
52
59
  end
53
60
 
54
61
  context "when file exists in secondary_storage" do
55
62
  before do
56
- secondary_file.stub(:exists? => true)
63
+ allow(secondary_file).to receive_messages(:exists? => true)
57
64
  end
58
65
 
59
66
  it "returns the primary_file" do
60
- cascade.retrieve!('file').should == primary_file
67
+ expect(cascade.retrieve!('file')).to eq(primary_file)
61
68
  end
62
69
  end
63
70
 
64
71
  context "when file doesn't exist in secondary_storage" do
65
72
  before do
66
- secondary_file.stub(:exists? => false)
73
+ allow(secondary_file).to receive_messages(:exists? => false)
67
74
  end
68
75
 
69
76
  it "returns the primary_file" do
70
- cascade.retrieve!('file').should == primary_file
77
+ expect(cascade.retrieve!('file')).to eq(primary_file)
71
78
  end
72
79
  end
73
80
 
@@ -75,15 +82,15 @@ describe CarrierWave::Storage::Cascade do
75
82
 
76
83
  context "when file doesn't exist in primary_storage" do
77
84
  before do
78
- primary_file.stub(:exists? => false)
85
+ allow(primary_file).to receive_messages(:exists? => false)
79
86
  end
80
87
 
81
88
  it "returns a secondary_file proxy" do
82
- cascade.retrieve!('file').should be_a(CarrierWave::Storage::Cascade::SecondaryFileProxy)
89
+ expect(cascade.retrieve!('file')).to be_a(CarrierWave::Storage::Cascade::SecondaryFileProxy)
83
90
  end
84
91
 
85
92
  it "returns a proxy to the real secondary_file" do
86
- cascade.retrieve!('file').real_file.should == secondary_file
93
+ expect(cascade.retrieve!('file').real_file).to eq(secondary_file)
87
94
  end
88
95
 
89
96
  end
@@ -104,13 +111,13 @@ describe CarrierWave::Storage::Cascade::SecondaryFileProxy do
104
111
  end
105
112
 
106
113
  it "delegates all methods to the real file" do
107
- file.should_receive(:foooooo)
114
+ expect(file).to receive(:foooooo)
108
115
  cascade_file.foooooo
109
116
  end
110
117
 
111
118
  context "when allow_secondary_file_deletion is not set" do
112
119
  it "doesn't delete the file" do
113
- file.should_not_receive(:delete)
120
+ expect(file).not_to receive(:delete)
114
121
  cascade_file.delete
115
122
  end
116
123
  end
@@ -123,7 +130,7 @@ describe CarrierWave::Storage::Cascade::SecondaryFileProxy do
123
130
  end
124
131
 
125
132
  it "doesn't delete the file" do
126
- file.should_not_receive(:delete)
133
+ expect(file).not_to receive(:delete)
127
134
  cascade_file.delete
128
135
  end
129
136
  end
@@ -136,7 +143,7 @@ describe CarrierWave::Storage::Cascade::SecondaryFileProxy do
136
143
  end
137
144
 
138
145
  it "does delete the file" do
139
- file.should_receive(:delete)
146
+ expect(file).to receive(:delete)
140
147
  cascade_file.delete
141
148
  end
142
149
  end
@@ -1,4 +1,4 @@
1
1
  require 'rspec'
2
2
  require 'carrierwave'
3
3
  require 'carrierwave-cascade'
4
- require 'fog'
4
+ require 'fog/aws'
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-cascade
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Glowacz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-15 00:00:00.000000000 Z
11
+ date: 2020-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.5.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.5.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.3'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.3'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.12.0
61
+ version: '3.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.12.0
68
+ version: '3.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: fog
70
+ name: fog-aws
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: "A storage plugin for carrierwave that will\n retrieving files from
@@ -91,8 +91,8 @@ executables: []
91
91
  extensions: []
92
92
  extra_rdoc_files: []
93
93
  files:
94
- - .gitignore
95
- - .travis.yml
94
+ - ".gitignore"
95
+ - ".travis.yml"
96
96
  - Gemfile
97
97
  - LICENSE.txt
98
98
  - README.md
@@ -109,24 +109,23 @@ homepage: https://github.com/kjg/carrierwave-cascade
109
109
  licenses:
110
110
  - MIT
111
111
  metadata: {}
112
- post_install_message:
112
+ post_install_message:
113
113
  rdoc_options: []
114
114
  require_paths:
115
115
  - lib
116
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - '>='
118
+ - - ">="
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - '>='
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
- rubyforge_project:
128
- rubygems_version: 2.0.2
129
- signing_key:
127
+ rubygems_version: 3.1.4
128
+ signing_key:
130
129
  specification_version: 4
131
130
  summary: Retrieve from a secondary storage when the file is not in the primary storage.
132
131
  test_files: