dpl 1.6.6.travis.478.1 → 1.6.6.travis.484.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTI5ZGVhMTk4NTBhZWY1ZDRmMjg3MTQxNzE3YTJiZmZkOTY3ZGM0Mg==
4
+ MTNmMjVkNmQyMjY3MWM3ZDUwZTk0YWEwZWM0NDhiODIxYTAwYjgyNQ==
5
5
  data.tar.gz: !binary |-
6
- ODFlY2E1MmMyNWNkYmQ0YWNkYjA4ODAzNjM3ZmI1YTY4MDQzYTg0OQ==
6
+ ZGFjOWVhY2FmZTMzMTJhOTM5OTZkY2E4ZjM0Mjg4YmZmMWU5NjYwOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDAwMjA1MGM4OGFhYmY5NTkwOTIxOWM3ZDYzYWI1NDI0MjU0YzJlMzU3M2Q4
10
- YmY5YjJmZTUwZjU0NDc5NzVhOGQ3MTQ5ZWExYWE5NmQ3NGYxOWVlZmY1NzFj
11
- MWJhNTQ1NDYzNGNjM2ViMzM4MjcyZGYwMzI4YjZhY2EzNGNlMzI=
9
+ ODRkYzJkMGIwMThjY2FjNjAzNWQ4Yzc4OTg0MTU0N2IyZmJlYjFmZGYxNTYz
10
+ ZWQxMThkYTVjMzIxYWI4YmU2MDgwZDJlNjRkMjZjNzk4ZTNlZTk0NTAwZTdl
11
+ YjRiYTgzYzRiMTE2NjYzY2QxY2ZkOWYwZGY4N2YzNzhiY2VjZGY=
12
12
  data.tar.gz: !binary |-
13
- ZmIxMThmZmNlMjkwZWE3NWMwYWIyYTIyYTFlMWVjYjM0ZDdiYTlkZDdhZjQ5
14
- ZDRjOGQxNGM3ODE0MjE5NmI2NGNlMjNiYmI3YjRmZTY0NDkzYjEzMTQ0MTdl
15
- NDU0Yzg3MjNlZTI1NzllOTU2NzBkMGNjZWUwOTgxYmFmNzAyY2U=
13
+ MjExZDkyMjFjZDJjNDE5NjVjYTcyYWRmMmUwM2FhOGRkMmMwMWQxNTBlMWY3
14
+ OWVkZjA5MzY0MzgxNzIyYjgwMGZjNjI0OGVhY2E4ZGVhY2QyNThlNjkzMTQ0
15
+ ODE5MjU0YTVhOTdjMjMyNzJhYjk4OTRjOWQ5Mzk5ZjZkZWZlMmU=
data/README.md CHANGED
@@ -185,6 +185,7 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
185
185
  * **cache_control**: Set HTTP header `Cache-Control` to suggest that the browser cache the file. Defaults to `no-cache`. Valid options are `no-cache`, `no-store`, `max-age=<seconds>`,`s-maxage=<seconds>` `no-transform`, `public`, `private`.
186
186
  * **expires**: This sets the date and time that the cached object is no longer cacheable. Defaults to not set. The date must be in the format `YYYY-MM-DD HH:MM:SS -ZONE`.
187
187
  * **acl**: Sets the access control for the uploaded objects. Defaults to `private`. Valid options are `private`, `public_read`, `public_read_write`, `authenticated_read`, `bucket_owner_read`, `bucket_owner_full_controll`.
188
+ * **dot_match**: When set to `true`, upload files starting a `.`.
188
189
 
189
190
  #### Examples:
190
191
 
@@ -265,6 +266,7 @@ As a rule of thumb, you should switch to the Git strategy if you run into issues
265
266
  * **api-key**: Rackspace API Key.
266
267
  * **region**: Cloud Files Region. The region in which your Cloud Files container exists.
267
268
  * **container**: Container Name. The container where you would like your files to be uploaded.
269
+ * **dot_match**: When set to `true`, upload files starting a `.`.
268
270
 
269
271
  #### Examples:
270
272
 
@@ -342,6 +344,7 @@ For accounts using two factor authentication, you have to use an oauth token as
342
344
  * **secret-access-key**: GCS Interoperable Access Secret.
343
345
  * **bucket**: GCS Bucket.
344
346
  * **local-dir**: Local directory to upload from. Can be set from a global perspective (~/travis/build) or relative perspective (build) Defaults to project root.
347
+ * **dot_match**: When set to `true`, upload files starting a `.`.
345
348
 
346
349
  #### Examples:
347
350
 
@@ -23,7 +23,10 @@ module DPL
23
23
 
24
24
  raise Error, 'The specified container does not exist.' if container.nil?
25
25
 
26
- Dir.glob('**/*').each do |name|
26
+ glob_args = ['**/*']
27
+ glob_args << File::FNM_DOTMATCH if options[:dot_match]
28
+
29
+ Dir.glob(*glob_args).each do |name|
27
30
  container.files.create(:key => name, :body => File.open(name)) unless File.directory?(name)
28
31
  end
29
32
  end
@@ -22,8 +22,10 @@ module DPL
22
22
  end
23
23
 
24
24
  def push_app
25
+ glob_args = ["**/*"]
26
+ glob_args << File::FNM_DOTMATCH if options[:dot_match]
25
27
  Dir.chdir(options.fetch(:local_dir, Dir.pwd)) do
26
- Dir.glob("**/*") do |filename|
28
+ Dir.glob(*glob_args) do |filename|
27
29
  next if File.directory?(filename)
28
30
 
29
31
  log "Push: #{filename}"
@@ -32,12 +32,14 @@ module DPL
32
32
  end
33
33
 
34
34
  def push_app
35
+ glob_args = ["**/*"]
36
+ glob_args << File::FNM_DOTMATCH if options[:dot_match]
35
37
  Dir.chdir(options.fetch(:local_dir, Dir.pwd)) do
36
- Dir.glob("**/*") do |filename|
38
+ Dir.glob(*glob_args) do |filename|
37
39
  content_type = MIME::Types.type_for(filename).first.to_s
38
40
  opts = { :content_type => content_type }.merge(encoding_option_for(filename))
39
41
  opts[:cache_control] = options[:cache_control] if options[:cache_control]
40
- opts[:acl] = options[:acl] if options[:acl]
42
+ opts[:acl] = options[:acl] if options[:acl]
41
43
  opts[:expires] = options[:expires] if options[:expires]
42
44
  unless File.directory?(filename)
43
45
  api.buckets[option(:bucket)].objects.create(upload_path(filename), File.read(filename), opts)
@@ -60,6 +60,17 @@ describe DPL::Provider::CloudFiles do
60
60
 
61
61
  provider.push_app
62
62
  end
63
+
64
+ example "with dot_match option" do
65
+ provider.options.update(:dot_match => true)
66
+ expect(files).to receive(:create).with(:key => '.a', :body => '.a body')
67
+ expect(files).to receive(:create).with(:key => 'a', :body => 'a body')
68
+
69
+ expect(Dir).to receive(:glob).with('**/*', File::FNM_DOTMATCH).and_return(['.a', 'a'])
70
+ allow(File).to receive(:open) { |name| "#{name} body" }
71
+
72
+ provider.push_app
73
+ end
63
74
  end
64
75
 
65
76
  describe "#deploy" do
@@ -32,6 +32,13 @@ describe DPL::Provider::GCS do
32
32
  expect(Dir).to receive(:chdir).with('BUILD')
33
33
  provider.push_app
34
34
  end
35
+
36
+ example "With dot_match" do
37
+ provider.options.update(:dot_match => true)
38
+
39
+ expect(Dir).to receive(:glob).with('**/*', File::FNM_DOTMATCH)
40
+ provider.push_app
41
+ end
35
42
  end
36
43
 
37
44
  describe '#client' do
@@ -96,6 +96,12 @@ describe DPL::Provider::S3 do
96
96
  expect_any_instance_of(AWS::S3::ObjectCollection).to receive(:create).with(anything(), anything(), hash_including(:content_encoding => 'gzip'))
97
97
  provider.push_app
98
98
  end
99
+
100
+ example "when dot_match is set" do
101
+ provider.options.update(:dot_match => true)
102
+ expect(Dir).to receive(:glob).with("**/*", File::FNM_DOTMATCH)
103
+ provider.push_app
104
+ end
99
105
  end
100
106
 
101
107
  describe "#api" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.6.travis.478.1
4
+ version: 1.6.6.travis.484.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-22 00:00:00.000000000 Z
11
+ date: 2014-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec