Merge pull request #5017 from DirtyF/rubocop-exe

Merge pull request 5017
This commit is contained in:
jekyllbot 2016-06-15 14:36:21 -07:00 committed by GitHub
commit 8fd287edba
2 changed files with 17 additions and 14 deletions

View File

@ -4,7 +4,6 @@ AllCops:
Include:
- lib/**/*.rb
Exclude:
- exe/jekyll
- lib/jekyll/collection.rb
- lib/jekyll/command.rb
- lib/jekyll/configuration.rb

View File

@ -1,10 +1,10 @@
#!/usr/bin/env ruby
STDOUT.sync = true
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), *%w( .. lib ))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w( .. lib )))
require 'jekyll'
require 'mercenary'
require "jekyll"
require "mercenary"
Jekyll::PluginManager.require_from_bundler
@ -12,22 +12,26 @@ Jekyll::Deprecator.process(ARGV)
Mercenary.program(:jekyll) do |p|
p.version Jekyll::VERSION
p.description 'Jekyll is a blog-aware, static site generator in Ruby'
p.syntax 'jekyll <subcommand> [options]'
p.description "Jekyll is a blog-aware, static site generator in Ruby"
p.syntax "jekyll <subcommand> [options]"
p.option 'source', '-s', '--source [DIR]', 'Source directory (defaults to ./)'
p.option 'destination', '-d', '--destination [DIR]', 'Destination directory (defaults to ./_site)'
p.option 'safe', '--safe', 'Safe mode (defaults to false)'
p.option 'plugins_dir', '-p', '--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]', Array, 'Plugins directory (defaults to ./_plugins)'
p.option 'layouts_dir', '--layouts DIR', String, 'Layouts directory (defaults to ./_layouts)'
p.option 'profile', '--profile', 'Generate a Liquid rendering profile'
p.option "source", "-s", "--source [DIR]", "Source directory (defaults to ./)"
p.option "destination", "-d", "--destination [DIR]",
"Destination directory (defaults to ./_site)"
p.option "safe", "--safe", "Safe mode (defaults to false)"
p.option "plugins_dir", "-p", "--plugins PLUGINS_DIR1[,PLUGINS_DIR2[,...]]", Array,
"Plugins directory (defaults to ./_plugins)"
p.option "layouts_dir", "--layouts DIR", String,
"Layouts directory (defaults to ./_layouts)"
p.option "profile", "--profile", "Generate a Liquid rendering profile"
Jekyll::External.require_if_present(Jekyll::External.blessed_gems) do |g|
cmd = g.split('-').last
cmd = g.split("-").last
p.command(cmd.to_sym) do |c|
c.syntax cmd
c.action do
Jekyll.logger.abort_with "You must install the '#{g}' gem to use the 'jekyll #{cmd}' command."
Jekyll.logger.abort_with "You must install the '#{g}' gem" \
" to use the 'jekyll #{cmd}' command."
end
end
end