diff --git a/lib/sapling/greenhouse.rb b/lib/sapling/greenhouse.rb new file mode 100644 index 0000000..cf88e19 --- /dev/null +++ b/lib/sapling/greenhouse.rb @@ -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