mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
15 lines
378 B
Ruby
15 lines
378 B
Ruby
|
require 'middleman'
|
||
|
|
||
|
module Middleman
|
||
|
class Builder
|
||
|
def self.render_file(source, destination)
|
||
|
# Middleman.set :environment, :build
|
||
|
|
||
|
request_path = destination.gsub(File.join(Dir.pwd, 'build'), "")
|
||
|
browser = Rack::Test::Session.new(Rack::MockSession.new(Middleman))
|
||
|
browser.get(request_path)
|
||
|
browser.last_response.body
|
||
|
end
|
||
|
end
|
||
|
end
|