s3_website 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +4 -0
- data/lib/s3_website/diff_helper.rb +24 -17
- data/s3_website.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fc17c496fe930a8b5bb5a1dd189d10adf1d4b6d
|
4
|
+
data.tar.gz: 845c03741c5c2aa939e28d57c1d1ddced4513d0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0c673a7b2852d160411c20068b2f0b2ddf555c499c8fdc78faef134820dfa9d9792a978819cf8e362d1f1997ca08ff44fdbd38ac8d489eb619d9b3011f3bfab
|
7
|
+
data.tar.gz: 28fd1356f98ea93e5ecdddbb14c27c84c4996ee34b98031bc51481584d8b3c77e7f65cbd3599eaf2b09cd81523dd6294b44e736470721ddcb8021aec2cf31594
|
data/changelog.md
CHANGED
@@ -1,27 +1,34 @@
|
|
1
1
|
module S3Website
|
2
2
|
class DiffHelper
|
3
3
|
def self.resolve_files_to_upload(s3_bucket, site_dir, config)
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
with_progress_indicator('Calculating diff') { |progress_indicator|
|
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
|
+
[ normalise(changed_local_files), normalise(new_local_files) ]
|
7
20
|
}
|
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
|
20
|
-
[ normalise(changed_local_files), normalise(new_local_files) ]
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
+
def self.with_progress_indicator(diff_msg)
|
26
|
+
progress_indicator = DiffProgressIndicator.new(diff_msg, "... done\n")
|
27
|
+
result = yield progress_indicator
|
28
|
+
progress_indicator.finish
|
29
|
+
result
|
30
|
+
end
|
31
|
+
|
25
32
|
def self.normalise(fileys)
|
26
33
|
fileys.map { |filey|
|
27
34
|
filey.full_path.sub(/\.\//, '')
|
@@ -34,7 +41,7 @@ module S3Website
|
|
34
41
|
@ordinal_direction = 'n' # start from north
|
35
42
|
print init_msg
|
36
43
|
print ' '
|
37
|
-
|
44
|
+
render_next_step
|
38
45
|
end
|
39
46
|
|
40
47
|
def render_next_step
|
data/s3_website.gemspec
CHANGED