lib/face_control/cli.rb in face_control-0.9.0 vs lib/face_control/cli.rb in face_control-0.9.1
- old
+ new
@@ -7,11 +7,11 @@
USAGE = File.read("#{File.dirname(__FILE__)}/../../USAGE")
def run
logger = Logger.new(STDOUT)
project, repository, pull_request_id, ignored_severities = arguments
- pull_request = pull_request(project, repository, pull_request_id, logger)
+ pull_request = Stash::Config.new.server(logger).repository(project, repository).pull_request(pull_request_id)
logger.info('Running checkers...')
comments = check(pull_request, ignored_severities, logger)
return if comments.empty?
@@ -57,17 +57,8 @@
[project, repository, pull_request_id, ignored_severities]
rescue Docopt::Exit => e
puts e.message
exit(1)
- end
-
- def pull_request(project, repository, pull_request_id, logger)
- @pull_request ||= begin
- config = Stash::Config.new
- server = Stash::Server.new(config.host, config.user, config.password, logger)
- repository = server.repository(project, repository)
- repository.pull_request(pull_request_id)
- end
end
end
end