Methods
A
D
G
H
I
K
N
R
T
Constants
MAP = { 'railties' => 'railties', 'ap' => 'actionpack', 'am' => 'actionmailer', 'amo' => 'activemodel', 'ares' => 'activeresource', 'as' => 'activesupport', 'ar' => 'activerecord' }
 
Attributes
[R] component
[R] options
Class Public methods
new(component, options = {})
# File ci/travis.rb, line 29
def initialize(component, options = {})
  @component = component
  @options = options
end
Instance Public methods
activerecord?()
# File ci/travis.rb, line 70
def activerecord?
  gem == 'activerecord'
end
adapter()
# File ci/travis.rb, line 87
def adapter
  component.split(':').last
end
announce(heading)
# File ci/travis.rb, line 43
def announce(heading)
  puts "\n\e[1;33m[Travis CI] #{heading}\e[m\n"
end
dir()
Alias for: gem
gem()
Also aliased as: dir
# File ci/travis.rb, line 82
def gem
  MAP[component.split(':').first]
end
heading()
# File ci/travis.rb, line 47
def heading
  heading = [gem]
  heading << "with #{adapter} IM #{identity_map? ? 'enabled' : 'disabled'}" if activerecord?
  heading << "in isolation" if isolated?
  heading.join(' ')
end
identity_map?()
# File ci/travis.rb, line 74
def identity_map?
  options[:identity_map]
end
isolated?()
# File ci/travis.rb, line 78
def isolated?
  options[:isolated]
end
key()
# File ci/travis.rb, line 62
def key
  key = [gem]
  key << adapter if activerecord?
  key << 'IM' if identity_map?
  key << 'isolated' if isolated?
  key.join(':')
end
rake(*tasks)
# File ci/travis.rb, line 91
def rake(*tasks)
  tasks.each do |task|
    cmd = "bundle exec rake #{task}"
    puts "Running command: #{cmd}"
    return false unless system(cmd)
  end
  true
end
run!(options = {})
# File ci/travis.rb, line 34
def run!(options = {})
  self.options.update(options)
  Dir.chdir(dir) do
    announce(heading)
    ENV['IM'] = identity_map?.inspect
    rake(*tasks)
  end
end
tasks()
# File ci/travis.rb, line 54
def tasks
  if activerecord?
    ['mysql:rebuild_databases', "#{adapter}:#{'isolated_' if isolated?}test"]
  else
    ["test#{':isolated' if isolated?}"]
  end
end