Commit bfc31d08 authored by Youhei SASAKI's avatar Youhei SASAKI

Imported Upstream version 1.0.0

parents
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
*.bundle
*.so
*.o
*.a
mkmf.log
Copyright (c) 2014 Parker Moore
MIT License
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:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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.
# Jekyll Watch
Rebuild your Jekyll site when a file changes with the `--watch` switch.
## Installation
**`jekyll-watch` comes pre-installed with Jekyll 2.1 or greater.**
Add this line to your application's Gemfile:
gem 'jekyll-watch'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jekyll-watch
## Usage
Pass the `--watch` flag to `jekyll build` or `jekyll serve`:
```bash
$ jekyll build --watch
$ jekyll serve --watch
```
The `--watch` flag can be used in combination with any other flags for those
two commands, except `--detach` for the `serve` command.
## Contributing
1. Fork it ( https://github.com/jekyll/jekyll-watch/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request
require "bundler/gem_tasks"
# coding: utf-8
Gem::Specification.new do |spec|
spec.name = "jekyll-watch"
spec.version = "1.0.0"
spec.authors = ["Parker Moore"]
spec.email = ["parkrmoore@gmail.com"]
spec.summary = %q{Rebuild your Jekyll site when a file changes with the `--watch` switch.}
spec.homepage = "https://github.com/jekyll/jekyll-watch"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0")
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]
spec.add_runtime_dependency "listen", "~> 2.7"
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/
spec.add_runtime_dependency "wdm", "~> 0.1.0"
end
spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "rake"
end
require "jekyll/commands/watch"
module Jekyll
module Commands
class Watch < Command
class << self
def init_with_program(prog)
# noop
end
# Build your jekyll site
# Continuously watch if `watch` is set to true in the config.
def process(options)
Jekyll.logger.log_level = :error if options['quiet']
watch(site, options) if options['watch']
end
# Watch for file changes and rebuild the site.
#
# site - A Jekyll::Site instance
# options - A Hash of options passed to the command
#
# Returns nothing.
def watch(site, options)
require 'listen'
listener = Listen.to(
options['source'],
:ignore => ignore_paths(options),
:force_polling => options['force_polling']
) do |modified, added, removed|
t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
n = modified.length + added.length + removed.length
print Jekyll.logger.formatted_topic("Regenerating:") + "#{n} files at #{t} "
begin
process_site(site)
puts "...done."
rescue => e
puts "...error:"
Jekyll.logger.warn "Error:", e.message
Jekyll.logger.warn "Error:", "Run jekyll build --trace for more information."
end
end
listener.start
Jekyll.logger.info "Auto-regeneration:", "enabled for '#{options['source']}'"
unless options['serving']
trap("INT") do
listener.stop
puts " Halting auto-regeneration."
exit 0
end
loop { sleep 1000 }
end
end
end
end
end
end
--- !ruby/object:Gem::Specification
name: jekyll-watch
version: !ruby/object:Gem::Version
version: 1.0.0
platform: ruby
authors:
- Parker Moore
autorequire:
bindir: bin
cert_chain: []
date: 2014-06-27 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: listen
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '2.7'
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '2.7'
- !ruby/object:Gem::Dependency
name: bundler
requirement: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '1.6'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - "~>"
- !ruby/object:Gem::Version
version: '1.6'
- !ruby/object:Gem::Dependency
name: rake
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
description:
email:
- parkrmoore@gmail.com
executables: []
extensions: []
extra_rdoc_files: []
files:
- ".gitignore"
- Gemfile
- LICENSE.txt
- README.md
- Rakefile
- jekyll-watch.gemspec
- lib/jekyll-watch.rb
- lib/jekyll/commands/watch.rb
homepage: https://github.com/jekyll/jekyll-watch
licenses:
- MIT
metadata: {}
post_install_message:
rdoc_options: []
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: '0'
requirements: []
rubyforge_project:
rubygems_version: 2.2.2
signing_key:
specification_version: 4
summary: Rebuild your Jekyll site when a file changes with the `--watch` switch.
test_files: []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment