Sha256: fd193428ab2943bd48d8b0c2e076e65cdec7974011ba00f76b4cc335e85e4fbd

Contents?: true

Size: 1.29 KB

Versions: 7

Compression:

Stored size: 1.29 KB

Contents

require 'build-tool/commands'
require 'build-tool/recipe'

require 'ftools'

module BuildTool; module Commands; module Recipes

    #
    # BuildCommand
    #
    class Info < Standard

        name        "info"
        description "show information about a module."
        long_description [ "Show detailed information about RECIPE." ]

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

        def do_execute( args )
            if ( args.length != 1 )
                return usage( args.length == 0 ?  "Not enough arguments" : "To many arguments" )
            end

            rec = Recipe.new( args[0] )
            say "Description: #{rec.short_description}"
            say "Website: #{rec.website}" if rec.website
            say "Repository: #{rec.repository}" if rec.repository
            say "Browse Repository: #{rec.browse_repository}" if rec.browse_repository
            if rec.long_description
                say "Long Description:"
                for line in rec.long_description
                    say "  #{line.chomp}"
                end
                say ""
            end

            return 0
        end

    end # class

end; end # module Commands::Recipes

end; # module BuildTool



Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
build-tool-0.4.2 lib/build-tool/commands/recipes/info.rb
build-tool-0.4.1 lib/build-tool/commands/recipes/info.rb
build-tool-0.4.0 lib/build-tool/commands/recipes/info.rb
build-tool-0.3.3 lib/build-tool/commands/recipes/info.rb
build-tool-0.3.2 lib/build-tool/commands/recipes/info.rb
build-tool-0.3.1 lib/build-tool/commands/recipes/info.rb
build-tool-0.3 lib/build-tool/commands/recipes/info.rb