jekyll-watch 2.0.0 → 2.1.0

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
  SHA256:
3
- metadata.gz: 5b995f8f1937dd0830a8347c44a27f87b28325c7614854f93337583423107256
4
- data.tar.gz: 2a275f462b1112f9993181dc1d7014b86d729fc73a092cbb99cdc71a071c11f7
3
+ metadata.gz: 2a3c6beb3a9b370d01f0217b3b4365771acee9c88c2424febde374a11f937f2c
4
+ data.tar.gz: ac5c2eecc84ff20f7da3d8f5052b2f7b0d4a88b1fbe3c36f1f58be5b78229648
5
5
  SHA512:
6
- metadata.gz: 21004c7e9c97022dbcdb58c4d10d2236c7e8f2592e60bb1539bd91645a10e8f0dbd4d926243439849e0004aa2ecb123ffda0abf81fe4abb11fa0bb268c8a0eb0
7
- data.tar.gz: '08b6ff0a2bb1c8016f96f71d0e91ed52250ef67177a660081cc4c72b54104ad965775aef247e329fdc8e46cb3f449cc8956a59dd8dd9cd8da22e753290e6b3c9'
6
+ metadata.gz: a773013780db2e082260b100769cc10dca7a94275d658fb778a4d6524cb8853a93757f29d572e02be45041af9567bd502d859ff4c95bbd8816fa6e65c1690aba
7
+ data.tar.gz: f486e639d6b6d1ea25e7c7e11ebf9583cbf2908058dec0acf0a811b158d9d5e4b7c88d3d80e1d7a4142ab8023435fc900272ae20ea260d60913394ce9877bf35
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Watch
5
- VERSION = "2.0.0".freeze
5
+ VERSION = "2.1.0"
6
6
  end
7
7
  end
@@ -13,7 +13,6 @@ module Jekyll
13
13
  Jekyll.logger.log_level = :error if options["quiet"]
14
14
  Jekyll::Watcher.watch(options) if options["watch"]
15
15
  end
16
-
17
16
  end
18
17
  end
19
18
  end
@@ -30,7 +30,7 @@ module Jekyll
30
30
  unless options["serving"]
31
31
  trap("INT") do
32
32
  listener.stop
33
- puts " Halting auto-regeneration."
33
+ Jekyll.logger.info "", "Halting auto-regeneration."
34
34
  exit 0
35
35
  end
36
36
 
@@ -41,6 +41,7 @@ module Jekyll
41
41
  end
42
42
 
43
43
  private
44
+
44
45
  def build_listener(site, options)
45
46
  Listen.to(
46
47
  options["source"],
@@ -50,36 +51,34 @@ module Jekyll
50
51
  )
51
52
  end
52
53
 
53
- private
54
54
  def listen_handler(site)
55
55
  proc do |modified, added, removed|
56
56
  t = Time.now
57
- c = modified + added + removed
57
+ c = normalize_encoding(modified + added + removed, site.source.encoding)
58
58
  n = c.length
59
- Jekyll.logger.info "Regenerating:",
60
- "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")}"
61
59
 
62
- c.map { |path| path.sub("#{site.source}/", "") }.each do |file|
63
- Jekyll.logger.info "", file
64
- end
60
+ Jekyll.logger.info "Regenerating:",
61
+ "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")}"
65
62
 
63
+ c.each { |path| Jekyll.logger.info "", path.sub("#{source_path}/", "") }
66
64
  process(site, t)
67
65
  end
68
66
  end
69
67
 
70
- private
68
+ def normalize_encoding(list, desired_encoding)
69
+ list.map { |entry| entry.encode!(desired_encoding, entry.encoding) }
70
+ end
71
+
71
72
  def custom_excludes(options)
72
73
  Array(options["exclude"]).map { |e| Jekyll.sanitized_path(options["source"], e) }
73
74
  end
74
75
 
75
- private
76
76
  def config_files(options)
77
77
  %w(yml yaml toml).map do |ext|
78
78
  Jekyll.sanitized_path(options["source"], "_config.#{ext}")
79
79
  end
80
80
  end
81
81
 
82
- private
83
82
  def to_exclude(options)
84
83
  [
85
84
  config_files(options),
@@ -93,7 +92,6 @@ module Jekyll
93
92
  # options - A Hash of options passed to the command
94
93
  #
95
94
  # Returns a list of relative paths from source that should be ignored
96
- private
97
95
  def listen_ignore_paths(options)
98
96
  source = Pathname.new(options["source"]).expand_path
99
97
  paths = to_exclude(options)
@@ -101,6 +99,7 @@ module Jekyll
101
99
  paths.map do |p|
102
100
  absolute_path = Pathname.new(p).expand_path
103
101
  next unless absolute_path.exist?
102
+
104
103
  begin
105
104
  relative_path = absolute_path.relative_path_from(source).to_s
106
105
  unless relative_path.start_with?("../")
@@ -114,12 +113,10 @@ module Jekyll
114
113
  end.compact + [%r!\.jekyll\-metadata!]
115
114
  end
116
115
 
117
- private
118
116
  def sleep_forever
119
117
  loop { sleep 1000 }
120
118
  end
121
119
 
122
- private
123
120
  def process(site, time)
124
121
  begin
125
122
  site.process
@@ -128,7 +125,7 @@ module Jekyll
128
125
  Jekyll.logger.warn "Error:", e.message
129
126
  Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information."
130
127
  end
131
- puts ""
128
+ Jekyll.logger.info ""
132
129
  end
133
130
  end
134
131
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-watch
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-02 00:00:00.000000000 Z
11
+ date: 2018-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen
@@ -81,19 +81,19 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rubocop
84
+ name: rubocop-jekyll
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.51'
89
+ version: '0.2'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.51'
96
+ version: '0.2'
97
97
  description:
98
98
  email:
99
99
  - parkrmoore@gmail.com
@@ -117,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
118
  - - ">="
119
119
  - !ruby/object:Gem::Version
120
- version: 2.1.0
120
+ version: 2.3.0
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ">="
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.7.1
128
+ rubygems_version: 2.7.7
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Rebuild your Jekyll site when a file changes with the `--watch` switch.