Change how config options are passed to Thor. Removes new Thor warnings from #2017

master v4.1.13
Thomas Reynolds 2016-11-29 20:14:19 -08:00
parent 073f273fe4
commit 30217d2c04
7 changed files with 12 additions and 9 deletions

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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]

View File

@ -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