Class: Ecrire::Commands::Server

Inherits:
Base
  • Object
show all
Defined in:
lib/ecrire/commands/server.rb

Instance Method Summary collapse

Methods inherited from Base

#shift_argv!

Constructor Details

#initialize(options = {}, *args) ⇒ Server

Returns a new instance of Server.



7
8
9
10
11
12
13
14
15
16
# File 'lib/ecrire/commands/server.rb', line 7

def initialize(options = {}, *args)

  require 'ecrire'
  require 'rails/commands/server'

  shift_argv!

  @server = Rails::Server.new
  @server.options[:Port] = options[:Port]
end

Instance Method Details

#run!Object



18
19
20
21
22
23
# File 'lib/ecrire/commands/server.rb', line 18

def run!
  @server.tap do |server|
    Dir.chdir(Ecrire::Application.root)
    server.start
  end
end