Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix tools.rb for Thor 0.14.0

  • Loading branch information...
commit f468d87304b28c62457e06174f35460c11313b20 1 parent 0f37e43
@wycats wycats authored
Showing with 17 additions and 20 deletions.
  1. +17 −20 lib/sproutcore/tools.rb
View
37 lib/sproutcore/tools.rb
@@ -24,24 +24,31 @@ module SC
# tool itself when it runs.
#
class Tools < ::Thor
+ check_unknown_options!
def self.invoke(task_name)
start([task_name.to_s] + ARGV)
end
-
# All sproutcore tools can take some standard options. These are
# processed automatically when the tool is loaded
- method_options({ '--project' => :string,
- '--library' => :string, # deprecated
- '--mode' => :string,
- '--environment' => :string, # deprecated
- '--logfile' => :string,
- '--build' => :string,
- ['--verbose', '-v'] => false,
- ['--very-verbose', '-V'] => false })
- def initialize(options, *args)
+ class_option "project", :type => :string
+ class_option "mode", :type => :string
+ class_option "logfile", :type => :string
+ class_option "build", :type => :string
+ class_option "verbose", :type => :boolean, :aliases => "-v"
+ class_option "very-verbose", :type => :boolean, :aliases => "-V"
+ class_option "library", :type => :string #deprecated
+ class_option "environment", :type => :string #deprecated
+
+ # This is the core entry method used to run every tool. Extend this
+ # method with any standard preprocessing you want all tools to do before
+ # they do their specific thing.
+ def initialize(*)
super
+ prepare_logger!
+ prepare_mode!
+ prepare_build_numbers!
end
no_tasks do
@@ -84,16 +91,6 @@ def warn(description)
## GLOBAL OPTIONS
##
- # This is the core entry method used to run every tool. Extend this
- # method with any standard preprocessing you want all tools to do before
- # they do their specific thing.
- def invoke(*args)
- prepare_logger!
- prepare_mode!
- prepare_build_numbers!
- super
- end
-
# Make the options hash a HashStruct so that we can access each variable
# as a method
def options; @tool_options ||= HashStruct.new(super); end
Please sign in to comment.
Something went wrong with that request. Please try again.