Methods
A
D
E
G
H
I
K
N
R
T
Constants
MAP = { 'railties' => 'railties', 'ap' => 'actionpack', 'am' => 'actionmailer', 'amo' => 'activemodel', 'as' => 'activesupport', 'ar' => 'activerecord', 'av' => 'actionview', 'aj' => 'activejob', 'ac' => 'actioncable', 'guides' => 'guides' }
 
Attributes
[R] component
[R] options
Class Public methods
new(component, options = {})
# File ci/travis.rb, line 32
def initialize(component, options = {})
  @component = component
  @options = options
end
Instance Public methods
activerecord?()
# File ci/travis.rb, line 87
def activerecord?
  gem == 'activerecord'
end
activesupport?()
# File ci/travis.rb, line 83
def activesupport?
  gem == 'activesupport'
end
adapter()
# File ci/travis.rb, line 108
def adapter
  component.split(':').last
end
announce(heading)
# File ci/travis.rb, line 49
def announce(heading)
  puts "\n\e[1;33m[Travis CI] #{heading}\e[m\n"
end
dir()
Alias for: gem
env()
# File ci/travis.rb, line 121
def env
  if activesupport? && !isolated?
    # There is a known issue with the listen tests that causes files to be
    # incorrectly GC'ed even when they are still in-use. The current is to
    # only run them in isolation to avoid randomly failing our test suite.
    { 'LISTEN' => '0' }
  else
    {}
  end
end
gem()
Also aliased as: dir
# File ci/travis.rb, line 103
def gem
  MAP[component.split(':').first]
end
guides?()
# File ci/travis.rb, line 91
def guides?
  gem == 'guides'
end
heading()
# File ci/travis.rb, line 53
def heading
  heading = [gem]
  heading << "with #{adapter}" if activerecord?
  heading << "in isolation" if isolated?
  heading << "integration" if integration?
  heading.join(' ')
end
integration?()
# File ci/travis.rb, line 99
def integration?
  component.split(':').last == 'integration'
end
isolated?()
# File ci/travis.rb, line 95
def isolated?
  options[:isolated]
end
key()
# File ci/travis.rb, line 76
def key
  key = [gem]
  key << adapter if activerecord?
  key << 'isolated' if isolated?
  key.join(':')
end
rake(*tasks)
# File ci/travis.rb, line 112
def rake(*tasks)
  tasks.each do |task|
    cmd = "bundle exec rake #{task}"
    puts "Running command: #{cmd}"
    return false unless system(env, cmd)
  end
  true
end
run!(options = {})
# File ci/travis.rb, line 37
def run!(options = {})
  self.options.update(options)
  Dir.chdir(dir) do
    announce(heading)
    if guides?
      run_bug_report_templates
    else
      rake(*tasks)
    end
  end
end
run_bug_report_templates()
# File ci/travis.rb, line 132
def run_bug_report_templates
  Dir.glob('bug_report_templates/*.rb').all? do |file|
    system(Gem.ruby, '-w', file)
  end
end
tasks()
# File ci/travis.rb, line 61
def tasks
  if activerecord?
    tasks = ["#{adapter}:#{'isolated_' if isolated?}test"]
    case adapter
    when 'mysql2'
      tasks.unshift 'db:mysql:rebuild'
    when 'postgresql'
      tasks.unshift 'db:postgresql:rebuild'
    end
    tasks
  else
    ["test", ('isolated' if isolated?), ('integration' if integration?)].compact.join(":")
  end
end