Class: BuildTool::Commands::Modules::Cleanup

Inherits:
BuildTool::Commands::ModuleBasedCommand show all
Defined in:
lib/build-tool/commands/modules/cleanup.rb

Overview

BuildCommand

Instance Attribute Summary

Attributes inherited from Base

#cmd, #options, #parent

Instance Method Summary collapse

Methods inherited from BuildTool::Commands::ModuleBasedCommand

#clean, #clone, #configure, #do_execute, #fetch, #initialize, #install, #is_module_ready?, #make, #prepare_module, #rebase, #reconfigure, #remove_build_directory, #remove_source_directory, #summarize

Methods inherited from Standard

#complete_module, #complete_modules, #initialize, #log_directory, #while_logging_to

Methods inherited from Base

#<=>, #applicable?, #cleanup_after_vcs_access, #complete_arguments, #complete_readline, #configuration, #debug, #debug2, #do_complete, #do_execute, #each_option, #error, #execute, #fullname, #info, #initialize, #log?, #quiet, #setup_command, #setup_options, #show_help, #skip_command, #summarize, #teardown_command, #trace, #usage, #verbose, #warn

Methods included from HelpText

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

Constructor Details

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

Instance Method Details

#do_execute_module(mod) ⇒ Object



42
43
44
45
# File 'lib/build-tool/commands/modules/cleanup.rb', line 42

def do_execute_module( mod )
    remove_source_directory( mod, true ) if @remove_source_directory
    remove_build_directory( mod, true )  if @remove_build_directory
end

#initialize_optionsObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/build-tool/commands/modules/cleanup.rb', line 18

def initialize_options
    @all = true
    options.banner = "Usage: #{self.fullname} [OPTIONS]... [MODULE|GROUP]..."
    options.separator( "" )
    options.separator( "Options" )

    @remove_build_directory = false
    options.on( "--rm-bld", "Remove the build directory." ) {
        @remove_build_directory = true
        }

    @remove_source_directory = false
    options.on( "--rm-src", "Remove the source directory." ) {
        @remove_source_directory = true
        }

    options.on( "--rm-both", "Remove the source and build directory." ) {
        @remove_source_directory = true
        @remove_build_directory = true
        }
    super
end