Module: Rib::Heroku

Defined in:
lib/rib-heroku.rb,
lib/rib-heroku/version.rb

Constant Summary collapse

VERSION =
'0.8.2'

Class Method Summary collapse

Class Method Details

.load(sock, out, timeout = nil) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/rib-heroku.rb', line 15

def self.load sock, out, timeout=nil
  require 'rib'
  sock.puts(load_script)
  sock.flush
  2.times do # eat load_script outputs
    IO.select([sock], nil, nil, timeout)
    msg = sock.gets
  end
end

.load_scriptObject



25
26
27
28
# File 'lib/rib-heroku.rb', line 25

def self.load_script
  @load_script ||= File.read(Rib.config_path).tr("\n", ';') +
    ";require 'rib/app/auto';Rib::Auto.load;Rib::Skip"
end

.run(argv) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/rib-heroku.rb', line 4

def self.run argv
  require 'heroku/command'
  require 'rib-heroku/monkey_patch'
  split = argv.index('--') || argv.size
  argv.delete('--')
  argv_heroku, argv_rib = argv[0...split], argv[split..-1]
               args_rib = " #{argv_rib.join(' ')}" unless argv_rib.empty?
  Heroku::Command.load
  Heroku::Command.run('run', ["rib#{args_rib}"] + argv_heroku)
end