Class: BuildTool::Commands::Ctags

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

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


28
29
30
# File 'lib/build-tool/commands/ctags.rb', line 28

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

#ctags(source, tagsfile) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/build-tool/commands/ctags.rb', line 46

def ctags( source, tagsfile )
    rc = self.class.execute "ctags -R -f #{tagsfile} #{source}"
    if rc != 0
        raise CtagsError, "ctags failed with error #{rc}!"
    end
    rc
end

#do_execute_module(mod) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/build-tool/commands/ctags.rb', line 32

def do_execute_module( mod )
    if mod.checkedout?
        FileUtils.mkdir_p mod.build_prefix_required.join("tags").to_s
        ctags(mod.source_directory,
              mod.build_prefix_required.join(
                  "tags",
                  mod.name.gsub( '/', '-' ) + ".tags" ))

    else
        warn( "Module is not checked out! Use -u to check it out." )
        warn( "skipped!" )
    end
end

#initialize_optionsObject



21
22
23
24
25
26
# File 'lib/build-tool/commands/ctags.rb', line 21

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