Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed rubocop issues in build-ci
  • Loading branch information
damianlegawiec committed Nov 16, 2018
1 parent 900ebd8 commit 40955dd
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions build-ci.rb
Expand Up @@ -43,6 +43,28 @@ def pass?
end
end

# Process CLI arguments
#
# @param [Array<String>] arguments
#
# @return [Boolean]
# the success of the CLI run
def self.run_cli(arguments)
raise ArgumentError if arguments.length > 1

mode = arguments.fetch(0, DEFAULT_MODE)

case mode
when 'install'
install
true
when 'test'
test
else
raise "Unknown mode: #{mode.inspect}"
end
end

private

# Check if current bundle is already usable
Expand Down Expand Up @@ -154,30 +176,9 @@ def self.current_projects
#
# @return [undefined]
def self.log(message)
$stderr.puts(message)
warn(message)
end
private_class_method :log

# Process CLI arguments
#
# @param [Array<String>] arguments
#
# @return [Boolean]
# the success of the CLI run
def self.run_cli(arguments)
raise ArgumentError if arguments.length > 1
mode = arguments.fetch(0, DEFAULT_MODE)

case mode
when 'install'
install
true
when 'test'
test
else
raise "Unknown mode: #{mode.inspect}"
end
end
end # Project
end

exit Project.run_cli(ARGV)

0 comments on commit 40955dd

Please sign in to comment.