Class: Virtuatable::Application
- Inherits:
-
Object
- Object
- Virtuatable::Application
- Includes:
- Singleton
- Defined in:
- lib/virtuatable/application.rb
Overview
Wrapping class to easily create builders.
Instance Attribute Summary collapse
-
#builder ⇒ Virtuatable::Builders::Base
The base builder for the application.
Class Method Summary collapse
-
.builder ⇒ Virtuatable::Builders::Base
Wrapper to simplify the call to instance.:builder.
-
.load!(name, locations: caller_locations, path: '.') ⇒ Object
Loads the application in normal mode, call this from a config.ru file to load the environment, configuration, and require the necessary files.
-
.load_tests!(name, locations: caller_locations, path: '..') ⇒ Object
Loads the application from a spec/spec_helper to load the specs.
Instance Attribute Details
#builder ⇒ Virtuatable::Builders::Base
Returns the base builder for the application.
11 12 13 |
# File 'lib/virtuatable/application.rb', line 11 def builder @builder end |
Class Method Details
.builder ⇒ Virtuatable::Builders::Base
Wrapper to simplify the call to instance.:builder
42 43 44 |
# File 'lib/virtuatable/application.rb', line 42 def self.builder instance.builder end |
.load!(name, locations: caller_locations, path: '.') ⇒ Object
Loads the application in normal mode, call this from a config.ru file to load the environment, configuration, and require the necessary files.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/virtuatable/application.rb', line 16 def self.load!(name, locations: caller_locations, path: '.') builder = Virtuatable::Builders::Base.new( locations: locations, path: path, name: name ) instance.builder = builder builder.load! builder end |
.load_tests!(name, locations: caller_locations, path: '..') ⇒ Object
Loads the application from a spec/spec_helper to load the specs.
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/virtuatable/application.rb', line 29 def self.load_tests!(name, locations: caller_locations, path: '..') builder = Virtuatable::Builders::Tests.new( locations: locations, path: path, name: name ) instance.builder = builder builder.load! builder end |