Sha256: bc41dd567704f1de39f94fcd72fac4fa37df9a8d60780c3bff173e755e68da3d

Contents?: true

Size: 1.26 KB

Versions: 4

Compression:

Stored size: 1.26 KB

Contents

# -*- coding: UTF-8 -*-

require 'build-tool/commands'

module BuildTool; module Commands; module Modules

    #
    # BuildCommand
    #
    class Enable < ModuleBasedCommand

        name        'enable'
        description 'Enable the given modules.'
        long_description [ 'Sets the modules status.' ]

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

            @default = false
            options.on( "--default", "Set to use default state if possible." ) { |t|
                @default = true
                }

            super

            # We want to allways match all modules here.
            @all = true
        end

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

        def do_execute_module( mod )

            if @default and mod.default_active? == true
                info( '%-35s: using default (enabled).' % mod.name )
                mod.active = nil
            else
                info( '%-35s: enabled explicitely.' % mod.name )
                mod.active = true
            end
        end

    end # class Activate

end; end; end # module BuildTool::Commands::Modules



Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
build-tool-0.6.1 lib/build-tool/commands/modules/enable.rb
build-tool-0.6.0 lib/build-tool/commands/modules/enable.rb
build-tool-0.6.0.rc2 lib/build-tool/commands/modules/enable.rb
build-tool-0.6.0.rc1 lib/build-tool/commands/modules/enable.rb