Class: Shoes::UI::CLI::PackageCommand

Inherits:
BaseCommand show all
Defined in:
shoes-core/lib/shoes/ui/cli/package_command.rb

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

Constructor Details

This class inherits a constructor from Shoes::UI::CLI::BaseCommand

Instance Method Details

#helpObject



23
24
25
26
27
28
29
30
# File 'shoes-core/lib/shoes/ui/cli/package_command.rb', line 23

def help
  help_from_options("shoes package [options] file",
                    Shoes::Packager.new.options) + <<-EOS

    Packages may be built either from a single .rb file, or a .yaml file with
    more options defined.
EOS
end

#runObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'shoes-core/lib/shoes/ui/cli/package_command.rb', line 7

def run
  @packager = Shoes::Packager.new
  @packager.parse!(args)

  warn_on_unexpected_parameters(2)

  path = args[1]
  @packager.run(path)
rescue OptionParser::InvalidOption => e
  puts "Whoops! #{e.message}"
  puts
  puts help

  false
end