Sha256: 3e3decbf37a56162fe4b605d6228f7de84fc247470fb1c4cf1a8e819bd470a9c

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

Execute.define_task do
desc "console [environment]", "Run rhoconnect console"
  def console(environment=nil)
    ENV['RACK_ENV'] = environment || 'development'
    application_file = (File.exist?(File.join(Dir.pwd, 'application.rb'))) ?
      File.join(Dir.pwd, 'application.rb') :
      File.join(File.dirname(__FILE__), '..', '..', 'generators', 'templates', 'application', 'application.rb')

    redis_url = config[:redis]
    if RedisRunner.running?
      system "irb -rubygems -r #{File.join(File.dirname(__FILE__),'console_helper')} " +
        "-r #{File.join(File.dirname(__FILE__), '..', '..', 'lib', 'rhoconnect') } " +
        "-r #{application_file}"
    else
      puts "Redis is not running on #{redis_url}. Please start it by running 'rhoconnect redis-start' command."
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rhoconnect-4.0.0.beta.10 commands/rhoconnect_console/console.rb
rhoconnect-4.0.0.beta.12 commands/rhoconnect_console/console.rb