Change how config options are passed to Thor. Removes new Thor warnings from #2017
This commit is contained in:
parent
073f273fe4
commit
30217d2c04
|
@ -1,6 +1,10 @@
|
|||
master
|
||||
===
|
||||
|
||||
# 4.1.13
|
||||
|
||||
* Change how config options are passed to Thor. Removes new Thor warnings from #2017
|
||||
|
||||
# 4.1.12
|
||||
|
||||
* Fix broken `ignore { |p| true }` form.
|
||||
|
|
|
@ -25,12 +25,10 @@ module Middleman::Cli
|
|||
if setting.default.is_a?(String) || setting.default.is_a?(NilClass)
|
||||
base.class_option setting.key,
|
||||
type: :string,
|
||||
default: :undefined,
|
||||
desc: setting.description
|
||||
elsif setting.default.is_a?(TrueClass) || setting.default.is_a?(FalseClass)
|
||||
base.class_option setting.key,
|
||||
type: :boolean,
|
||||
default: :undefined,
|
||||
desc: setting.description
|
||||
end
|
||||
end
|
||||
|
|
|
@ -29,7 +29,7 @@ module Middleman::Cli
|
|||
default: false,
|
||||
desc: 'Print debug messages'
|
||||
class_option :instrument,
|
||||
type: :string,
|
||||
type: :boolean,
|
||||
default: false,
|
||||
desc: 'Print instrument messages'
|
||||
class_option :profile,
|
||||
|
@ -64,7 +64,7 @@ module Middleman::Cli
|
|||
config[:mode] = :build
|
||||
config[:show_exceptions] = false
|
||||
config[:cli_options] = cli_options.each_with_object({}) do |(k, v), sum|
|
||||
sum[k] = v unless v == :undefined
|
||||
sum[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ module Middleman::Cli
|
|||
default: false,
|
||||
desc: 'Print debug messages'
|
||||
class_option :instrument,
|
||||
type: :string,
|
||||
type: :boolean,
|
||||
default: false,
|
||||
desc: 'Print instrument messages'
|
||||
class_option :profile,
|
||||
|
|
|
@ -306,6 +306,7 @@ module Middleman
|
|||
execute_callbacks(:after_configuration)
|
||||
|
||||
# Everything is stable
|
||||
$stderr.puts config[:exit_before_ready].inspect
|
||||
execute_callbacks(:ready) unless config[:exit_before_ready]
|
||||
end
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ module Middleman
|
|||
|
||||
app = ::Middleman::Application.new do
|
||||
config[:cli_options] = cli_options.each_with_object({}) do |(k, v), sum|
|
||||
sum[k] = v unless v == :undefined
|
||||
sum[k] = v
|
||||
end
|
||||
|
||||
ready do
|
||||
|
@ -162,7 +162,7 @@ module Middleman
|
|||
|
||||
# Hack around bower_components in root.
|
||||
watcher.listener.ignore(/^bower_components/)
|
||||
|
||||
|
||||
# Hack around node_modules in root.
|
||||
watcher.listener.ignore(/^node_modules/)
|
||||
|
||||
|
@ -207,7 +207,7 @@ module Middleman
|
|||
end
|
||||
|
||||
def possible_from_cli(key, config)
|
||||
if @cli_options[key] && @cli_options[key] != :undefined
|
||||
if @cli_options[key]
|
||||
@cli_options[key]
|
||||
else
|
||||
config[key]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
module Middleman
|
||||
# Current Version
|
||||
# @return [String]
|
||||
VERSION = '4.1.12'.freeze unless const_defined?(:VERSION)
|
||||
VERSION = '4.1.13'.freeze unless const_defined?(:VERSION)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue