Sha256: d4cbe47d6e44e09130361b4b9e0999b65ab356bd2eea5af9929b515e09c08ecb

Contents?: true

Size: 1.11 KB

Versions: 19

Compression:

Stored size: 1.11 KB

Contents

require 'build-tool/commands'
require 'build-tool/recipe'
require 'mj/vcs/git'

module BuildTool; module Commands; module Recipes

    #
    # BuildCommand
    #
    class Add < Standard

        name        "add"
        description "Add a recipe to build-tool."
        long_description "Add a new recipe to build-tool from URL with NAME."

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

        def do_execute( args )
            if ( args.length < 2 )
                return usage( "Not enough arguments" )
            elsif (args.length > 2 )
                return usage( "To many arguments" )
            end

            path = BuildTool::Application::instance.local_configuration_dir.join( "recipes" )
            if ! path.exist? && ! $noop
                FileUtils.mkdir_p( path )
            end

            repo = MJ::VCS::Git::Repository.new(path.join(args[1]), $noop)
            repo.clone(args[0])
            return 0
        end

    end # class

end; end # module Commands::Recipes

end; # module BuildTool



Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
build-tool-0.5.7 lib/build-tool/commands/recipes/add.rb
build-tool-0.5.6 lib/build-tool/commands/recipes/add.rb
build-tool-0.5.5 lib/build-tool/commands/recipes/add.rb
build-tool-0.5.4 lib/build-tool/commands/recipes/add.rb
build-tool-0.5.3 lib/build-tool/commands/recipes/add.rb
build-tool-0.5.2 lib/build-tool/commands/recipes/add.rb
build-tool-0.4.6 lib/build-tool/commands/recipes/add.rb
build-tool-0.5.1 lib/build-tool/commands/recipes/add.rb
build-tool-0.4.5 lib/build-tool/commands/recipes/add.rb
build-tool-0.5.0 lib/build-tool/commands/recipes/add.rb
build-tool-0.4.4 lib/build-tool/commands/recipes/add.rb
build-tool-0.4.3 lib/build-tool/commands/recipes/add.rb
build-tool-0.4.2 lib/build-tool/commands/recipes/add.rb
build-tool-0.4.1 lib/build-tool/commands/recipes/add.rb
build-tool-0.4.0 lib/build-tool/commands/recipes/add.rb
build-tool-0.3.3 lib/build-tool/commands/recipes/add.rb
build-tool-0.3.2 lib/build-tool/commands/recipes/add.rb
build-tool-0.3.1 lib/build-tool/commands/recipes/add.rb
build-tool-0.3 lib/build-tool/commands/recipes/add.rb