Class: Stickler::Client::Config
Instance Attribute Summary
#argv, #sources
Class Method Summary
collapse
Instance Method Summary
collapse
config, #initialize, #parse, #remote_repo_for
Class Method Details
.banner ⇒ Object
4
5
6
7
8
9
10
11
12
|
# File 'lib/stickler/client/config.rb', line 4
def self.banner
<<-_
Access or update the Stickler client configuration.
Usage: stickler config [options]
Options:
_
end
|
Instance Method Details
#dump_config(opts) ⇒ Object
24
25
26
27
|
# File 'lib/stickler/client/config.rb', line 24
def dump_config( opts )
puts " server : #{Client.config.server}"
puts "upstream : #{Client.config.upstream}"
end
|
#parser ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'lib/stickler/client/config.rb', line 14
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
|
#run ⇒ Object
29
30
31
32
|
# File 'lib/stickler/client/config.rb', line 29
def run
opts = parse( self.argv )
dump_config( opts ) if Client.config.update( opts ) || opts[:list]
end
|