middleman-s3_sync 3.0.37 → 3.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/lib/middleman-s3_sync/extension.rb +4 -0
- data/lib/middleman/s3_sync/options.rb +11 -1
- data/lib/middleman/s3_sync/version.rb +1 -1
- data/spec/options_spec.rb +10 -0
- data/spec/resource_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45f758d7d204535650c4e825a52abc4e69bcf086
|
|
4
|
+
data.tar.gz: 3462381561ce1d269f3dc39a9786237d9c9bef9d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abc5a66bbd74569d75078288b52cabaf77c1e9afd9b5a687efb9033b2ec879e5f72fa9f722097107e625cc91bdb9cf1ef6c8c8c15e7176338118ad073a3e6185
|
|
7
|
+
data.tar.gz: 9953b988d69940aa385e23a1182fdaa60ce215de6dd05e20702fc2ccc5f6e32725415c586b2923bc27efdfca9c3f6aba1c93203086fd25c0a80a2d02dfb01bec
|
data/.travis.yml
CHANGED
|
@@ -17,6 +17,10 @@ module Middleman
|
|
|
17
17
|
app.define_hook :after_s3_sync
|
|
18
18
|
|
|
19
19
|
app.after_configuration do |config|
|
|
20
|
+
# Record the http_prefix if it is set. We will need it while setting
|
|
21
|
+
# the options to detect whether it is set and adjust the prefix value
|
|
22
|
+
# accordingly
|
|
23
|
+
options.http_prefix = app.respond_to? :http_prefix ? app.http_prefix : nil
|
|
20
24
|
|
|
21
25
|
# Define the after_build step after during configuration so
|
|
22
26
|
# that it's pushed to the end of the callback chain
|
|
@@ -3,6 +3,7 @@ module Middleman
|
|
|
3
3
|
class Options
|
|
4
4
|
OPTIONS = [
|
|
5
5
|
:prefix,
|
|
6
|
+
:http_prefix,
|
|
6
7
|
:acl,
|
|
7
8
|
:bucket,
|
|
8
9
|
:region,
|
|
@@ -83,8 +84,17 @@ module Middleman
|
|
|
83
84
|
(@path_style.nil? ? true : @path_style)
|
|
84
85
|
end
|
|
85
86
|
|
|
87
|
+
def prefix=(prefix)
|
|
88
|
+
http_prefix = @http_prefix ? @http_prefix.sub(%r{^/}, "") : ""
|
|
89
|
+
if http_prefix.split("/").first == prefix
|
|
90
|
+
@prefix = ""
|
|
91
|
+
else
|
|
92
|
+
@prefix = prefix
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
86
96
|
def prefix
|
|
87
|
-
@prefix.
|
|
97
|
+
@prefix.blank? ? "" : "#{@prefix}/"
|
|
88
98
|
end
|
|
89
99
|
|
|
90
100
|
def version_bucket
|
data/spec/options_spec.rb
CHANGED
|
@@ -117,4 +117,14 @@ describe Middleman::S3Sync::Options do
|
|
|
117
117
|
its(:aws_secret_access_key) { should eq(aws_secret_access_key) }
|
|
118
118
|
its(:bucket) { should eq(bucket) }
|
|
119
119
|
end
|
|
120
|
+
|
|
121
|
+
context "prefix with http_prefix" do
|
|
122
|
+
before do
|
|
123
|
+
options.http_prefix = "/blog"
|
|
124
|
+
options.prefix = "blog"
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
its(:prefix) { should eq("")}
|
|
128
|
+
end
|
|
129
|
+
|
|
120
130
|
end
|
data/spec/resource_spec.rb
CHANGED
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.
|
|
4
|
+
version: 3.0.38
|
|
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-11-
|
|
12
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: middleman-core
|