middleman-s3_sync 4.0.2 → 4.0.3

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: 43571ce8542c63438002421697693bdb2df3811d
4
- data.tar.gz: deef0be22c915cf14538f00a3c2403820d6328ac
3
+ metadata.gz: e3827f761cc837c4b40aab6fd29a7737fc7039b1
4
+ data.tar.gz: 3c42ac240f148cb08d7daa3e72dacb29c11c59c0
5
5
  SHA512:
6
- metadata.gz: 7c63611753c1cc11b91d9893c8e0470b94b99c65142631d920cf78b184e852833c62891834a8d716f05393a605237089f5b48f785a63e9c288084ced1ed9cf37
7
- data.tar.gz: 9a4897fe6772f0bb913871cfa400cbc2b751a8ede6b8f1a08280065f677292c3771649343996b6695dc89cef373edc32988811732386c23a60c43065b66bf749
6
+ metadata.gz: edbf4fb9046f29261590403220112597f01221350ac223b815856d7a89f833969fbf2a9eb9cb430a9241ffc37603e8baa049baa6ddc64ac1f5b62c6205773453
7
+ data.tar.gz: 370d1524220e776febbce93868341fc2d381163768dbfb7b698c64e802625f495aefa0ff833735c270362d9c16f0d812523c517ac0ea05c71c7551e3c8b93efe
@@ -3,9 +3,8 @@ language: ruby
3
3
  sudo: false
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.0.0
7
- - 2.1.5
8
6
  - 2.2.3
7
+ - 2.3.1
9
8
 
10
9
  notifications:
11
10
  webhooks:
data/README.md CHANGED
@@ -39,7 +39,7 @@ You need to add the following code to your ```config.rb``` file:
39
39
 
40
40
  ```ruby
41
41
  activate :s3_sync do |s3_sync|
42
- s3_sync.bucket = 'my.bucket.com' # The name of the S3 bucket you are targetting. This is globally unique.
42
+ s3_sync.bucket = 'my.bucket.com' # The name of the S3 bucket you are targeting. This is globally unique.
43
43
  s3_sync.region = 'us-west-1' # The AWS region for your bucket.
44
44
  s3_sync.aws_access_key_id = 'AWS KEY ID'
45
45
  s3_sync.aws_secret_access_key = 'AWS SECRET KEY'
@@ -182,6 +182,19 @@ You can specify which environment to run Middleman under using the
182
182
 
183
183
  $ middleman s3_sync --environment=production
184
184
 
185
+ You can set up separate sync environments in config.rb like this:
186
+
187
+ ```ruby
188
+ configure :staging do
189
+ activate :s3_sync do |s3_sync|
190
+ s3_sync.bucket = '<bucket'
191
+ ...
192
+ end
193
+ end
194
+ ```
195
+
196
+ See the Usage section above for all the s3_sync. options to include. Currently, the .s3_sync file does not allow separate environments.
197
+
185
198
  #### Dry Run
186
199
 
187
200
  You can perform a dry run to see what would be the result of a sync
@@ -25,6 +25,7 @@ module Middleman
25
25
  option :dry_run, false, 'Whether to perform a dry-run'
26
26
  option :index_document, nil, 'S3 custom index document path'
27
27
  option :error_document, nil, 'S3 custom error document path'
28
+ option :content_types, {}, 'Custom content types'
28
29
 
29
30
  expose_to_config :s3_sync_options, :default_caching_policy, :caching_policy
30
31
 
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module S3Sync
3
- VERSION = "4.0.2"
3
+ VERSION = "4.0.3"
4
4
  end
5
5
  end
@@ -7,59 +7,59 @@ describe Middleman::S3Sync::BrowserCachePolicy do
7
7
  subject(:policy) { Middleman::S3Sync::BrowserCachePolicy.new(options) }
8
8
 
9
9
  it "should be blank" do
10
- policy.should_not be_nil
11
-
12
- policy.to_s.should_not =~ /max-age=/
13
- policy.to_s.should_not =~ /s-maxage=/
14
- policy.to_s.should_not =~ /public/
15
- policy.to_s.should_not =~ /private/
16
- policy.to_s.should_not =~ /no-cache/
17
- policy.to_s.should_not =~ /no-store/
18
- policy.to_s.should_not =~ /must-revalidate/
19
- policy.to_s.should_not =~ /proxy-revalidate/
20
- policy.expires.should be_nil
10
+ expect(policy).to_not eq nil
11
+
12
+ expect(policy.to_s).to_not match /max-age=/
13
+ expect(policy.to_s).to_not match /s-maxage=/
14
+ expect(policy.to_s).to_not match /public/
15
+ expect(policy.to_s).to_not match /private/
16
+ expect(policy.to_s).to_not match /no-cache/
17
+ expect(policy.to_s).to_not match /no-store/
18
+ expect(policy.to_s).to_not match /must-revalidate/
19
+ expect(policy.to_s).to_not match /proxy-revalidate/
20
+ expect(policy.expires).to eq nil
21
21
  end
22
22
 
23
23
  context "setting max-age" do
24
24
  let(:options) { { max_age: 300 } }
25
25
 
26
- its(:to_s) { should =~ /max-age=300/ }
26
+ its(:to_s) { is_expected.to match /max-age=300/ }
27
27
  end
28
28
 
29
29
  context "setting s-maxage" do
30
30
  let(:options) { { s_maxage: 300 } }
31
31
 
32
- its(:to_s) { should =~ /s-maxage=300/ }
32
+ its(:to_s) { is_expected.to match /s-maxage=300/ }
33
33
  end
34
34
 
35
35
  context "set public flag" do
36
36
  let(:options) { { public: true } }
37
- its(:to_s) { should =~ /public/ }
37
+ its(:to_s) { is_expected.to match /public/ }
38
38
  end
39
39
 
40
40
  context "it should set the private flag if it is set to true" do
41
41
  let(:options) { { private: true } }
42
- its(:to_s) { should =~ /private/ }
42
+ its(:to_s) { is_expected.to match /private/ }
43
43
  end
44
44
 
45
45
  context "it should set the no-cache flag when set property" do
46
46
  let(:options) { { no_cache: true }}
47
- its(:to_s) { should =~ /no-cache/ }
47
+ its(:to_s) { is_expected.to match /no-cache/ }
48
48
  end
49
49
 
50
50
  context "setting the no-store flag" do
51
51
  let(:options) { { no_store: true } }
52
- its(:to_s) { should =~ /no-store/ }
52
+ its(:to_s) { is_expected.to match /no-store/ }
53
53
  end
54
54
 
55
55
  context "setting the must-revalidate policy" do
56
56
  let(:options) { { must_revalidate: true } }
57
- its(:to_s) { should =~ /must-revalidate/ }
57
+ its(:to_s) { is_expected.to match /must-revalidate/ }
58
58
  end
59
59
 
60
60
  context "setting the proxy-revalidate policy" do
61
61
  let(:options) { { proxy_revalidate: true } }
62
- its(:to_s) { should =~ /proxy-revalidate/ }
62
+ its(:to_s) { is_expected.to match /proxy-revalidate/ }
63
63
  end
64
64
 
65
65
  context "divide caching policiies with a comma and a space" do
@@ -67,16 +67,16 @@ describe Middleman::S3Sync::BrowserCachePolicy do
67
67
 
68
68
  it "splits policies eith commans and spaces" do
69
69
  policies = policy.to_s.split(/, /)
70
- policies.length.should == 2
71
- policies.first.should == 'max-age=300'
72
- policies.last.should == 'public'
70
+ expect(policies.length).to eq 2
71
+ expect(policies.first).to eq 'max-age=300'
72
+ expect(policies.last).to eq 'public'
73
73
  end
74
74
  end
75
75
 
76
76
  context "set the expiration date" do
77
77
  let(:options) { { expires: 1.years.from_now } }
78
78
 
79
- its(:expires) { should == CGI.rfc1123_date(1.year.from_now )}
79
+ its(:expires) { is_expected.to eq CGI.rfc1123_date(1.year.from_now )}
80
80
  end
81
81
  end
82
82
  end
@@ -92,7 +92,7 @@ describe "Storing and retrieving policies" do
92
92
  it "finds the policies by the mime-type excluding the parameters" do
93
93
  caching_policy.add_caching_policy("text/html", max_age: 300)
94
94
 
95
- expect(policy).to_not be_nil
95
+ expect(policy).to_not eq nil
96
96
  expect(policy.policies.max_age).to eq(300)
97
97
  end
98
98
  end
@@ -107,14 +107,14 @@ describe "Handling situations where the content type is nil" do
107
107
  it "returns the default caching policy when the content type is nil" do
108
108
  caching_policy.add_caching_policy(:default, max_age:(60 * 60 * 24 * 365))
109
109
 
110
- expect(caching_policy.caching_policy_for(nil)).to_not be_nil
110
+ expect(caching_policy.caching_policy_for(nil)).to_not eq nil
111
111
  expect(caching_policy.caching_policy_for(nil).policies[:max_age]).to eq(60 * 60 * 24 * 365)
112
112
  end
113
113
 
114
114
  it "returns the default caching policy when the content type is blank" do
115
115
  caching_policy.add_caching_policy(:default, max_age:(60 * 60 * 24 * 365))
116
116
 
117
- expect(caching_policy.caching_policy_for("")).to_not be_nil
117
+ expect(caching_policy.caching_policy_for("")).to_not eq nil
118
118
  expect(caching_policy.caching_policy_for("").policies[:max_age]).to eq(60 * 60 * 24 * 365)
119
119
  end
120
120
  end
@@ -25,7 +25,7 @@ describe Middleman::S3Sync::Resource do
25
25
  allow(File).to receive(:exist?).with('build/path/to/resource.html').and_return(true)
26
26
  end
27
27
 
28
- its(:status) { should eq :new }
28
+ its(:status) { is_expected.to eq :new }
29
29
 
30
30
  it "does not have a remote equivalent" do
31
31
  expect(resource).not_to be_remote
@@ -35,9 +35,9 @@ describe Middleman::S3Sync::Resource do
35
35
  expect(resource).to be_local
36
36
  end
37
37
 
38
- its(:path) { should eq 'path/to/resource.html'}
39
- its(:local_path) { should eq 'build/path/to/resource.html' }
40
- its(:remote_path) { should eq 'path/to/resource.html' }
38
+ its(:path) { is_expected.to eq 'path/to/resource.html'}
39
+ its(:local_path) { is_expected.to eq 'build/path/to/resource.html' }
40
+ its(:remote_path) { is_expected.to eq 'path/to/resource.html' }
41
41
  end
42
42
 
43
43
  context "with a prefix set" do
@@ -54,9 +54,9 @@ describe Middleman::S3Sync::Resource do
54
54
  expect(resource).to be_local
55
55
  end
56
56
 
57
- its(:path) { should eq 'path/to/resource.html' }
58
- its(:local_path) { should eq 'build/path/to/resource.html' }
59
- its(:remote_path) { should eq 'bob/path/to/resource.html' }
57
+ its(:path) { is_expected.to eq 'path/to/resource.html' }
58
+ its(:local_path) { is_expected.to eq 'build/path/to/resource.html' }
59
+ its(:remote_path) { is_expected.to eq 'bob/path/to/resource.html' }
60
60
  end
61
61
 
62
62
  context "gzipped" do
@@ -73,9 +73,9 @@ describe Middleman::S3Sync::Resource do
73
73
  expect(resource).to be_local
74
74
  end
75
75
 
76
- its(:path) { should eq 'path/to/resource.html' }
77
- its(:local_path) { should eq 'build/path/to/resource.html.gz' }
78
- its(:remote_path) { should eq 'path/to/resource.html' }
76
+ its(:path) { is_expected.to eq 'path/to/resource.html' }
77
+ its(:local_path) { is_expected.to eq 'build/path/to/resource.html.gz' }
78
+ its(:remote_path) { is_expected.to eq 'path/to/resource.html' }
79
79
  end
80
80
  end
81
81
 
@@ -98,7 +98,7 @@ describe Middleman::S3Sync::Resource do
98
98
  allow(File).to receive(:exist?).with('build/path/to/resource.html').and_return(false)
99
99
  end
100
100
 
101
- its(:status) { should eq :deleted }
101
+ its(:status) { is_expected.to eq :deleted }
102
102
  it "does not have a remote equivalent" do
103
103
  expect(resource).to be_remote
104
104
  end
@@ -107,9 +107,9 @@ describe Middleman::S3Sync::Resource do
107
107
  expect(resource).not_to be_local
108
108
  end
109
109
 
110
- its(:path) { should eq 'path/to/resource.html'}
111
- its(:local_path) { should eq 'build/path/to/resource.html' }
112
- its(:remote_path) { should eq 'path/to/resource.html' }
110
+ its(:path) { is_expected.to eq 'path/to/resource.html'}
111
+ its(:local_path) { is_expected.to eq 'build/path/to/resource.html' }
112
+ its(:remote_path) { is_expected.to eq 'path/to/resource.html' }
113
113
  end
114
114
 
115
115
  context "with a prefix set" do
@@ -119,7 +119,7 @@ describe Middleman::S3Sync::Resource do
119
119
  options.prefix = "bob"
120
120
  end
121
121
 
122
- its(:status) { should eq :deleted }
122
+ its(:status) { is_expected.to eq :deleted }
123
123
  it "does not have a remote equivalent" do
124
124
  expect(resource).to be_remote
125
125
  end
@@ -128,9 +128,9 @@ describe Middleman::S3Sync::Resource do
128
128
  expect(resource).not_to be_local
129
129
  end
130
130
 
131
- its(:path) { should eq 'path/to/resource.html' }
132
- its(:local_path) { should eq 'build/path/to/resource.html' }
133
- its(:remote_path) { should eq 'bob/path/to/resource.html' }
131
+ its(:path) { is_expected.to eq 'path/to/resource.html' }
132
+ its(:local_path) { is_expected.to eq 'build/path/to/resource.html' }
133
+ its(:remote_path) { is_expected.to eq 'bob/path/to/resource.html' }
134
134
  end
135
135
 
136
136
  context "gzipped" do
@@ -140,7 +140,7 @@ describe Middleman::S3Sync::Resource do
140
140
  options.prefer_gzip = true
141
141
  end
142
142
 
143
- its(:status) { should eq :deleted }
143
+ its(:status) { is_expected.to eq :deleted }
144
144
  it "does not have a remote equivalent" do
145
145
  expect(resource).to be_remote
146
146
  end
@@ -149,9 +149,9 @@ describe Middleman::S3Sync::Resource do
149
149
  expect(resource).not_to be_local
150
150
  end
151
151
 
152
- its(:path) { should eq 'path/to/resource.html' }
153
- its(:local_path) { should eq 'build/path/to/resource.html' }
154
- its(:remote_path) { should eq 'path/to/resource.html' }
152
+ its(:path) { is_expected.to eq 'path/to/resource.html' }
153
+ its(:local_path) { is_expected.to eq 'build/path/to/resource.html' }
154
+ its(:remote_path) { is_expected.to eq 'path/to/resource.html' }
155
155
  end
156
156
  end
157
157
  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: 4.0.2
4
+ version: 4.0.3
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: 2016-02-07 00:00:00.000000000 Z
12
+ date: 2016-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  version: '0'
300
300
  requirements: []
301
301
  rubyforge_project:
302
- rubygems_version: 2.4.5
302
+ rubygems_version: 2.5.1
303
303
  signing_key:
304
304
  specification_version: 4
305
305
  summary: Tries really, really hard not to push files to S3.