Class: BuildTool::Commands::Fetch
- Inherits:
-
ModuleBasedCommand
- Object
- Base
- Standard
- ModuleBasedCommand
- BuildTool::Commands::Fetch
- Includes:
- MJ::Tools::SubProcess
- Defined in:
- lib/build-tool/commands/fetch.rb
Overview
BuildCommand
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #applicable? ⇒ Boolean
- #do_execute_module(mod) ⇒ Object
- #initialize_options ⇒ Object
- #is_module_ready?(mod) ⇒ Boolean
-
#log? ⇒ Boolean
Log this command if $noop is not active.
- #prepare_module(mod) ⇒ Object
- #teardown_command ⇒ Object
Methods inherited from ModuleBasedCommand
#clean, #clone, #configure, #do_execute, #fetch, #initialize, #install, #make, #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, #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
29 30 31 |
# File 'lib/build-tool/commands/fetch.rb', line 29 def applicable? BuildTool::Application.instance.has_recipe? end |
#do_execute_module(mod) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/build-tool/commands/fetch.rb', line 49 def do_execute_module( mod ) if mod.checkedout? fetch( mod ) else clone( mod ) end end |
#initialize_options ⇒ Object
33 34 35 36 37 38 |
# File 'lib/build-tool/commands/fetch.rb', line 33 def . = "Usage: #{self.fullname} [OPTIONS]... MODULES..." .separator( "" ) .separator( "Options" ) super end |
#is_module_ready?(mod) ⇒ Boolean
40 41 42 43 44 45 46 47 |
# File 'lib/build-tool/commands/fetch.rb', line 40 def is_module_ready?( mod ) isready = true isready &= mod.ready_for_fetch if isready && !mod.vcs_required.fetching_supported? 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
25 26 27 |
# File 'lib/build-tool/commands/fetch.rb', line 25 def log? ! $noop end |
#prepare_module(mod) ⇒ Object
63 64 65 66 67 |
# File 'lib/build-tool/commands/fetch.rb', line 63 def prepare_module( mod ) isready = true isready &= mod.prepare_for_fetch return isready end |
#teardown_command ⇒ Object
59 60 61 |
# File 'lib/build-tool/commands/fetch.rb', line 59 def teardown_command cleanup_after_vcs_access end |