Class: Rack::OpalCompiler
- Inherits:
-
Object
- Object
- Rack::OpalCompiler
- Defined in:
- lib/rack/opal/compiler.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ OpalCompiler
constructor
A new instance of OpalCompiler.
Constructor Details
#initialize(app, options = {}) ⇒ OpalCompiler
Returns a new instance of OpalCompiler.
10 11 12 13 14 15 16 |
# File 'lib/rack/opal/compiler.rb', line 10 def initialize(app, = {}) @app = app @source_dir = [:source_dir] @build_dir = [:build_dir] @files = Dir["#{@source_dir}/**/*.rb"] @app_name = [:app_name] end |
Instance Method Details
#call(env) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/rack/opal/compiler.rb', line 18 def call(env) status, headers, response = @app.call(env) if !headers['Content-Type'].nil? && headers['Content-Type'].match('text/html') then build end [status, headers, response] end |