Sha256: f29e2fd8df985efa098d8e0314f4085cb0a6254dfd3bc89cb0976c97d2604b9b

Contents?: true

Size: 940 Bytes

Versions: 14

Compression:

Stored size: 940 Bytes

Contents

module Stickler
  class Client
    class Config < Stickler::Client
      def self.banner
<<-_
Access or update the Stickler client configuration.  

Usage: stickler config [options] 

  Options:
_
      end

      def parser
        unless @parser then
          @parser = super
          @parser.opt( :upstream, "The upstream gem server from which to pull", :type => :string, :default => Client.config.upstream )
          @parser.opt( :add, "Add upstream and/or server to the configuration", :type => :boolean )
          @parser.opt( :list, "display the current configuration", :type => :boolean )
        end
        return @parser
      end

      def dump_config( opts )
        puts "  server : #{Client.config.server}"
        puts "upstream : #{Client.config.upstream}"
      end

      def run
        opts = parse( self.argv )
        dump_config( opts ) if Client.config.update( opts ) || opts[:list]
      end
   end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
stickler-2.4.2 lib/stickler/client/config.rb
stickler-2.4.1 lib/stickler/client/config.rb
stickler-2.4.0 lib/stickler/client/config.rb
stickler-2.3.0 lib/stickler/client/config.rb
stickler-2.2.4 lib/stickler/client/config.rb
stickler-2.2.3 lib/stickler/client/config.rb
stickler-2.2.2 lib/stickler/client/config.rb
stickler-2.1.4 lib/stickler/client/config.rb
stickler-2.1.3 lib/stickler/client/config.rb
stickler-2.1.2 lib/stickler/client/config.rb
stickler-2.1.1 lib/stickler/client/config.rb
stickler-2.1.0 lib/stickler/client/config.rb
stickler-2.0.2 lib/stickler/client/config.rb
stickler-2.0.1 lib/stickler/client/config.rb