jekyll-watch 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: 64cb80b9afc5e464e42ccd20658f001f71856e4f
4
- data.tar.gz: 49d4d3a313e6b1fac58a94739eb007cf821022a7
3
+ metadata.gz: f2559d546529d452fbfc4387f7bb56679aa4956a
4
+ data.tar.gz: 40fe28683feefb432429a66868dce80aa65ce5f0
5
5
  SHA512:
6
- metadata.gz: cbb2274b9ae797df7da042d6a6c3e6510cceb9cfe30ee3e48072e4e0d6fdf1a9d759168e7cd04901f86586b8659d1b354b6a29e42ac2c88843e404000a517a00
7
- data.tar.gz: ced5380e200c75092858a34e5d3296eeaa44dc520aad41cfceb2f132cca36893787278db8d30e7444387facb434c32e926e8a0232a9d277aecb5cfeb81736a0f
6
+ metadata.gz: 552c2c19ee03cb3747c0a05d12f183878471972b7cde73bcb141964d8bca3eeeda8b14b42a786e8069362208e71740e77bd144605793e8c5e3c955df6b12aa99
7
+ data.tar.gz: 1868ad224d5e2618f247bbc8ad31013188c4a6122f4cdc073d3c8f8ac5406d91ed28606d30d61b05d4d2646ab3420dc143e67db1f098b7e349c82b00bb61e677
@@ -19,7 +19,7 @@ module Jekyll
19
19
  # options - A Hash of options passed to the command
20
20
  #
21
21
  # Returns nothing.
22
- def watch(site, options)
22
+ def watch(_site, options)
23
23
  Jekyll::Watcher.watch(options)
24
24
  end
25
25
 
@@ -5,11 +5,13 @@ module Jekyll
5
5
  extend self
6
6
 
7
7
  def watch(options)
8
+ ENV["LISTEN_GEM_DEBUGGING"] ||= "1" if options['verbose']
9
+
8
10
  site = Jekyll::Site.new(options)
9
11
  listener = build_listener(site, options)
10
12
  listener.start
11
13
 
12
- Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options['source']}'"
14
+ Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options["source"]}'"
13
15
 
14
16
  unless options['serving']
15
17
  trap("INT") do
@@ -20,7 +22,7 @@ module Jekyll
20
22
 
21
23
  sleep_forever
22
24
  end
23
- rescue ThreadError => e
25
+ rescue ThreadError
24
26
  # You pressed Ctrl-C, oh my!
25
27
  end
26
28
 
@@ -35,20 +37,21 @@ module Jekyll
35
37
  end
36
38
 
37
39
  def listen_handler(site)
38
- proc { |modified, added, removed|
40
+ proc do |modified, added, removed|
39
41
  t = Time.now
40
42
  c = modified + added + removed
41
43
  n = c.length
42
- print Jekyll.logger.message("Regenerating:", "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")} ")
44
+ print Jekyll.logger.message("Regenerating:",
45
+ "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")} ")
43
46
  begin
44
47
  site.process
45
- puts "...done in #{Time.now - t} seconds."
48
+ puts "...done in #{Time.now - t} seconds."
46
49
  rescue => e
47
50
  puts "...error:"
48
51
  Jekyll.logger.warn "Error:", e.message
49
52
  Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information."
50
53
  end
51
- }
54
+ end
52
55
  end
53
56
 
54
57
  def custom_excludes(options)
@@ -56,7 +59,7 @@ module Jekyll
56
59
  end
57
60
 
58
61
  def config_files(options)
59
- %w[yml yaml toml].map do |ext|
62
+ %w(yml yaml toml).map do |ext|
60
63
  Jekyll.sanitized_path(options['source'], "_config.#{ext}")
61
64
  end
62
65
  end
@@ -80,17 +83,16 @@ module Jekyll
80
83
 
81
84
  paths.map do |p|
82
85
  absolute_path = Pathname.new(p).expand_path
83
- if absolute_path.exist?
84
- begin
85
- relative_path = absolute_path.relative_path_from(source).to_s
86
- unless relative_path.start_with?('../')
87
- path_to_ignore = Regexp.new(Regexp.escape(relative_path))
88
- Jekyll.logger.debug "Watcher:", "Ignoring #{path_to_ignore}"
89
- path_to_ignore
90
- end
91
- rescue ArgumentError
92
- # Could not find a relative path
86
+ next unless absolute_path.exist?
87
+ begin
88
+ relative_path = absolute_path.relative_path_from(source).to_s
89
+ unless relative_path.start_with?('../')
90
+ path_to_ignore = Regexp.new(Regexp.escape(relative_path))
91
+ Jekyll.logger.debug "Watcher:", "Ignoring #{path_to_ignore}"
92
+ path_to_ignore
93
93
  end
94
+ rescue ArgumentError
95
+ # Could not find a relative path
94
96
  end
95
97
  end.compact + [/\.jekyll\-metadata/]
96
98
  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: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-23 00:00:00.000000000 Z
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: listen
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.35.1
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.35.1
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
124
  version: '0'
111
125
  requirements: []
112
126
  rubyforge_project:
113
- rubygems_version: 2.2.3
127
+ rubygems_version: 2.5.1
114
128
  signing_key:
115
129
  specification_version: 4
116
130
  summary: Rebuild your Jekyll site when a file changes with the `--watch` switch.