middleman-s3_sync 3.0.25 → 3.0.26

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
2
  SHA1:
3
- metadata.gz: 53f0c96631ec71ebe886bd3ced01e219472f1f84
4
- data.tar.gz: b21736f5dc8297323c381d7e1aec408840ded0d1
3
+ metadata.gz: 45957c6108653a82b46a661ad75eb1b77f5e6af7
4
+ data.tar.gz: 163a94c3b0130c78a31850caa6448bb759aa9691
5
5
  SHA512:
6
- metadata.gz: d7af119cda3ba1ef4f4ad99575450c7d2c42760dd2625efd2cfd7d93ec1bfab79ca5e03ec1935e929bf065587ddeaef032dee108145d4eac1f2da4e7e6abd8d2
7
- data.tar.gz: 3acc9be46d830b93d01c8b66c94ea30eb72eb09b519589458ccf5617e8bb9f44600328a74e2184828e070e52129b438154512d655fe0f34fd32ce52d9749250e
6
+ metadata.gz: eb34b8decbcf29d9022eca8ce05128e46a5df26a85e1d0ec8c76ad85d954aef4b424d420f34a8bcf09db7fff1dffc79e74c612b5ed912291ea849ea33324f1ee
7
+ data.tar.gz: 96e6f7fbb1a200e51a5df31460860859d956421f451a3561a75759ef9d97d2b112b930e506c4d392cf695a85c9180d9aaec849b3887d4b35055cd4a6be6ff425
@@ -29,7 +29,7 @@ module Middleman
29
29
  end
30
30
 
31
31
  def bucket
32
- @bucket ||= connection.directories.get(s3_sync_options.bucket)
32
+ @bucket ||= connection.directories.get(s3_sync_options.bucket, :prefix => s3_sync_options.prefix)
33
33
  end
34
34
 
35
35
  protected
@@ -46,7 +46,7 @@ module Middleman
46
46
  def resources
47
47
  @resources ||= paths.pmap(32) do |p|
48
48
  progress_bar.increment
49
- S3Sync::Resource.new(p, bucket_files.find { |f| f.key == p }).tap(&:status)
49
+ S3Sync::Resource.new(p, bucket_files.find { |f| f.key == "#{s3_sync_options.prefix}#{p}" }).tap(&:status)
50
50
  end
51
51
  end
52
52
 
@@ -70,14 +70,14 @@ module Middleman
70
70
  local_paths.reject! { |p| p =~ /\.gz$/ && File.exist?(p.gsub(/\.gz$/, '')) }
71
71
  end
72
72
 
73
- local_paths.pmap(32) { |p| p.sub(/^#{build_dir}\//, '') }
73
+ local_paths.pmap(32) { |p| p.gsub(/#{build_dir}\//, s3_sync_options.prefix) }
74
74
  end
75
75
  end
76
76
 
77
77
  def remote_paths
78
78
  @remote_paths ||= bucket_files.map(&:key)
79
79
  end
80
-
80
+
81
81
  def bucket_files
82
82
  @bucket_files ||= [].tap { |files|
83
83
  bucket.files.each { |f|
@@ -80,6 +80,10 @@ module Middleman
80
80
  (@path_style.nil? ? true : @path_style)
81
81
  end
82
82
 
83
+ def prefix
84
+ @prefix.nil? ? "" : "#{@prefix}/"
85
+ end
86
+
83
87
  # Read config options from an IO stream and set them on `self`. Defaults
84
88
  # to reading from the `.s3_sync` file in the MM project root if it exists.
85
89
  #
@@ -13,7 +13,7 @@ module Middleman
13
13
 
14
14
  # S3 resource as returned by a HEAD request
15
15
  def full_s3_resource
16
- @full_s3_resource ||= bucket.files.head(path)
16
+ @full_s3_resource ||= bucket.files.head("#{options.prefix}#{path}")
17
17
  end
18
18
 
19
19
  def initialize(path, partial_s3_resource)
@@ -97,7 +97,7 @@ module Middleman
97
97
  @gzipped = true
98
98
  local_path += ".gz"
99
99
  end
100
- local_path
100
+ local_path.sub(options.prefix, '')
101
101
  end
102
102
 
103
103
  def destroy!
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module S3Sync
3
- VERSION = "3.0.25"
3
+ VERSION = "3.0.26"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-s3_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.25
4
+ version: 3.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederic Jean
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-09 00:00:00.000000000 Z
12
+ date: 2014-05-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core