class Ecrire::Commands::Server

Public Class Methods

new(options = {}, *args) click to toggle source
# 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]
  @server.options[:Host] = options[:Host]
end

Public Instance Methods

create_tmp_directories() click to toggle source
# File lib/ecrire/commands/server.rb, line 30
def create_tmp_directories
  %w(cache pids sockets).each do |dir_to_make|
    FileUtils.mkdir_p(File.join(Ecrire::Theme.path, "tmp", dir_to_make))
  end
end
run!() click to toggle source
# File lib/ecrire/commands/server.rb, line 19
def run!
  @server.tap do |server|
    Ecrire::Theme.path = Pathname.new(Dir.pwd)
    create_tmp_directories

    Dir.chdir(Ecrire::Application.root) do
      server.start
    end
  end
end