Module: Aladdin
- Extended by:
- Aladdin
- Included in:
- Aladdin
- Defined in:
- lib/aladdin.rb,
lib/aladdin/app.rb,
lib/aladdin/config.rb,
lib/aladdin/support.rb,
lib/aladdin/version.rb,
lib/aladdin/commands.rb,
lib/aladdin/constants.rb,
lib/aladdin/submission.rb,
lib/aladdin/commands/new.rb,
lib/aladdin/commands/server.rb,
lib/aladdin/support/multiroute.rb,
lib/aladdin/support/weak_comparator.rb
Defined Under Namespace
Modules: Commands, Support Classes: App, Config, ConfigError, Submission
Constant Summary collapse
- VERSION =
'0.2'
- PATHS =
Paths to other parts of the library.
{ root: root, public: File.('public', root), skeleton: File.('skeleton', root) }.to_struct.freeze
- VIEWS =
Paths to different types of views.
{ haml: File.('views/haml', root), default: File.('views', root) }
Instance Attribute Summary collapse
-
#config ⇒ Hash
Configuration hash.
Instance Method Summary collapse
-
#launch(opts = {}) ⇒ void
Launches the previewer app.
-
#prepare(opts = {}) ⇒ void
Prepares to launch the previewer app by configuring sinatra.
Instance Attribute Details
#config ⇒ Hash
Returns configuration hash.
11 12 13 |
# File 'lib/aladdin.rb', line 11 def config @config end |
Instance Method Details
#launch(opts = {}) ⇒ void
This method returns an undefined value.
Launches the previewer app.
26 27 28 29 30 31 |
# File 'lib/aladdin.rb', line 26 def launch(opts = {}) prepare opts Aladdin::App.run! rescue => e puts e. end |
#prepare(opts = {}) ⇒ void
This method returns an undefined value.
Prepares to launch the previewer app by configuring sinatra.
16 17 18 19 20 21 22 |
# File 'lib/aladdin.rb', line 16 def prepare(opts = {}) root = opts[:from] || Dir.pwd @config = Config.new root require 'aladdin/app' Aladdin::App.set :root, root Aladdin::App.set :views, Aladdin::VIEWS.merge(markdown: root) end |