jekyll-s3 2.2.2 → 2.2.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/README.md CHANGED
@@ -9,7 +9,7 @@ Deploy your jekyll site to S3.
9
9
 
10
10
  * Upload your site to AWS S3
11
11
  * Help you use AWS Cloudfront to distribute your Jekyll blog
12
- * Create the S3 bucket for you
12
+ * Create an S3 website for you
13
13
 
14
14
  ## Install
15
15
 
@@ -73,11 +73,31 @@ _jekyll_s3.yml`. This creates you a bucket in the US Standard region.
73
73
 
74
74
  ## Development
75
75
 
76
+ ### Versioning
77
+
78
+ Jekyll-s3 uses [Semantic Versioning](http://semver.org).
79
+
80
+ ### Tests
81
+
76
82
  * Install bundler and run `bundle install`
77
83
  * Run all tests by invoking `rake test`
78
84
  * Run the integration tests by running `bundle exec cucumber`
79
85
  * Run the unit tests by running `bundle exec rspec spec/lib/*.rb`
80
86
 
87
+ ### Contributing
88
+
89
+ We (users and developers of Jekyll-s3) welcome patches, pull requests and
90
+ ideas for improvement.
91
+
92
+ When sending pull requests, please accompany them with tests. Favor BDD style
93
+ in test descriptions. Use VCR-backed integration tests where possible. For
94
+ reference, you can look at the existing Jekyll-s3 tests.
95
+
96
+ If you are not sure how to test your pull request, you can ask the main
97
+ developer (currently Lauri Lehmijoki) to supplement the request with tests.
98
+ However, by including proper tests, you increase the chances of your pull
99
+ request being incorporated into future releases.
100
+
81
101
  ## License
82
102
 
83
103
  MIT
data/Rakefile CHANGED
@@ -6,6 +6,11 @@ task :default => 'test'
6
6
 
7
7
  desc "Run tests"
8
8
  task :test do
9
- sh "bundle exec rspec"
10
- sh "bundle exec cucumber --tags ~@skip-on-travis"
9
+ sh "bundle exec rspec"
10
+ sh "bundle exec cucumber --tags ~@skip-on-travis"
11
+ end
12
+
13
+ desc 'Run work-in-progress features'
14
+ task "cucumber:wip" do
15
+ sh "bundle exec cucumber --tags @wip"
11
16
  end
data/changelog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.3
4
+
5
+ * Allow bugfixes for transitive dependencies *filey-diff*,
6
+ *simple-cloudfront-invalidator* and *configure-s3-website*, since they are
7
+ semantically versioned
8
+
3
9
  ## 2.2.2
4
10
 
5
11
  * Remove debug code that wrote the list of site files into /tmp/test.txt
@@ -1,4 +1,4 @@
1
- Feature: Command-line interface feedback
1
+ Feature: Instructions for a new user
2
2
 
3
3
  Scenario: Run jekyll-s3 in the wrong directory
4
4
  When I run `jekyll-s3`
@@ -7,8 +7,6 @@ Feature: Command-line interface feedback
7
7
  I can't find any directory called _site. Are you in the right directory?
8
8
  """
9
9
 
10
- # For some reason this scenario fails on Travis but on on localhost
11
- @skip-on-travis
12
10
  Scenario: Run jekyll-s3 for the first time
13
11
  Given a directory named "_site"
14
12
  When I run `jekyll-s3`
@@ -67,17 +65,3 @@ Feature: Command-line interface feedback
67
65
  s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
68
66
  s3_bucket: your.blog.bucket.com
69
67
  """
70
-
71
- Scenario: Run jekyll-s3
72
- Given a directory named "_site"
73
- And a file named "_jekyll_s3.yml" with:
74
- """
75
- s3_id: YOUR_AWS_S3_ACCESS_KEY_ID
76
- s3_secret: YOUR_AWS_S3_SECRET_ACCESS_KEY
77
- s3_bucket: your.blog.bucket.com
78
- """
79
- When I run `jekyll-s3`
80
- Then the output should contain:
81
- """
82
- Deploying _site/* to your.blog.bucket.com
83
- """
@@ -0,0 +1,23 @@
1
+ Feature: Using Jekyll-s3 as a library
2
+
3
+ As a developer
4
+ I want to programmatically use the Jekyll-s3 API
5
+ So that I can extend my software with the capabilities of Jekyll-s3
6
+
7
+ @one-file-to-delete
8
+ Scenario: Developer wants feedback on how many files Jekyll-s3 deleted
9
+ When my Jekyll site is in "features/support/test_site_dirs/unpublish-a-post.com"
10
+ Then jekyll-s3 will push my blog to S3
11
+ And report that it deleted 1 file from S3
12
+
13
+ @new-and-changed-files
14
+ Scenario: Developer wants feedback on how many files Jekyll-s3 uploaded
15
+ When my Jekyll site is in "features/support/test_site_dirs/new-and-changed-files.com"
16
+ Then jekyll-s3 will push my blog to S3
17
+ And report that it uploaded 1 new and 1 changed files into S3
18
+
19
+ @s3-and-cloudfront-when-updating-a-file
20
+ Scenario: Developer wants feedback on how many Cloudfront items Jekyll-s3 invalidated
21
+ When my Jekyll site is in "features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi"
22
+ Then jekyll-s3 will push my blog to S3 and invalidate the Cloudfront distribution
23
+ And report that it invalidated 2 Cloudfront item
@@ -9,14 +9,33 @@ Feature: Invalidate the Cloudfront distribution
9
9
  @s3-and-cloudfront
10
10
  Scenario: Upload to S3 and then invalidate the Cloudfront distribution
11
11
  When my Jekyll site is in "features/support/test_site_dirs/cdn-powered.blog.fi"
12
- And the configuration contains the Cloudfront distribution id
13
12
  Then jekyll-s3 will push my blog to S3 and invalidate the Cloudfront distribution
14
- And report that it uploaded 2 new and 0 changed files into S3
13
+ And the output should equal
14
+ """
15
+ Deploying _site/* to jekyll-s3-test.net
16
+ Uploading 2 new file(s)
17
+ Upload css/styles.css: Success!
18
+ Upload index.html: Success!
19
+ Done! Go visit: http://jekyll-s3-test.net.s3.amazonaws.com/index.html
20
+ Invalidating Cloudfront items...
21
+ /
22
+ succeeded
23
+
24
+ """
15
25
 
16
26
  @s3-and-cloudfront-when-updating-a-file
17
27
  Scenario: Update a blog entry and then upload
18
28
  When my Jekyll site is in "features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi"
19
- And the configuration contains the Cloudfront distribution id
20
29
  Then jekyll-s3 will push my blog to S3 and invalidate the Cloudfront distribution
21
- And report that it uploaded 0 new and 1 changed files into S3
22
- And report that it invalidated only the changed file on Cloudfront
30
+ And the output should equal
31
+ """
32
+ Deploying _site/* to jekyll-s3-test.net
33
+ Uploading 1 changed file(s)
34
+ Upload index.html: Success!
35
+ Done! Go visit: http://jekyll-s3-test.net.s3.amazonaws.com/index.html
36
+ Invalidating Cloudfront items...
37
+ /index.html
38
+ /
39
+ succeeded
40
+
41
+ """
@@ -8,5 +8,11 @@ Feature: remove a Jekyll blog post from S3
8
8
  Scenario: The user deletes a blog post
9
9
  When my Jekyll site is in "features/support/test_site_dirs/unpublish-a-post.com"
10
10
  Then jekyll-s3 will push my blog to S3
11
- And report that it uploaded 0 new and 0 changed files into S3
12
- And report that it deleted 1 file from S3
11
+ And the output should equal
12
+ """
13
+ Deploying _site/* to jekyll-s3-test.net
14
+ No new or changed files to upload
15
+ Delete index.html: Success!
16
+ Done! Go visit: http://jekyll-s3-test.net.s3.amazonaws.com/index.html
17
+
18
+ """
@@ -8,22 +8,51 @@ Feature: upload Jekyll site to S3
8
8
  Scenario: Push a new Jekyll site to S3
9
9
  When my Jekyll site is in "features/support/test_site_dirs/my.blog.com"
10
10
  Then jekyll-s3 will push my blog to S3
11
- And report that it uploaded 2 new and 0 changed files into S3
11
+ And the output should equal
12
+ """
13
+ Deploying _site/* to jekyll-s3-test.net
14
+ Uploading 2 new file(s)
15
+ Upload css/styles.css: Success!
16
+ Upload index.html: Success!
17
+ Done! Go visit: http://jekyll-s3-test.net.s3.amazonaws.com/index.html
18
+
19
+ """
12
20
 
13
21
  @new-and-changed-files
14
22
  Scenario: Upload a new blog post and change an old post
15
23
  When my Jekyll site is in "features/support/test_site_dirs/new-and-changed-files.com"
16
24
  Then jekyll-s3 will push my blog to S3
17
- And report that it uploaded 1 new and 1 changed files into S3
25
+ And the output should equal
26
+ """
27
+ Deploying _site/* to jekyll-s3-test.net
28
+ Uploading 1 new and 1 changed file(s)
29
+ Upload css/styles.css: Success!
30
+ Upload index.html: Success!
31
+ Done! Go visit: http://jekyll-s3-test.net.s3.amazonaws.com/index.html
32
+
33
+ """
18
34
 
19
35
  @only-changed-files
20
36
  Scenario: Update an existing blog post
21
37
  When my Jekyll site is in "features/support/test_site_dirs/only-changed-files.com"
22
38
  Then jekyll-s3 will push my blog to S3
23
- And report that it uploaded 0 new and 1 changed files into S3
39
+ And the output should equal
40
+ """
41
+ Deploying _site/* to jekyll-s3-test.net
42
+ Uploading 1 changed file(s)
43
+ Upload index.html: Success!
44
+ Done! Go visit: http://jekyll-s3-test.net.s3.amazonaws.com/index.html
45
+
46
+ """
24
47
 
25
48
  @no-new-or-changed-files
26
49
  Scenario: The user runs jekyll-s3 even though he doesn't have new or changed posts
27
50
  When my Jekyll site is in "features/support/test_site_dirs/no-new-or-changed-files.com"
28
51
  Then jekyll-s3 will push my blog to S3
29
- And report that it uploaded 0 new and 0 changed files into S3
52
+ And the output should equal
53
+ """
54
+ Deploying _site/* to jekyll-s3-test.net
55
+ No new or changed files to upload
56
+ Done! Go visit: http://jekyll-s3-test.net.s3.amazonaws.com/index.html
57
+
58
+ """
@@ -1,3 +1,5 @@
1
+ require 'rspec'
2
+
1
3
  When /^my Jekyll site is in "(.*?)"$/ do |blog_dir|
2
4
  @blog_dir = blog_dir
3
5
  end
@@ -6,38 +8,49 @@ When /^jekyll-s3 will push my blog to S3$/ do
6
8
  do_run
7
9
  end
8
10
 
9
- When /^the configuration contains the Cloudfront distribution id$/ do
10
- # Just here for readability
11
- end
12
-
13
11
  Then /^jekyll-s(\d+) will push my blog to S(\d+) and invalidate the Cloudfront distribution$/ do
14
12
  |arg1, arg2|
15
13
  do_run
16
14
  end
17
15
 
16
+ Then /^the output should equal$/ do |expected_console_output|
17
+ @console_output.should eq(expected_console_output)
18
+ end
19
+
18
20
  Then /^report that it uploaded (\d+) new and (\d+) changed files into S3$/ do
19
21
  |new_count, changed_count|
20
- raise unless @amount_of_new_files == new_count.to_i
21
- raise unless @amount_of_changed_files == changed_count.to_i
22
+ @amount_of_new_files.should == new_count.to_i
23
+ @amount_of_changed_files.should == changed_count.to_i
22
24
  end
23
25
 
24
- Then /^report that it deleted (\d+) file from S3$/ do |amount_of_deleted_files|
25
- raise unless @amount_of_deleted_files == amount_of_deleted_files.to_i
26
+ Then /^report that it invalidated (\d+) Cloudfront item$/ do |expected|
27
+ @amount_of_invalidated_items.should == expected.to_i
26
28
  end
27
29
 
28
- Then /^report that it invalidated only the changed file on Cloudfront$/ do
29
- # The Cloudfront root object is always invalidated;
30
- # it counts as an invalidation.
31
- root_object_count = 1
32
- changed_files = 1
33
- raise unless @amount_of_invalidated_items == root_object_count + changed_files
30
+ Then /^report that it deleted (\d+) file from S3$/ do |amount_of_deleted_files|
31
+ @amount_of_deleted_files.should == amount_of_deleted_files.to_i
34
32
  end
35
33
 
36
34
  def do_run
37
- in_headless_mode = true
38
- result = Jekyll::S3::CLI.new.run("#{@blog_dir}/_site", in_headless_mode)
39
- @amount_of_new_files = result[:new_files_count]
40
- @amount_of_changed_files = result[:changed_files_count]
41
- @amount_of_deleted_files = result[:deleted_files_count]
42
- @amount_of_invalidated_items = result[:invalidated_items_count]
35
+ @console_output = capture_stdout {
36
+ in_headless_mode = true
37
+ result = Jekyll::S3::CLI.new.run("#{@blog_dir}/_site", in_headless_mode)
38
+ @amount_of_new_files = result[:new_files_count]
39
+ @amount_of_changed_files = result[:changed_files_count]
40
+ @amount_of_deleted_files = result[:deleted_files_count]
41
+ @amount_of_invalidated_items = result[:invalidated_items_count]
42
+ }
43
+ end
44
+
45
+ module Kernel
46
+ require 'stringio'
47
+
48
+ def capture_stdout
49
+ out = StringIO.new
50
+ $stdout = out
51
+ yield
52
+ out.string
53
+ ensure
54
+ $stdout = STDOUT
55
+ end
43
56
  end
@@ -18,7 +18,9 @@ After do
18
18
  end
19
19
  # End of following from 'aruba/cucumber'
20
20
 
21
- Then /^the file "([^"]*)" should contain:$/ do |file, exact_content|
22
- check_file_content(file, exact_content, true)
21
+ # Disable colored gem. Its difficult to test output when it contains colored strings.
22
+ module Colored
23
+ def colorize(string, options = {})
24
+ string
25
+ end
23
26
  end
24
-
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.2.2"
6
+ s.version = "2.2.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"]
@@ -16,16 +16,16 @@ distribution, making it easy to deliver your blog via the CDN.}
16
16
  s.default_executable = %q{jekyll-s3}
17
17
 
18
18
  s.add_dependency 'aws-sdk', '~> 1.8.0'
19
- s.add_dependency 'filey-diff', '~> 1.0.0'
20
- s.add_dependency 'simple-cloudfront-invalidator', '~> 1.0.0'
19
+ s.add_dependency 'filey-diff', '~> 1.0'
20
+ s.add_dependency 'simple-cloudfront-invalidator', '~> 1.0'
21
21
  s.add_dependency 'erubis', '~> 2.7.0'
22
22
  s.add_dependency 'mime-types', '= 1.19'
23
- s.add_dependency 'configure-s3-website', '~> 1.0.0'
23
+ s.add_dependency 'configure-s3-website', '~> 1.0'
24
24
 
25
25
  s.add_development_dependency 'rspec'
26
26
  s.add_development_dependency 'rspec-expectations'
27
27
  s.add_development_dependency 'cucumber'
28
- s.add_development_dependency 'aruba', '>= 0.4.7'
28
+ s.add_development_dependency 'aruba', '~> 0.5.1'
29
29
  s.add_development_dependency 'rake'
30
30
  s.add_development_dependency 'vcr'
31
31
  s.add_development_dependency 'webmock', '~> 1.8.0'
@@ -11,7 +11,7 @@ describe Jekyll::S3::Retry do
11
11
  }
12
12
  rescue
13
13
  end
14
- retries.should be (4)
14
+ retries.should be(4)
15
15
  end
16
16
 
17
17
  it "throws an error if all retries fail" do
@@ -28,7 +28,7 @@ describe Jekyll::S3::Retry do
28
28
  retries += 1
29
29
  raise Exception if retries < 2
30
30
  }
31
- retries.should be (2)
31
+ retries.should be(2)
32
32
  end
33
33
  end
34
34
  end
@@ -87,12 +87,18 @@ describe Jekyll::S3::Uploader do
87
87
  end
88
88
 
89
89
  context '#load_all_local_files' do
90
- describe 'dotfile support' do
91
- it 'loads also dotfiles' do
92
- files = Jekyll::S3::Uploader.send(:load_all_local_files,
93
- 'spec/sample_files/hyde_site/_site')
94
- files.should eq(['index.html', '.vimrc'])
95
- end
90
+ let(:files) {
91
+ Jekyll::S3::Uploader.send(:load_all_local_files,
92
+ 'spec/sample_files/hyde_site/_site')
93
+ }
94
+
95
+ it 'loads regular files' do
96
+ files.should include('css/styles.css')
97
+ files.should include('index.html')
98
+ end
99
+
100
+ it 'loads also dotfiles' do
101
+ files.should include('.vimrc')
96
102
  end
97
103
  end
98
104
  end
@@ -0,0 +1,3 @@
1
+ body {
2
+
3
+ }
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.2.2
4
+ version: 2.2.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: 2012-12-31 00:00:00.000000000 Z
13
+ date: 2013-01-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: aws-sdk
@@ -35,7 +35,7 @@ dependencies:
35
35
  requirements:
36
36
  - - ~>
37
37
  - !ruby/object:Gem::Version
38
- version: 1.0.0
38
+ version: '1.0'
39
39
  type: :runtime
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.0
46
+ version: '1.0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: simple-cloudfront-invalidator
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 1.0.0
54
+ version: '1.0'
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  requirements:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: 1.0.0
62
+ version: '1.0'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: erubis
65
65
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ dependencies:
99
99
  requirements:
100
100
  - - ~>
101
101
  - !ruby/object:Gem::Version
102
- version: 1.0.0
102
+ version: '1.0'
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
@@ -107,7 +107,7 @@ dependencies:
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: 1.0.0
110
+ version: '1.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -161,17 +161,17 @@ dependencies:
161
161
  requirement: !ruby/object:Gem::Requirement
162
162
  none: false
163
163
  requirements:
164
- - - ! '>='
164
+ - - ~>
165
165
  - !ruby/object:Gem::Version
166
- version: 0.4.7
166
+ version: 0.5.1
167
167
  type: :development
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  none: false
171
171
  requirements:
172
- - - ! '>='
172
+ - - ~>
173
173
  - !ruby/object:Gem::Version
174
- version: 0.4.7
174
+ version: 0.5.1
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: rake
177
177
  requirement: !ruby/object:Gem::Requirement
@@ -247,7 +247,8 @@ files:
247
247
  - features/cassettes/cucumber_tags/only-changed-files.yml
248
248
  - features/cassettes/cucumber_tags/s3-and-cloudfront-when-updating-a-file.yml
249
249
  - features/cassettes/cucumber_tags/s3-and-cloudfront.yml
250
- - features/cli-output.feature
250
+ - features/instructions-for-new-user.feature
251
+ - features/jekyll-s3-as-library.feature
251
252
  - features/jekyll-s3-cloudfront.feature
252
253
  - features/jekyll-s3-delete.feature
253
254
  - features/jekyll-s3-upload.feature
@@ -290,6 +291,7 @@ files:
290
291
  - spec/lib/upload_spec.rb
291
292
  - spec/sample_files/hyde_site/_jekyll_s3.yml
292
293
  - spec/sample_files/hyde_site/_site/.vimrc
294
+ - spec/sample_files/hyde_site/_site/css/styles.css
293
295
  - spec/sample_files/hyde_site/_site/index.html
294
296
  - spec/spec_helper.rb
295
297
  homepage: https://github.com/laurilehmijoki/jekyll-s3
@@ -324,7 +326,8 @@ test_files:
324
326
  - features/cassettes/cucumber_tags/only-changed-files.yml
325
327
  - features/cassettes/cucumber_tags/s3-and-cloudfront-when-updating-a-file.yml
326
328
  - features/cassettes/cucumber_tags/s3-and-cloudfront.yml
327
- - features/cli-output.feature
329
+ - features/instructions-for-new-user.feature
330
+ - features/jekyll-s3-as-library.feature
328
331
  - features/jekyll-s3-cloudfront.feature
329
332
  - features/jekyll-s3-delete.feature
330
333
  - features/jekyll-s3-upload.feature
@@ -357,5 +360,6 @@ test_files:
357
360
  - spec/lib/upload_spec.rb
358
361
  - spec/sample_files/hyde_site/_jekyll_s3.yml
359
362
  - spec/sample_files/hyde_site/_site/.vimrc
363
+ - spec/sample_files/hyde_site/_site/css/styles.css
360
364
  - spec/sample_files/hyde_site/_site/index.html
361
365
  - spec/spec_helper.rb