Module: Fauxpaas
- Defined in:
- lib/fauxpaas.rb,
lib/fauxpaas/cli.rb,
lib/fauxpaas/command.rb,
lib/fauxpaas/invoker.rb,
lib/fauxpaas/version.rb,
lib/fauxpaas/cli/main.rb,
lib/fauxpaas/cli/syslog.rb,
lib/fauxpaas/passthrough_runner.rb
Overview
Fake Platform As A Service
Defined Under Namespace
Modules: CLI Classes: CachesCommand, Command, DeployCommand, Invoker, PassthroughRunner, ReadDefaultBranchCommand, ReleasesCommand, RestartCommand, RollbackCommand, SetDefaultBranchCommand, SyslogFollowCommand, SyslogGrepCommand, SyslogViewCommand
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.config ⇒ Object
Returns the value of attribute config.
-
.env ⇒ Object
Returns the value of attribute env.
-
.settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
- .initialize! ⇒ Object
- .load_settings!(hash = {}) ⇒ Object
- .method_missing(method, *args, &block) ⇒ Object
- .reset! ⇒ Object
- .root ⇒ Object
Class Attribute Details
.config ⇒ Object
Returns the value of attribute config.
14 15 16 |
# File 'lib/fauxpaas.rb', line 14 def config @config end |
.env ⇒ Object
Returns the value of attribute env.
14 15 16 |
# File 'lib/fauxpaas.rb', line 14 def env @env end |
.settings ⇒ Object (readonly)
Returns the value of attribute settings.
14 15 16 |
# File 'lib/fauxpaas.rb', line 14 def settings @settings end |
Class Method Details
.initialize! ⇒ Object
44 45 46 47 48 49 50 51 |
# File 'lib/fauxpaas.rb', line 44 def initialize! load_settings! unless @settings @config ||= Canister.new.tap do |container| container.register(:system_runner) { PassthroughRunner.new(STDOUT) } container.register(:server) { settings.server } container.register(:invoker) { Fauxpaas::Invoker.new } end end |
.load_settings!(hash = {}) ⇒ Object
39 40 41 42 |
# File 'lib/fauxpaas.rb', line 39 def load_settings!(hash = {}) @settings = Ettin.for(Ettin.settings_files(root/"config", env)) @settings.merge!(hash) end |
.method_missing(method, *args, &block) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/fauxpaas.rb', line 17 def method_missing(method, *args, &block) if config.respond_to?(method) config.send(method, *args, &block) else super(method, *args, &block) end end |
.reset! ⇒ Object
33 34 35 36 37 |
# File 'lib/fauxpaas.rb', line 33 def reset! @settings = nil @loaded = false @config = nil end |
.root ⇒ Object
25 26 27 |
# File 'lib/fauxpaas.rb', line 25 def root @root ||= Pathname.new(__FILE__).dirname.parent end |