Class: Eggplant::Server

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/eggplant/server.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build_html(path) ⇒ Object



107
108
109
110
111
112
113
114
115
116
# File 'lib/eggplant/server.rb', line 107

def self.build_html path    
  showtime = Eggplant::Server.new
  while !showtime.is_a?(Eggplant::Server)
    showtime = showtime.instance_variable_get(:@app)
  end
  html = showtime.send('index')
  File.open(path, 'w') do |f|
    f << html
  end
end

.configure(path, ui = ['goto']) ⇒ Object



101
102
103
104
105
# File 'lib/eggplant/server.rb', line 101

def self.configure path, ui=['goto']
  set :environment, :production
  set :presentation_root, path
  set :ui, ui
end

Instance Method Details

#indexObject



97
98
99
# File 'lib/eggplant/server.rb', line 97

def index
  slim :show
end