Sha256: 12e769f0b7c3b05cdf965bf4a8bf913a5f6f2c7e2b2bb1c60a6b92b2dc3c30a5

Contents?: true

Size: 853 Bytes

Versions: 15

Compression:

Stored size: 853 Bytes

Contents

module Coherent
  module Commands
    
    class Source
      def initialize(base_command)
        @base_command = base_command
      end
    
      def options
        OptionParser.new do |o|
          o.set_summary_indent('  ')
          o.banner =    "Usage: #{@base_command.script_name} source REPOSITORY [REPOSITORY [REPOSITORY]...]"
          o.define_head "Add new repositories to the default search list."
        end
      end
    
      def parse!(args)
        options.parse!(args)
        count = 0
        args.each do |uri|
          if Repositories.instance.add(uri)
            puts "added: #{uri.ljust(50)}" if $verbose
            count += 1
          else
            puts "failed: #{uri.ljust(50)}"
          end
        end
        Repositories.instance.save
        puts "Added #{count} repositories."
      end
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
coherent-0.6.11 lib/plugin/commands/source.rb
coherent-0.6.10 lib/plugin/commands/source.rb
coherent-0.6.9 lib/plugin/commands/source.rb
coherent-0.6.8 lib/plugin/commands/source.rb
coherent-0.6.7 lib/plugin/commands/source.rb
coherent-0.6.6 lib/plugin/commands/source.rb
coherent-0.6.5 lib/plugin/commands/source.rb
coherent-0.6.4 lib/plugin/commands/source.rb
coherent-0.6.2 lib/plugin/commands/source.rb
coherent-0.6.1 lib/plugin/commands/source.rb
coherent-0.6.0 lib/plugin/commands/source.rb
coherent-0.4.3 lib/plugin/commands/source.rb
coherent-0.4.2 lib/plugin/commands/source.rb
coherent-0.4.1 lib/plugin/commands/source.rb
coherent-0.4.0 lib/plugin/commands/source.rb