Sha256: cfa0554bd2955f42673a15f1bfe440dcf6b7ee38ae186c18d6826a49ee59bc40

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

require 'kde-build/command'

module BuildTool

    class ModuleBasedCommand < Command

        def execute( args )

            # If no argument is given show the help and quit.
            if args.length == 0
                show_help
                return
            end

            # Map the command line to real modules
            real_modules = []
            ModuleRegistry.get_modules( args ) do |mod|
                # Check if the module is fit for the command
                if is_module_ready( mod )
                    real_modules.push( mod )
                end
            end

            # Execute the command for each module
            real_modules.each do |mod|
                begin

                    execute_for_module( mod )

                rescue Interrupt => e
                    $log.info("SIGBREAK recieved.")
                    return

                rescue Exception => e
                    $log.info("error: #{e.class}: #{e.message}")
                    puts e.backtrace if $verbose
                end

            end
        end

    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
build-tool-0.0.3 lib/kde-build/command/module_based.rb