dpl-s3 1.9.4.travis.2768.5 → 1.9.4.travis.2773.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dpl/provider/s3.rb +5 -1
- data/spec/provider/s3_spec.rb +6 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9254475c3471a34f9f49703312ae3801e9505bac5ea245bb5f9296759ad00a3b
|
4
|
+
data.tar.gz: 1a8e03256d3188391979e065f9fc0eb4d2c7bfa301b6b7090bd6a2dd67f8381a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 290e10289a8c85c1d2bc0b8bd17f94228153a78b331a86f5f80da4c177dd39ee12a1bef9bd4c3bea43ff1f2659c0b73c06066d0faa04d99f93d30a2821f7c730
|
7
|
+
data.tar.gz: e8bb16f5635d10c062e635cfec3d1828d61af1c6cd81723cc77a54fdd511713cde4dcf7720c8793e0199357ef5ca0581e1bca34ce696e198f109daa55d82be53
|
data/lib/dpl/provider/s3.rb
CHANGED
@@ -49,8 +49,10 @@ module DPL
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def push_app
|
52
|
+
old_pwd = Dir.pwd
|
52
53
|
cwd = options.fetch(:local_dir, Dir.pwd)
|
53
|
-
|
54
|
+
Dir.chdir(cwd)
|
55
|
+
glob_args = ["**/*"]
|
54
56
|
glob_args << File::FNM_DOTMATCH if options[:dot_match]
|
55
57
|
files = Dir.glob(*glob_args).reject {|f| File.directory?(f)}
|
56
58
|
upload_multithreaded(files)
|
@@ -64,6 +66,8 @@ module DPL
|
|
64
66
|
}
|
65
67
|
)
|
66
68
|
end
|
69
|
+
|
70
|
+
Dir.chdir(old_pwd)
|
67
71
|
end
|
68
72
|
|
69
73
|
def upload_multithreaded(files)
|
data/spec/provider/s3_spec.rb
CHANGED
@@ -85,7 +85,9 @@ describe DPL::Provider::S3 do
|
|
85
85
|
example "With local_dir" do
|
86
86
|
someDir = "/some/dir/"
|
87
87
|
provider.options.update(:local_dir => someDir)
|
88
|
-
|
88
|
+
allow(Dir).to receive(:chdir).with(someDir).and_return(true)
|
89
|
+
allow(Dir).to receive(:chdir).with(Dir.pwd).and_return(true)
|
90
|
+
expect(Dir).to receive(:glob).with("**/*").and_return([__FILE__])
|
89
91
|
provider.push_app
|
90
92
|
end
|
91
93
|
|
@@ -156,20 +158,20 @@ describe DPL::Provider::S3 do
|
|
156
158
|
|
157
159
|
example "when dot_match is set" do
|
158
160
|
provider.options.update(:dot_match => true)
|
159
|
-
expect(Dir).to receive(:glob).with(
|
161
|
+
expect(Dir).to receive(:glob).with("**/*", File::FNM_DOTMATCH).and_return([__FILE__])
|
160
162
|
provider.push_app
|
161
163
|
end
|
162
164
|
|
163
165
|
example "when max_threads is set" do
|
164
166
|
provider.options.update(:max_threads => 10)
|
165
|
-
expect(Dir).to receive(:glob).with(
|
167
|
+
expect(Dir).to receive(:glob).with("**/*").and_return([__FILE__])
|
166
168
|
expect(provider).to receive(:log).with("Beginning upload of 1 files with 10 threads.")
|
167
169
|
provider.push_app
|
168
170
|
end
|
169
171
|
|
170
172
|
example "when max_threads is too large" do
|
171
173
|
provider.options.update(:max_threads => 100)
|
172
|
-
expect(Dir).to receive(:glob).with(
|
174
|
+
expect(Dir).to receive(:glob).with("**/*").and_return([__FILE__])
|
173
175
|
expect(provider).to receive(:log).with("Beginning upload of 1 files with 15 threads.")
|
174
176
|
expect(provider).to receive(:log).with("Desired thread count 100 is too large. Using 15.")
|
175
177
|
provider.push_app
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpl-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.9.4.travis.
|
4
|
+
version: 1.9.4.travis.2773.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Haase
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.9.4.travis.
|
19
|
+
version: 1.9.4.travis.2773.5
|
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
|
-
version: 1.9.4.travis.
|
26
|
+
version: 1.9.4.travis.2773.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aws-sdk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|