Set highlighter to pygments when upgrading
In case you are upgrading from 1.4.2 to 2.0 and the pygments option is set to true, then the highlighter option will be set to pygments automatically.
This commit is contained in:
parent
0831d2b0f8
commit
4bf716c2ad
|
@ -212,8 +212,11 @@ module Jekyll
|
|||
if config.has_key? 'pygments'
|
||||
Jekyll.logger.warn "Deprecation:", "The 'pygments' configuration option" +
|
||||
" has been renamed to 'highlighter'. Please update your" +
|
||||
" config file accordingly. The allowed values are 'rouge"+
|
||||
" config file accordingly. The allowed values are 'rouge', " +
|
||||
"'pygments' or null"
|
||||
|
||||
config['highlighter'] = 'pygments' if config['pygments']
|
||||
config.delete('pygments')
|
||||
end
|
||||
|
||||
%w[include exclude].each do |option|
|
||||
|
|
|
@ -51,11 +51,12 @@ class TestConfiguration < Test::Unit::TestCase
|
|||
context "#backwards_compatibilize" do
|
||||
setup do
|
||||
@config = Configuration[{
|
||||
"auto" => true,
|
||||
"watch" => true,
|
||||
"server" => true,
|
||||
"exclude" => "READ-ME.md, Gemfile,CONTRIBUTING.hello.markdown",
|
||||
"include" => "STOP_THE_PRESSES.txt,.heloses, .git"
|
||||
"auto" => true,
|
||||
"watch" => true,
|
||||
"server" => true,
|
||||
"exclude" => "READ-ME.md, Gemfile,CONTRIBUTING.hello.markdown",
|
||||
"include" => "STOP_THE_PRESSES.txt,.heloses, .git",
|
||||
"pygments" => true,
|
||||
}]
|
||||
end
|
||||
should "unset 'auto' and 'watch'" do
|
||||
|
@ -78,6 +79,11 @@ class TestConfiguration < Test::Unit::TestCase
|
|||
assert @config.backwards_compatibilize.has_key?("include")
|
||||
assert_equal @config.backwards_compatibilize["include"], %w[STOP_THE_PRESSES.txt .heloses .git]
|
||||
end
|
||||
should "set highlighter to pygments" do
|
||||
assert @config.has_key?("pygments")
|
||||
assert !@config.backwards_compatibilize.has_key?("pygments")
|
||||
assert_equal @config.backwards_compatibilize["highlighter"], "pygments"
|
||||
end
|
||||
end
|
||||
context "#fix_common_issues" do
|
||||
setup do
|
||||
|
|
Loading…
Reference in New Issue