s3_website 1.2.1 → 1.3.0
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/changelog.md +4 -0
- data/features/cloudfront.feature +1 -0
- data/features/delete.feature +1 -0
- data/features/jekyll-support.feature +1 -0
- data/features/nanoc-support.feature +1 -0
- data/features/push.feature +4 -0
- data/features/security.feature +1 -0
- data/features/step_definitions/steps.rb +18 -0
- data/lib/s3_website/diff_helper.rb +84 -6
- data/s3_website.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 561234b232d8d9b1224e698eaf666b85f5bd5c2e
|
4
|
+
data.tar.gz: 676365b786bb1917db01cf2892c38e8d1213c3ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85a28d6ed372877f119e5eb98b3d7785e28438c14218c552ff136a812262960f174451a508fd6946a47cd759d6a06a96a3b22a92a88420ec0437932204cc5662
|
7
|
+
data.tar.gz: 0ad1d01d491b2e3a44e8075d2df2aee92116f391752e93e6d206194f425d3b34a5f4af28b46c5b68736060046c3ee7caa51be8c1cd7d41010d95d2bd7429dfe6
|
data/changelog.md
CHANGED
data/features/cloudfront.feature
CHANGED
@@ -24,6 +24,7 @@ Feature: Invalidate the Cloudfront distribution
|
|
24
24
|
And the output should equal
|
25
25
|
"""
|
26
26
|
Deploying features/support/test_site_dirs/cdn-powered.with-one-change.blog.fi/_site/* to s3-website-test.net
|
27
|
+
Calculating diff ... done
|
27
28
|
Uploading 1 changed file(s)
|
28
29
|
Upload index.html: Success!
|
29
30
|
Done! Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
|
data/features/delete.feature
CHANGED
@@ -11,6 +11,7 @@ Feature: remove an S3 website page from S3
|
|
11
11
|
And the output should equal
|
12
12
|
"""
|
13
13
|
Deploying features/support/test_site_dirs/unpublish-a-post.com/_site/* to s3-website-test.net
|
14
|
+
Calculating diff ... done
|
14
15
|
No new or changed files to upload
|
15
16
|
Delete index.html: Success!
|
16
17
|
Done! Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
|
data/features/push.feature
CHANGED
@@ -11,6 +11,7 @@ Feature: upload S3 website to S3
|
|
11
11
|
And the output should contain
|
12
12
|
"""
|
13
13
|
Deploying features/support/test_site_dirs/my.blog.com/_site/* to s3-website-test.net
|
14
|
+
Calculating diff ... done
|
14
15
|
Uploading 2 new file(s)
|
15
16
|
"""
|
16
17
|
And the output should contain
|
@@ -55,6 +56,7 @@ Feature: upload S3 website to S3
|
|
55
56
|
And the output should contain
|
56
57
|
"""
|
57
58
|
Deploying features/support/test_site_dirs/new-and-changed-files.com/_site/* to s3-website-test.net
|
59
|
+
Calculating diff ... done
|
58
60
|
Uploading 1 new and 1 changed file(s)
|
59
61
|
"""
|
60
62
|
And the output should contain
|
@@ -78,6 +80,7 @@ Feature: upload S3 website to S3
|
|
78
80
|
And the output should equal
|
79
81
|
"""
|
80
82
|
Deploying features/support/test_site_dirs/only-changed-files.com/_site/* to s3-website-test.net
|
83
|
+
Calculating diff ... done
|
81
84
|
Uploading 1 changed file(s)
|
82
85
|
Upload index.html: Success!
|
83
86
|
Done! Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
|
@@ -91,6 +94,7 @@ Feature: upload S3 website to S3
|
|
91
94
|
And the output should equal
|
92
95
|
"""
|
93
96
|
Deploying features/support/test_site_dirs/no-new-or-changed-files.com/_site/* to s3-website-test.net
|
97
|
+
Calculating diff ... done
|
94
98
|
No new or changed files to upload
|
95
99
|
Done! Go visit: http://s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
|
96
100
|
|
data/features/security.feature
CHANGED
@@ -8,6 +8,7 @@ Feature: Security
|
|
8
8
|
And the output should equal
|
9
9
|
"""
|
10
10
|
Deploying features/support/test_site_dirs/site-that-contains-s3-website-file.com/_site/* to another-s3-website-test.net
|
11
|
+
Calculating diff ... done
|
11
12
|
No new or changed files to upload
|
12
13
|
Done! Go visit: http://another-s3-website-test.net.s3-website-us-east-1.amazonaws.com/index.html
|
13
14
|
|
@@ -58,6 +58,24 @@ def push_files
|
|
58
58
|
}
|
59
59
|
end
|
60
60
|
|
61
|
+
module S3Website
|
62
|
+
class DiffHelper
|
63
|
+
class DiffProgressIndicator
|
64
|
+
def initialize(start_msg, end_msg)
|
65
|
+
puts "#{start_msg} #{end_msg}"
|
66
|
+
end
|
67
|
+
|
68
|
+
def render_next_step
|
69
|
+
# Simplify testing of stdout by doing nothing here.
|
70
|
+
end
|
71
|
+
|
72
|
+
def finish
|
73
|
+
# Simplify testing of stdout by doing nothing here.
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
61
79
|
module Kernel
|
62
80
|
require 'stringio'
|
63
81
|
|
@@ -1,12 +1,22 @@
|
|
1
1
|
module S3Website
|
2
2
|
class DiffHelper
|
3
3
|
def self.resolve_files_to_upload(s3_bucket, site_dir, config)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
progress_indicator = DiffProgressIndicator.new('Calculating diff', "... done\n")
|
5
|
+
s3_data_source = Filey::DataSources::AwsSdkS3.new(s3_bucket, config) { |filey|
|
6
|
+
progress_indicator.render_next_step
|
7
|
+
}
|
8
|
+
fs_data_source = Filey::DataSources::FileSystem.new(site_dir) { |filey|
|
9
|
+
progress_indicator.render_next_step
|
10
|
+
}
|
11
|
+
changed_local_files = Filey::Comparison.list_changed(
|
12
|
+
fs_data_source,
|
13
|
+
s3_data_source
|
14
|
+
)
|
15
|
+
new_local_files = Filey::Comparison.list_missing(
|
16
|
+
fs_data_source,
|
17
|
+
s3_data_source
|
18
|
+
)
|
19
|
+
progress_indicator.finish
|
10
20
|
[ normalise(changed_local_files), normalise(new_local_files) ]
|
11
21
|
end
|
12
22
|
|
@@ -17,5 +27,73 @@ module S3Website
|
|
17
27
|
filey.full_path.sub(/\.\//, '')
|
18
28
|
}
|
19
29
|
end
|
30
|
+
|
31
|
+
class DiffProgressIndicator
|
32
|
+
def initialize(init_msg, end_msg)
|
33
|
+
@end_msg = end_msg
|
34
|
+
@ordinal_direction = 'n' # start from north
|
35
|
+
print init_msg
|
36
|
+
print ' '
|
37
|
+
DiffProgressIndicator.render_ordinal_direction @ordinal_direction
|
38
|
+
end
|
39
|
+
|
40
|
+
def render_next_step
|
41
|
+
@ordinal_direction = DiffProgressIndicator.next_ordinal_direction @ordinal_direction
|
42
|
+
print("\b" + DiffProgressIndicator.render_ordinal_direction(@ordinal_direction))
|
43
|
+
end
|
44
|
+
|
45
|
+
def finish
|
46
|
+
print "\b"
|
47
|
+
print @end_msg
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def self.render_ordinal_direction(ordinal_direction)
|
53
|
+
case ordinal_direction
|
54
|
+
when 'n'
|
55
|
+
'|'
|
56
|
+
when 'ne'
|
57
|
+
'/'
|
58
|
+
when 'e'
|
59
|
+
'-'
|
60
|
+
when 'se'
|
61
|
+
'\\'
|
62
|
+
when 's'
|
63
|
+
'|'
|
64
|
+
when 'sw'
|
65
|
+
'/'
|
66
|
+
when 'w'
|
67
|
+
'-'
|
68
|
+
when 'nw'
|
69
|
+
'\\'
|
70
|
+
else
|
71
|
+
raise 'Unknown ordinal direction ' + ordinal_direction
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.next_ordinal_direction(current_ordinal_direction)
|
76
|
+
case current_ordinal_direction
|
77
|
+
when 'n'
|
78
|
+
'ne'
|
79
|
+
when 'ne'
|
80
|
+
'e'
|
81
|
+
when 'e'
|
82
|
+
'se'
|
83
|
+
when 'se'
|
84
|
+
's'
|
85
|
+
when 's'
|
86
|
+
'sw'
|
87
|
+
when 'sw'
|
88
|
+
'w'
|
89
|
+
when 'w'
|
90
|
+
'nw'
|
91
|
+
when 'nw'
|
92
|
+
'n'
|
93
|
+
else
|
94
|
+
raise 'Unknown ordinal direction ' + current_ordinal_direction
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
20
98
|
end
|
21
99
|
end
|
data/s3_website.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 = "s3_website"
|
6
|
-
s.version = "1.
|
6
|
+
s.version = "1.3.0"
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ["Lauri Lehmijoki"]
|
9
9
|
s.email = ["lauri.lehmijoki@iki.fi"]
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.default_executable = %q{s3_website}
|
19
19
|
|
20
20
|
s.add_dependency 'aws-sdk', '~> 1.8.5'
|
21
|
-
s.add_dependency 'filey-diff', '~> 1.
|
21
|
+
s.add_dependency 'filey-diff', '~> 1.4'
|
22
22
|
s.add_dependency 'simple-cloudfront-invalidator', '~> 1'
|
23
23
|
s.add_dependency 'erubis', '~> 2.7.0'
|
24
24
|
s.add_dependency 'mime-types', '= 1.19'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3_website
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lauri Lehmijoki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: simple-cloudfront-invalidator
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|