Merge branch 'master' of github.com:mojombo/jekyll
* 'master' of github.com:mojombo/jekyll: Print deprecation warnings for 'server', 'watch' and 'auto' when loaded from files. Fixes #972 Fixes multiple config loading. Closes #973. Rel: #945.
This commit is contained in:
commit
d33f45ff05
|
@ -46,7 +46,7 @@ command :build do |c|
|
||||||
c.syntax = 'jekyll build [options]'
|
c.syntax = 'jekyll build [options]'
|
||||||
c.description = 'Build your site'
|
c.description = 'Build your site'
|
||||||
|
|
||||||
c.option '--config [CONFIG_FILE]', Array, 'Custom configuration file'
|
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
||||||
c.option '--future', 'Publishes posts with a future date'
|
c.option '--future', 'Publishes posts with a future date'
|
||||||
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
||||||
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
||||||
|
@ -54,7 +54,6 @@ command :build do |c|
|
||||||
c.option '--drafts', 'Render posts in the _drafts folder'
|
c.option '--drafts', 'Render posts in the _drafts folder'
|
||||||
|
|
||||||
c.action do |args, options|
|
c.action do |args, options|
|
||||||
options.defaults :serving => false
|
|
||||||
options = normalize_options(options.__hash__)
|
options = normalize_options(options.__hash__)
|
||||||
options = Jekyll.configuration(options)
|
options = Jekyll.configuration(options)
|
||||||
Jekyll::Commands::Build.process(options)
|
Jekyll::Commands::Build.process(options)
|
||||||
|
@ -65,7 +64,7 @@ command :serve do |c|
|
||||||
c.syntax = 'jekyll serve [options]'
|
c.syntax = 'jekyll serve [options]'
|
||||||
c.description = 'Serve your site locally'
|
c.description = 'Serve your site locally'
|
||||||
|
|
||||||
c.option '--config [CONFIG_FILE]', Array,'Custom configuration file'
|
c.option '--config CONFIG_FILE[,CONFIG_FILE2,...]', Array, 'Custom configuration file'
|
||||||
c.option '--future', 'Publishes posts with a future date'
|
c.option '--future', 'Publishes posts with a future date'
|
||||||
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
c.option '--limit_posts MAX_POSTS', 'Limits the number of posts to parse and publish'
|
||||||
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
c.option '-w', '--watch', 'Watch for changes and rebuild'
|
||||||
|
|
|
@ -106,7 +106,7 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns this configuration, overridden by the values in the file
|
# Returns this configuration, overridden by the values in the file
|
||||||
def read_config_file(file)
|
def read_config_file(file)
|
||||||
configuration = dup
|
configuration = clone
|
||||||
next_config = YAML.safe_load_file(file)
|
next_config = YAML.safe_load_file(file)
|
||||||
raise "Configuration file: (INVALID) #{file}".yellow if !next_config.is_a?(Hash)
|
raise "Configuration file: (INVALID) #{file}".yellow if !next_config.is_a?(Hash)
|
||||||
Jekyll::Logger.info "Configuration file:", file
|
Jekyll::Logger.info "Configuration file:", file
|
||||||
|
@ -120,7 +120,7 @@ module Jekyll
|
||||||
# Returns the full configuration, with the defaults overridden by the values in the
|
# Returns the full configuration, with the defaults overridden by the values in the
|
||||||
# configuration files
|
# configuration files
|
||||||
def read_config_files(files)
|
def read_config_files(files)
|
||||||
configuration = dup
|
configuration = clone
|
||||||
|
|
||||||
begin
|
begin
|
||||||
files.each do |config_file|
|
files.each do |config_file|
|
||||||
|
@ -143,12 +143,21 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns the backwards-compatible configuration
|
# Returns the backwards-compatible configuration
|
||||||
def backwards_compatibilize
|
def backwards_compatibilize
|
||||||
config = dup
|
config = clone
|
||||||
# Provide backwards-compatibility
|
# Provide backwards-compatibility
|
||||||
if config.has_key? 'auto'
|
if config.has_key?('auto') || config.has_key?('watch')
|
||||||
Jekyll::Logger.warn "Deprecation:", "'auto' has been changed to " +
|
Jekyll::Logger.warn "Deprecation:", "Auto-regeneration can no longer" +
|
||||||
"'watch'. Please update your configuration to use 'watch'."
|
" be set from your configuration file(s). Use the"+
|
||||||
config['watch'] = config['auto']
|
" --watch/-w command-line option instead."
|
||||||
|
config.delete('auto')
|
||||||
|
config.delete('watch')
|
||||||
|
end
|
||||||
|
|
||||||
|
if config.has_key? 'server'
|
||||||
|
Jekyll::Logger.warn "Deprecation:", "The 'server' configuration option" +
|
||||||
|
" is no longer accepted. Use the 'jekyll serve'" +
|
||||||
|
" subcommand to serve your site with WEBrick."
|
||||||
|
config.delete('server')
|
||||||
end
|
end
|
||||||
|
|
||||||
config
|
config
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
auto: false
|
|
||||||
server: true
|
|
||||||
permalink: /docs/:categories/:title
|
permalink: /docs/:categories/:title
|
||||||
pygments: true
|
pygments: true
|
||||||
gauges_id: 503c5af6613f5d0f19000027
|
gauges_id: 503c5af6613f5d0f19000027
|
||||||
|
|
Loading…
Reference in New Issue