Class: BuildTool::Commands::Fetch

Inherits:
ModuleBasedCommand show all
Includes:
MJ::Tools::SubProcess
Defined in:
lib/build-tool/commands/fetch.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, #rebase, #reconfigure, #summarize

Methods inherited from Standard

#complete_modules, #initialize, #log_directory, #while_logging_to

Methods inherited from Base

#<=>, #cleanup_after_vcs_access, #complete, #complete_arguments, #complete_readline_1_8, #complete_readline_1_9, #configuration, #do_complete_1_8, #do_complete_1_9, #do_execute, #each_option, #execute, #fullname, #initialize, #say, #setup_command, #show_help, #skip_command, #summarize, #usage

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)


25
26
27
# File 'lib/build-tool/commands/fetch.rb', line 25

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

#do_execute_module(mod) ⇒ Object



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

def do_execute_module( mod )

    if mod.checkedout?
        fetch( mod )
    else
        clone( mod )
    end

end

#initialize_optionsObject



29
30
31
32
# File 'lib/build-tool/commands/fetch.rb', line 29

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

#is_module_ready?(mod) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
37
38
39
40
41
# File 'lib/build-tool/commands/fetch.rb', line 34

def is_module_ready?( mod )
    isready = true
    isready &= mod.prepare_for_vcs_access
    if !mod.vcs.fetching_supported?
        logger.warn "#{mod.name}: fetching not supported by #{mod.vcs.name} -> implicit rebase."
    end
    return isready
end

#log?Boolean

Log this command if $noop is not active

Returns:

  • (Boolean)


21
22
23
# File 'lib/build-tool/commands/fetch.rb', line 21

def log?
    ! $noop
end

#teardown_commandObject



53
54
55
# File 'lib/build-tool/commands/fetch.rb', line 53

def teardown_command
    cleanup_after_vcs_access
end