Class: BuildTool::Commands::Info

Inherits:
Standard show all
Defined in:
lib/build-tool/commands/info.rb

Overview

BuildCommand

Instance Attribute Summary

Attributes inherited from Base

#cmd, #options, #parent

Instance Method Summary collapse

Methods inherited from Standard

#complete_modules, #initialize, #log_directory, #while_logging_to

Methods inherited from Base

#<=>, #complete, #complete_arguments, #complete_readline_1_8, #complete_readline_1_9, #configuration, #do_complete_1_8, #do_complete_1_9, #each_option, #execute, #fullname, #initialize, #log?, #say, #show_help, #skip_command, #usage

Methods included from HelpText

#cmdalias, #description, included, #long_description, #name

Constructor Details

This class inherits a constructor from BuildTool::Commands::Standard

Instance Method Details

#applicable?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/build-tool/commands/info.rb', line 19

def applicable?
    BuildTool::Application.instance.name != "build-tool"
end

#do_execute(args) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/build-tool/commands/info.rb', line 23

def do_execute( args )
    if args.length != 0
        # *TODO* print better message
        logger.warn "Arguments ignored."
    end

    recipe = configuration.recipe
    say "Recipe"
    say "------"
    say "Name:      #{recipe.name}"
    say "Short:     #{recipe.short_description}"
    say "Long:      #{recipe.long_description}"
    say "Full Path: #{recipe.global_config_file_path('recipe')}"
    say ""
    say "Configuration"
    say "-------------"
    say "Settings:  #{ Application::instance.local_settings_file_path }"
    say "Overrides: #{ recipe.local_config_file_path( 'recipe' ) }"

    return 0
end

#initialize_optionsObject



14
15
16
17
# File 'lib/build-tool/commands/info.rb', line 14

def initialize_options
    @options.banner = "Usage: #{Pathname.new($0).basename} #{self.fullname}"
    super
end