Greenhouse: Simple Rack application

This commit is contained in:
Bill Niblock 2017-10-30 00:22:00 -04:00
parent 090a65ed8a
commit 522c23b206

15
lib/sapling/greenhouse.rb Normal file
View 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