Skip to content

Commit

Permalink
Move nonprivate class methods out of private block
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Feb 16, 2016
1 parent e61b99c commit c831428
Showing 1 changed file with 64 additions and 64 deletions.
128 changes: 64 additions & 64 deletions build-ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,70 +48,6 @@ def pass?
end
end

private

# Check if current bundle is already usable
#
# @return [Boolean]
def bundle_check
system(%W[bundle check --path=#{VENDOR_BUNDLE}])
end

# Install the current bundle
#
# @return [Boolean]
# the success of the installation
def bundle_install
system(%W[
bundle
install
--path=#{VENDOR_BUNDLE}
--jobs=#{BUNDLER_JOBS}
--retry=#{BUNDLER_RETRIES}
])
end

# Setup the test app
#
# @return [undefined]
def setup_test_app
system(%w[bundle exec rake test_app]) || fail('Failed to setup the test app')
end

# Run tests for subproject
#
# @return [Boolean]
# the success of the tests
def run_tests
system(%w[bundle exec rspec] + rspec_arguments)
end

def rspec_arguments
args = []
args += %w[--format documentation --profile 10]
if report_dir = ENV['CIRCLE_TEST_REPORTS']
args += %W[-r rspec_junit_formatter --format RspecJunitFormatter -o #{report_dir}/rspec/#{name}.xml]
end
args
end

# Execute system command via execve
#
# No shell interpolation gets done this way. No escapes needed.
#
# @return [Boolean]
# the success of the system command
def system(arguments)
Kernel.system(*arguments)
end

# Change to subproject directory and execute block
#
# @return [undefined]
def chdir(&block)
Dir.chdir(ROOT.join(name), &block)
end

# Install subprojects
#
# @return [self]
Expand Down Expand Up @@ -189,6 +125,70 @@ def self.run_cli(arguments)
fail "Unknown mode: #{mode.inspect}"
end
end

private

# Check if current bundle is already usable
#
# @return [Boolean]
def bundle_check
system(%W[bundle check --path=#{VENDOR_BUNDLE}])
end

# Install the current bundle
#
# @return [Boolean]
# the success of the installation
def bundle_install
system(%W[
bundle
install
--path=#{VENDOR_BUNDLE}
--jobs=#{BUNDLER_JOBS}
--retry=#{BUNDLER_RETRIES}
])
end

# Setup the test app
#
# @return [undefined]
def setup_test_app
system(%w[bundle exec rake test_app]) || fail('Failed to setup the test app')
end

# Run tests for subproject
#
# @return [Boolean]
# the success of the tests
def run_tests
system(%w[bundle exec rspec] + rspec_arguments)
end

def rspec_arguments
args = []
args += %w[--format documentation --profile 10]
if report_dir = ENV['CIRCLE_TEST_REPORTS']
args += %W[-r rspec_junit_formatter --format RspecJunitFormatter -o #{report_dir}/rspec/#{name}.xml]
end
args
end

# Execute system command via execve
#
# No shell interpolation gets done this way. No escapes needed.
#
# @return [Boolean]
# the success of the system command
def system(arguments)
Kernel.system(*arguments)
end

# Change to subproject directory and execute block
#
# @return [undefined]
def chdir(&block)
Dir.chdir(ROOT.join(name), &block)
end
end # Project

exit Project.run_cli(ARGV)

0 comments on commit c831428

Please sign in to comment.