module Rake::Funnel::Integration::TeamCity

Constants

JRE_ENV_VAR
PROJECT_ENV_VAR

Public Class Methods

rake_runner?() click to toggle source
# File lib/rake/funnel/integration/teamcity/teamcity.rb, line 15
def rake_runner?
  running? && Object.const_defined?('Rake') && Rake.const_defined?('TeamCityApplication')
end
running?() click to toggle source
# File lib/rake/funnel/integration/teamcity/teamcity.rb, line 11
def running?
  ENV.include?(PROJECT_ENV_VAR)
end
with_java_runtime() { || ... } click to toggle source
# File lib/rake/funnel/integration/teamcity/teamcity.rb, line 19
def with_java_runtime
  return unless block_given?

  begin
    original_path = ENV['PATH']

    ENV['PATH'] = ([] << ENV['PATH'] << teamcity_jre).compact.join(File::PATH_SEPARATOR)

    yield
  ensure
    ENV['PATH'] = original_path
  end
end

Private Class Methods

teamcity_jre() click to toggle source
# File lib/rake/funnel/integration/teamcity/teamcity.rb, line 35
def teamcity_jre
  return nil unless ENV.include?(JRE_ENV_VAR)

  File.join(ENV[JRE_ENV_VAR], 'bin')
end