Module: App
- Defined in:
- lib/app-ctx.rb
Defined Under Namespace
Classes: Config, Container
Constant Summary
collapse
- VERSION =
'0.1.6'
Class Method Summary
collapse
Class Method Details
.config_path(app_path) ⇒ Object
258
259
260
261
262
|
# File 'lib/app-ctx.rb', line 258
def config_path app_path
defaults_path = File.expand_path(app_path)
ext = File.extname(defaults_path)
defaults_path.sub((ext == "" && /$/ || /#{ext}$/), ".yml")
end
|
.run(params = {}, &block) ⇒ Object
248
249
250
251
252
253
254
255
256
|
# File 'lib/app-ctx.rb', line 248
def run params = {}, &block
container = Container.new(Config.new(params))
if block_given?
container.execute {|context| block.call(context) }
else
container.execute(params)
end
end
|