jekyll-s3 2.4.2 → 2.4.3
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.
- data/.travis.yml +1 -0
- data/README.md +10 -0
- data/changelog.md +9 -0
- data/jekyll-s3.gemspec +1 -1
- data/lib/jekyll-s3/config_loader.rb +0 -1
- data/lib/jekyll-s3/endpoint.rb +3 -1
- data/lib/jekyll-s3/uploader.rb +1 -1
- data/spec/lib/config_loader_spec.rb +2 -2
- data/spec/lib/endpoint_spec.rb +21 -0
- data/spec/lib/keyboard_spec.rb +0 -6
- data/spec/lib/uploader_spec.rb +0 -3
- metadata +4 -2
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -125,6 +125,16 @@ bucket that are not on your local computer.
|
|
125
125
|
Enable the headless mode by adding the `--headless` or `-h` argument after
|
126
126
|
`jekyll-s3`.
|
127
127
|
|
128
|
+
## Using `jekyll-s3` as a library
|
129
|
+
|
130
|
+
By nature, `jekyll-s3` is a command-line interface tool. You can, however, use
|
131
|
+
it programmatically by calling the same API as the executable `jekyll-s3` does:
|
132
|
+
|
133
|
+
````ruby
|
134
|
+
is_headless = true
|
135
|
+
Jekyll::S3::CLI.new.run('/path/to/your/jekyll-site/_site/', is_headless)
|
136
|
+
````
|
137
|
+
|
128
138
|
## Known issues
|
129
139
|
|
130
140
|
None. Please send a pull request if you spot any.
|
data/changelog.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## 2.4.3
|
6
|
+
|
7
|
+
* Make `s3_endpoint` optional in `_jekyll_s3.yml` when using `jekyll-s3` as a
|
8
|
+
library
|
9
|
+
* Load dotfiles also with Ruby 2.0.0
|
10
|
+
|
11
|
+
The `Dir.glob` implementation changed a bit in Ruby 2, and this resulted in
|
12
|
+
`jekyll-s3` not uploading files that start with a dot.
|
13
|
+
|
5
14
|
## 2.4.2
|
6
15
|
|
7
16
|
* Fix problem where gzipped files were always re-uploaded
|
data/jekyll-s3.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "jekyll-s3"
|
6
|
-
s.version = "2.4.
|
6
|
+
s.version = "2.4.3"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Philippe Creux", "Lauri Lehmijoki"]
|
9
9
|
s.email = ["pcreux@gmail.com", "lauri.lehmijoki@iki.fi"]
|
@@ -24,7 +24,6 @@ s3_bucket: your.blog.bucket.com
|
|
24
24
|
# Raise MalformedConfigurationFileError if the configuration file does not contain the keys we expect
|
25
25
|
def self.load_configuration(site_dir)
|
26
26
|
config = load_yaml_file_and_validate site_dir
|
27
|
-
config['s3_endpoint'] = config['s3_endpoint'] || 'us-east-1'
|
28
27
|
return config
|
29
28
|
end
|
30
29
|
|
data/lib/jekyll-s3/endpoint.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
module Jekyll
|
2
2
|
module S3
|
3
3
|
class Endpoint
|
4
|
+
DEFAULT_LOCATION_CONSTRAINT = 'us-east-1'
|
4
5
|
attr_reader :region, :location_constraint, :hostname, :website_hostname
|
5
6
|
|
6
|
-
def initialize(location_constraint)
|
7
|
+
def initialize(location_constraint=nil)
|
8
|
+
location_constraint = DEFAULT_LOCATION_CONSTRAINT if location_constraint.nil?
|
7
9
|
raise "Invalid S3 location constraint #{location_constraint}" unless
|
8
10
|
location_constraints.has_key?location_constraint
|
9
11
|
@region = location_constraints.fetch(location_constraint)[:region]
|
data/lib/jekyll-s3/uploader.rb
CHANGED
@@ -8,9 +8,9 @@ describe Jekyll::S3::ConfigLoader do
|
|
8
8
|
config['s3_bucket'].should eq('galaxy')
|
9
9
|
end
|
10
10
|
|
11
|
-
it '
|
11
|
+
it 'does not define default endpoint' do
|
12
12
|
config = Jekyll::S3::ConfigLoader.load_configuration('spec/sample_files/hyde_site/_site')
|
13
|
-
config['s3_endpoint'].should
|
13
|
+
config['s3_endpoint'].should be_nil
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'reads the S3 endpoint setting from _jekyll_s3.yml' do
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'pp'
|
3
|
+
|
4
|
+
describe Jekyll::S3::Endpoint do
|
5
|
+
|
6
|
+
it 'uses the "us-east-1" as the default location' do
|
7
|
+
endpoint = Jekyll::S3::Endpoint.new
|
8
|
+
endpoint.location_constraint.should eq(Jekyll::S3::Endpoint::DEFAULT_LOCATION_CONSTRAINT)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'takes a valid location constraint as a constructor parameter' do
|
12
|
+
endpoint = Jekyll::S3::Endpoint.new('EU')
|
13
|
+
endpoint.location_constraint.should eq('EU')
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'fails if the location constraint is invalid' do
|
17
|
+
expect {
|
18
|
+
Jekyll::S3::Endpoint.new('andromeda')
|
19
|
+
}.to raise_error
|
20
|
+
end
|
21
|
+
end
|
data/spec/lib/keyboard_spec.rb
CHANGED
@@ -41,12 +41,6 @@ describe Jekyll::S3::Keyboard do
|
|
41
41
|
deleted_keys.should eq([])
|
42
42
|
end
|
43
43
|
|
44
|
-
it 'can keep all s3 objects' do
|
45
|
-
standard_input.stub(:gets).and_return("k", "k", "k")
|
46
|
-
deleted_keys = call_keyboard(s3_object_keys, standard_input)
|
47
|
-
deleted_keys.should eq([])
|
48
|
-
end
|
49
|
-
|
50
44
|
it 'can keep all s3 objects' do
|
51
45
|
standard_input.stub(:gets).and_return("K")
|
52
46
|
deleted_keys = call_keyboard(s3_object_keys, standard_input)
|
data/spec/lib/uploader_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-04-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: aws-sdk
|
@@ -305,6 +305,7 @@ files:
|
|
305
305
|
- lib/jekyll-s3/upload.rb
|
306
306
|
- lib/jekyll-s3/uploader.rb
|
307
307
|
- spec/lib/config_loader_spec.rb
|
308
|
+
- spec/lib/endpoint_spec.rb
|
308
309
|
- spec/lib/keyboard_spec.rb
|
309
310
|
- spec/lib/retry_spec.rb
|
310
311
|
- spec/lib/upload_spec.rb
|
@@ -396,6 +397,7 @@ test_files:
|
|
396
397
|
- features/support/test_site_dirs/unpublish-a-post.com/_site/css/styles.css
|
397
398
|
- features/support/vcr.rb
|
398
399
|
- spec/lib/config_loader_spec.rb
|
400
|
+
- spec/lib/endpoint_spec.rb
|
399
401
|
- spec/lib/keyboard_spec.rb
|
400
402
|
- spec/lib/retry_spec.rb
|
401
403
|
- spec/lib/upload_spec.rb
|