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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 561234b232d8d9b1224e698eaf666b85f5bd5c2e
4
- data.tar.gz: 676365b786bb1917db01cf2892c38e8d1213c3ff
3
+ metadata.gz: 3fc17c496fe930a8b5bb5a1dd189d10adf1d4b6d
4
+ data.tar.gz: 845c03741c5c2aa939e28d57c1d1ddced4513d0b
5
5
  SHA512:
6
- metadata.gz: 85a28d6ed372877f119e5eb98b3d7785e28438c14218c552ff136a812262960f174451a508fd6946a47cd759d6a06a96a3b22a92a88420ec0437932204cc5662
7
- data.tar.gz: 0ad1d01d491b2e3a44e8075d2df2aee92116f391752e93e6d206194f425d3b34a5f4af28b46c5b68736060046c3ee7caa51be8c1cd7d41010d95d2bd7429dfe6
6
+ metadata.gz: a0c673a7b2852d160411c20068b2f0b2ddf555c499c8fdc78faef134820dfa9d9792a978819cf8e362d1f1997ca08ff44fdbd38ac8d489eb619d9b3011f3bfab
7
+ data.tar.gz: 28fd1356f98ea93e5ecdddbb14c27c84c4996ee34b98031bc51481584d8b3c77e7f65cbd3599eaf2b09cd81523dd6294b44e736470721ddcb8021aec2cf31594
data/changelog.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 1.3.1
6
+
7
+ * Print to stdout the initial state of the diff progress indicator
8
+
5
9
  ## 1.3.0
6
10
 
7
11
  * Show a progress indicator when calculating diff
@@ -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
- 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
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
- DiffProgressIndicator.render_ordinal_direction @ordinal_direction
44
+ render_next_step
38
45
  end
39
46
 
40
47
  def render_next_step
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.3.0"
6
+ s.version = "1.3.1"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Lauri Lehmijoki"]
9
9
  s.email = ["lauri.lehmijoki@iki.fi"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki