Class: SinatraStatic
- Inherits:
-
Object
- Object
- SinatraStatic
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/sinatra_static.rb
Defined Under Namespace
Classes: ColorString
Constant Summary collapse
- @@file_extensions =
%w(css js xml json html csv)
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
Instance Method Summary collapse
- #build!(dir) ⇒ Object
-
#initialize(app) ⇒ SinatraStatic
constructor
A new instance of SinatraStatic.
Constructor Details
#initialize(app) ⇒ SinatraStatic
Returns a new instance of SinatraStatic.
14 15 16 |
# File 'lib/sinatra_static.rb', line 14 def initialize(app) @app = app end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
5 6 7 |
# File 'lib/sinatra_static.rb', line 5 def app @app end |
Instance Method Details
#build!(dir) ⇒ Object
18 19 20 21 22 |
# File 'lib/sinatra_static.rb', line 18 def build!(dir) handle_error_no_each_route! unless @app.respond_to?(:each_route) handle_error_dir_not_found!(dir) unless dir_exists?(dir) build_routes(dir) end |