Class: Shoes::UI::CLI::DefaultCommand
Instance Attribute Summary
Attributes inherited from BaseCommand
#args
Instance Method Summary
collapse
Methods inherited from BaseCommand
#help_from_options, #initialize, #parse!, #warn_on_unexpected_parameters
Instance Method Details
#help ⇒ Object
40
41
42
|
# File 'shoes-core/lib/shoes/ui/cli/default_command.rb', line 40
def help
help_from_options("shoes [options] file", options)
end
|
#options ⇒ Object
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'shoes-core/lib/shoes/ui/cli/default_command.rb', line 20
def options
OptionParser.new do |opts|
opts.on('-v', '--version', 'Shoes version') do
Shoes::UI::CLI::VersionCommand.new([]).run
exit
end
opts.on('-h', '--help', 'Shoes help') do
Shoes::UI::CLI::HelpCommand.new([]).run
exit
end
opts.on('-f', '--fail-fast', 'Crash on exceptions in Shoes code') do
Shoes.configuration.fail_fast = true
end
end
end
|
#run ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'shoes-core/lib/shoes/ui/cli/default_command.rb', line 7
def run
return unless parse!(args)
warn_on_unexpected_parameters
path = args.first
return unless path
$LOAD_PATH.unshift(File.dirname(path))
Shoes.configuration.app_dir = File.dirname(path)
load path
end
|