Class: Sharpie::Builder
- Inherits:
-
Object
- Object
- Sharpie::Builder
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/sharpie.rb
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(sinatra_application) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(sinatra_application) ⇒ Builder
Returns a new instance of Builder.
24 25 26 |
# File 'lib/sharpie.rb', line 24 def initialize(sinatra_application) @app = sinatra_application end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
19 20 21 |
# File 'lib/sharpie.rb', line 19 def app @app end |
Instance Method Details
#build!(dir) ⇒ Object
28 29 30 31 32 |
# File 'lib/sharpie.rb', line 28 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 |