guard-jekyll-plus 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +16 -0
- data/README.md +4 -4
- data/guard-jekyll-plus.gemspec +2 -2
- data/lib/guard/{jekyll → jekyll-plus}/templates/Guardfile +1 -1
- data/lib/guard/jekyll-plus/version.rb +5 -0
- data/lib/guard/{jekyll.rb → jekyllplus.rb} +16 -18
- data/test/Gemfile.lock +5 -3
- data/test/Guardfile +1 -3
- data/test/_config.yml +0 -3
- data/test/index.html +1 -1
- metadata +5 -5
- data/lib/guard/jekyll/version.rb +0 -5
data/CHANGELOG.md
CHANGED
@@ -9,3 +9,19 @@
|
|
9
9
|
### 1.1.1
|
10
10
|
- Improved colorized output.
|
11
11
|
- Rescued errors kill the Jekyll WEBrick server.
|
12
|
+
|
13
|
+
## 1.1.2
|
14
|
+
|
15
|
+
New config options
|
16
|
+
|
17
|
+
- `config_hash` allows passing a config hash instead of an array of config files.
|
18
|
+
- `silent` allows you to prevent all output other than exception errors.
|
19
|
+
|
20
|
+
### 1.2.0
|
21
|
+
|
22
|
+
**Changed** Now you must use jekyllplus in your guard file. Check the readme for updates.
|
23
|
+
|
24
|
+
- Changed guard name to jekyllplus to avoid issues with Guard Jekyll.
|
25
|
+
- Fixed installation of template guardfile
|
26
|
+
- Improved handling of Jekyll WEBrick server
|
27
|
+
|
data/README.md
CHANGED
@@ -38,7 +38,7 @@ Navigate to your Jekyll project directory and create a Guardfile using:
|
|
38
38
|
Or if you already have a Guardfile, add a Jekyll guard.
|
39
39
|
|
40
40
|
```ruby
|
41
|
-
guard :
|
41
|
+
guard :jekyllplus do
|
42
42
|
watch /.*/
|
43
43
|
ignore /^_site/
|
44
44
|
end
|
@@ -59,7 +59,7 @@ If your Jekyll project has a non-standard directory stucture like this:
|
|
59
59
|
You would do this instead:
|
60
60
|
|
61
61
|
```ruby
|
62
|
-
guard :
|
62
|
+
guard :jekyllplus do
|
63
63
|
watch /^source/
|
64
64
|
watch /_config.yml/
|
65
65
|
end
|
@@ -88,7 +88,7 @@ This guard has two configurations.
|
|
88
88
|
Here's how you would add `txt` to the list of file extensions which triggers a Jekyll build.
|
89
89
|
|
90
90
|
```ruby
|
91
|
-
guard :
|
91
|
+
guard :jekyllplus, :extensions => ['txt'] do
|
92
92
|
watch /.*/
|
93
93
|
ignore /^_site/
|
94
94
|
end
|
@@ -102,7 +102,7 @@ which don't match these extensions will be simply copied over to the destination
|
|
102
102
|
Here's how you might tell Jekyll to read from multiple configuration files.
|
103
103
|
|
104
104
|
```ruby
|
105
|
-
guard :
|
105
|
+
guard :jekyllplus, :config => ['settings.yml', 'override.yml'] do
|
106
106
|
watch /.*/
|
107
107
|
ignore /^_site/
|
108
108
|
end
|
data/guard-jekyll-plus.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'guard/jekyll/version'
|
4
|
+
require 'guard/jekyll-plus/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "guard-jekyll-plus"
|
8
|
-
gem.version = Guard::
|
8
|
+
gem.version = Guard::JekyllPlusVersion::VERSION
|
9
9
|
gem.authors = ["Brandon Mathis"]
|
10
10
|
gem.email = ["brandon@imathis.com"]
|
11
11
|
gem.description = %q{A Guard plugin for smarter Jekyll watching}
|
@@ -6,7 +6,7 @@ require 'guard/guard'
|
|
6
6
|
require 'jekyll'
|
7
7
|
|
8
8
|
module Guard
|
9
|
-
class
|
9
|
+
class Jekyllplus < Guard
|
10
10
|
|
11
11
|
def initialize (watchers=[], options={})
|
12
12
|
super
|
@@ -25,21 +25,13 @@ module Guard
|
|
25
25
|
|
26
26
|
# The config_hash option should be a hash ready to be consumed by Jekyll's Site class.
|
27
27
|
#
|
28
|
-
@config =
|
28
|
+
@config = jekyll_config(@options)
|
29
29
|
|
30
|
-
# Override configuration with
|
30
|
+
# Override configuration with guard option values
|
31
31
|
#
|
32
32
|
@config['show_drafts'] ||= @options[:drafts]
|
33
33
|
@config['future'] ||= @options[:future]
|
34
34
|
|
35
|
-
# Ensure required configurations are set
|
36
|
-
# This ensures that config_hash option will succeed if set
|
37
|
-
#
|
38
|
-
@config['source'] ||= Dir.pwd
|
39
|
-
@config['desitnation'] ||= File.join(Dir.pwd, '_site')
|
40
|
-
@config['permalink'] ||= 'date'
|
41
|
-
@config['limit_posts'] ||= 0
|
42
|
-
|
43
35
|
# Store vars for easy internal access
|
44
36
|
#
|
45
37
|
@source = local_path @config['source']
|
@@ -65,7 +57,7 @@ module Guard
|
|
65
57
|
|
66
58
|
if @options[:serve]
|
67
59
|
start_server
|
68
|
-
|
60
|
+
build
|
69
61
|
UI.info "#{@label} " + "watching and serving at #{@config['host']}:#{@config['port']}#{@config['baseurl']}" unless @config[:silent]
|
70
62
|
else
|
71
63
|
build
|
@@ -200,9 +192,15 @@ module Guard
|
|
200
192
|
end
|
201
193
|
|
202
194
|
def jekyll_config(options)
|
203
|
-
|
204
|
-
|
205
|
-
|
195
|
+
puts options
|
196
|
+
if options[:config_hash]
|
197
|
+
config = options[:config_hash]
|
198
|
+
elsif options[:config]
|
199
|
+
config_files = options[:config]
|
200
|
+
config_files = [config_files] unless config_files.is_a? Array
|
201
|
+
config = { "config" => config_files}
|
202
|
+
end
|
203
|
+
::Jekyll.configuration(config)
|
206
204
|
end
|
207
205
|
|
208
206
|
def local_path(path)
|
@@ -224,8 +222,8 @@ module Guard
|
|
224
222
|
end
|
225
223
|
end
|
226
224
|
|
227
|
-
def server
|
228
|
-
proc{ Process.
|
225
|
+
def server(config)
|
226
|
+
proc{ Process.fork { ::Jekyll::Commands::Serve.process(config) } }
|
229
227
|
end
|
230
228
|
|
231
229
|
def kill
|
@@ -234,7 +232,7 @@ module Guard
|
|
234
232
|
|
235
233
|
def start_server
|
236
234
|
return @pid if alive?
|
237
|
-
@pid = instance_eval &server
|
235
|
+
@pid = instance_eval &server(@config)
|
238
236
|
end
|
239
237
|
|
240
238
|
def stop_server
|
data/test/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
guard-jekyll-plus (1.
|
4
|
+
guard-jekyll-plus (1.2.0)
|
5
5
|
guard (>= 1.1.0)
|
6
6
|
jekyll (>= 1.0.0)
|
7
7
|
|
@@ -25,7 +25,7 @@ GEM
|
|
25
25
|
pry (>= 0.9.10)
|
26
26
|
thor (>= 0.14.6)
|
27
27
|
highline (1.6.19)
|
28
|
-
jekyll (1.0
|
28
|
+
jekyll (1.1.0)
|
29
29
|
classifier (~> 1.3)
|
30
30
|
colorator (~> 0.1)
|
31
31
|
commander (~> 4.1.3)
|
@@ -34,6 +34,7 @@ GEM
|
|
34
34
|
liquid (~> 2.3)
|
35
35
|
maruku (~> 0.5)
|
36
36
|
pygments.rb (~> 0.5.0)
|
37
|
+
redcarpet (~> 2.2.2)
|
37
38
|
safe_yaml (~> 0.7.0)
|
38
39
|
kramdown (1.0.2)
|
39
40
|
liquid (2.5.0)
|
@@ -50,7 +51,7 @@ GEM
|
|
50
51
|
coderay (~> 1.0.5)
|
51
52
|
method_source (~> 0.8)
|
52
53
|
slop (~> 3.4)
|
53
|
-
pygments.rb (0.5.
|
54
|
+
pygments.rb (0.5.2)
|
54
55
|
posix-spawn (~> 0.3.6)
|
55
56
|
yajl-ruby (~> 1.1.0)
|
56
57
|
rb-fsevent (0.9.3)
|
@@ -58,6 +59,7 @@ GEM
|
|
58
59
|
ffi (>= 0.5.0)
|
59
60
|
rb-kqueue (0.2.0)
|
60
61
|
ffi (>= 0.5.0)
|
62
|
+
redcarpet (2.2.2)
|
61
63
|
safe_yaml (0.7.1)
|
62
64
|
slop (3.4.5)
|
63
65
|
syntax (1.0.0)
|
data/test/Guardfile
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# A sample Guardfile
|
2
2
|
# More info at https://github.com/guard/guard#readme
|
3
3
|
#
|
4
|
-
require 'guard/guard'
|
5
|
-
require 'jekyll'
|
6
4
|
|
7
|
-
guard :
|
5
|
+
guard :jekyllplus, :config => ['_config.yml', '_override.yml'], :serve => true do
|
8
6
|
watch /.*/
|
9
7
|
ignore /^_site/
|
10
8
|
end
|
data/test/_config.yml
CHANGED
data/test/index.html
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-jekyll-plus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
@@ -58,9 +58,9 @@ files:
|
|
58
58
|
- README.md
|
59
59
|
- Rakefile
|
60
60
|
- guard-jekyll-plus.gemspec
|
61
|
-
- lib/guard/jekyll
|
62
|
-
- lib/guard/jekyll/
|
63
|
-
- lib/guard/
|
61
|
+
- lib/guard/jekyll-plus/templates/Guardfile
|
62
|
+
- lib/guard/jekyll-plus/version.rb
|
63
|
+
- lib/guard/jekyllplus.rb
|
64
64
|
- test/.gitignore
|
65
65
|
- test/Gemfile
|
66
66
|
- test/Gemfile.lock
|