25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/chsource/cli.rb', line 25
def self.start(args)
check_input
opts = OptionParser.new do |opts|
opts.banner = "Usage: chsource SOURCE"
opts.separator " "
opts.separator "Examples:"
opts.separator " $ chsource taobao => source 'http://ruby.taobao.org'"
opts.separator " $ chsource gzruby => source 'http://gems.gzruby.org"
opts.separator " $ chsource tsinghua => source 'http://mirrors.tuna.tsinghua.edu.cn/rubygems'"
opts.separator " $ chsource rubygems => source 'http://rubygems.org'"
opts.separator " "
opts.separator "Options:"
opts.on("-v", "--version", "Print the version") do |v|
puts "Chsource v#{VERSION}"
exit
end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
opts.parse!(args)
end
exit if no_gem_file
Chsource.change_source ARGV[0]
end
|