16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/mergetrain_check.rb', line 16
def self.run!(args)
config = Config.new
parser = ArgsParser.new
args = ArgsParser.new.parse(args)
return if args.nil?
config.merge! args
if config.auth_token.nil?
raise MissingConfigError, "auth_token"
end
if config.project_id.nil?
raise MissingConfigError, "project_id"
end
checker = Checker.new(config.gitlab_host, config.auth_token, config.project_id)
checker.max_completed = config.limit
traintable = checker.check
text_length = config.verbose ? 160: 80
first_name_only = !config.verbose
formatter = TraintableFormatter.new text_length, first_name_only
puts formatter.format traintable
config.save!
end
|