Class: BuildTool::Commands::Rebase

Inherits:
ModuleBasedCommand show all
Includes:
MJ::Tools::SubProcess
Defined in:
lib/build-tool/commands/rebase.rb

Overview

BuildCommand

Instance Attribute Summary

Attributes inherited from Base

#cmd, #options, #parent

Instance Method Summary collapse

Methods inherited from ModuleBasedCommand

#clean, #clone, #configure, #do_execute, #fetch, #initialize, #install, #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

#<=>, #cleanup_after_vcs_access, #complete_arguments, #complete_readline, #configuration, #debug, #debug2, #do_complete, #do_execute, #each_option, #error, #execute, #fullname, #info, #initialize, #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

#applicable?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/build-tool/commands/rebase.rb', line 26

def applicable?
    BuildTool::Application.instance.has_recipe?
end

#do_execute_module(mod) ⇒ Object



57
58
59
60
61
# File 'lib/build-tool/commands/rebase.rb', line 57

def do_execute_module( mod )
    if mod.checkedout? and mod.vcs.fetching_supported?
        rebase( mod, @verbose_rebase )
    end
end

#initialize_optionsObject



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/build-tool/commands/rebase.rb', line 30

def initialize_options
    options.banner = "Usage: #{self.fullname} [OPTIONS]... MODULES..."
    options.separator( "" )
    options.separator( "Options" )

    @verbose_rebase = true
    options.on( nil, "--[no]-verbose-rebase", "Show the changes applied by rebase." ) { |t|
        @verbose_rebase = false
        }

    super
end

#is_module_ready?(mod) ⇒ Boolean

Returns:

  • (Boolean)


43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/build-tool/commands/rebase.rb', line 43

def is_module_ready?( mod )
    isready = true
    if !mod.checkedout?
        info( "#{mod.name}: Skipping: Not checked out." )
    else
        isready &= mod.ready_for_rebase
        if !mod.vcs.fetching_supported?
            info( "#{mod.name}: Skipping: Rebasing not support by #{mod.vcs.name}" )
        end
    end
    return isready
end

#log?Boolean

Log this command if $noop is not active

Returns:

  • (Boolean)


22
23
24
# File 'lib/build-tool/commands/rebase.rb', line 22

def log?
    ! $noop
end