guard-jekyll 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.un~
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in guard-sprockets.gemspec
4
+ gemspec
data/README.markdown ADDED
@@ -0,0 +1,29 @@
1
+ ## What?
2
+ Run jekyll for you.
3
+
4
+ ## Use
5
+ if you haven't already `gem install jekyll`
6
+ then `gem install guard-jekyll`
7
+ in your project's directory root
8
+ `guard init`
9
+ `guard init jekyll`
10
+
11
+ which will add this to your Guardfile
12
+
13
+ guard 'jekyll' do
14
+ watch ('.*')
15
+ end
16
+
17
+ ## TODO
18
+ tests
19
+
20
+ ## License
21
+ (The MIT License)
22
+
23
+ Copyright (c) 2011 David Haslem
24
+
25
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
26
+
27
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
28
+
29
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,22 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require 'guard/jekyll'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "guard-jekyll"
7
+ s.version = Guard::Jekyll::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["David Haslem"]
10
+ s.email = ["therabidbanana@gmail.com"]
11
+ s.homepage = "http://davidhaslem.com"
12
+ s.summary = %q{guard file for jekyll}
13
+ s.description = %q{guard file for jekyll}
14
+
15
+ s.rubyforge_project = "guard-jekyll"
16
+
17
+ s.add_dependency 'guard', '>= 0.2.2'
18
+ s.add_dependency "jekyll"
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.require_paths = ['lib']
22
+ end
@@ -0,0 +1,56 @@
1
+ require 'guard'
2
+ require 'guard/guard'
3
+
4
+ require 'jekyll'
5
+
6
+ module Guard
7
+ class Jekyll < Guard
8
+
9
+ VERSION = '0.0.2'
10
+
11
+ def initialize(watchers=[], options={})
12
+ super
13
+ @working_path = File.expand_path(File.dirname("."))
14
+ end
15
+
16
+ def start
17
+ create_site
18
+ UI.info "Guard::Jekyll is watching for file changes..."
19
+ run_all
20
+ true
21
+ end
22
+
23
+ def run_all
24
+ jekyll!
25
+ end
26
+
27
+ def run_on_change(paths)
28
+ jekyll!
29
+ end
30
+
31
+ def run_on_deletion(paths)
32
+ jekyll!
33
+ end
34
+
35
+ private
36
+
37
+ def jekyll!
38
+ UI.info "Guard::Jekyll running."
39
+
40
+ @jekyll_site.process
41
+
42
+ UI.info "Guard::Jekyll complete."
43
+ end
44
+
45
+ def create_site
46
+ options = {
47
+ 'source' => @working_path,
48
+ 'destination' => File.join(@working_path, '_site'),
49
+ 'plugins' => File.join(@working_path, '_plugins')
50
+ }
51
+
52
+ config = ::Jekyll.configuration(options)
53
+ @jekyll_site = ::Jekyll::Site.new(config)
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,3 @@
1
+ guard 'jekyll' do
2
+ watch('(.*)')
3
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guard-jekyll
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - David Haslem
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: guard
16
+ requirement: &7049880 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 0.2.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *7049880
25
+ - !ruby/object:Gem::Dependency
26
+ name: jekyll
27
+ requirement: &7048480 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *7048480
36
+ description: guard file for jekyll
37
+ email:
38
+ - therabidbanana@gmail.com
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - .gitignore
44
+ - Gemfile
45
+ - README.markdown
46
+ - Rakefile
47
+ - guard-jekyll.gemspec
48
+ - lib/guard/jekyll.rb
49
+ - lib/guard/jekyll/templates/Guardfile
50
+ homepage: http://davidhaslem.com
51
+ licenses: []
52
+ post_install_message:
53
+ rdoc_options: []
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ required_rubygems_version: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubyforge_project: guard-jekyll
70
+ rubygems_version: 1.8.17
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: guard file for jekyll
74
+ test_files: []