Sha256: 5f6d575d62653a98dbf366bbe7882764e5146803c02deaf11ed9d69f1816f903

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

module Everqueen
  class Cli
    def self.execute(argv)
      new.execute(argv)
    end

    def execute(argv)
      command = argv.shift
      Everqueen.root = File.expand_path(argv.shift || '.', Dir.pwd)

      # detect Rails apps
      if File.exist?(File.join(Everqueen.root, 'config/environment.rb'))
        require File.join(Everqueen.root, 'config/environment.rb')
        require 'everqueen/rails' if defined?(Rails)
      end

      case command
      when "serve"
        Everqueen::Server.new.serve
        return true
      when "run"
        return Everqueen::Runner.new.run
      else
        puts "no such command '#{command}'"
        return false
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
everqueen-1.1.1 lib/everqueen/cli.rb
everqueen-1.1.0 lib/everqueen/cli.rb
everqueen-1.0.1 lib/everqueen/cli.rb