Greenhouse: Simple Rack application
This commit is contained in:
parent
090a65ed8a
commit
522c23b206
1 changed files with 15 additions and 0 deletions
15
lib/sapling/greenhouse.rb
Normal file
15
lib/sapling/greenhouse.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
require 'erb'
|
||||||
|
|
||||||
|
# The rack application
|
||||||
|
class Greenhouse
|
||||||
|
attr_reader :tree
|
||||||
|
|
||||||
|
def initialize(file)
|
||||||
|
@tree = file
|
||||||
|
@response = ERB.new(File.read('lib/sapling/index.erb')).result(binding)
|
||||||
|
end
|
||||||
|
|
||||||
|
def call(_env)
|
||||||
|
['200', { 'Content-Type' => 'text/html' }, [@response]]
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue