Sha256: fcfee8fc93f5566bfc1146ef17e66de3e1a9eb96be0e65c0f69f6122fc76139d

Contents?: true

Size: 566 Bytes

Versions: 3

Compression:

Stored size: 566 Bytes

Contents

#!/usr/bin/env ruby

def find_project_root
  current = Dir.pwd
  until (File.exists? 'Capfile')
    Dir.chdir '..'
    return nil if current == Dir.pwd
    current = Dir.pwd
  end
  current
end

begin
  stage = ARGV.shift
  root = find_project_root or raise 'Call me from inside a Rails project!'

  if File.exists? "#{root}/script/console" # => Rails 2
    exec "shell-for #{stage} --no-bash script/console #{stage}"
  else
    exec "shell-for #{stage} --no-bash bundle exec rails console #{stage}"
  end
rescue Exception => e
  $stderr.puts e.message
  exit 1
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geordi-0.4.3 bin/console-for
geordi-0.4.2 bin/console-for
geordi-0.4.1 bin/console-for