Module: Eye::Dsl::Main
- Defined in:
- lib/eye/dsl/main.rb
Instance Attribute Summary collapse
-
#parsed_config ⇒ Object
Returns the value of attribute parsed_config.
-
#parsed_filename ⇒ Object
Returns the value of attribute parsed_filename.
Instance Method Summary collapse
- #application(name, &block) ⇒ Object (also: #project, #app)
- #config(&block) ⇒ Object (also: #settings)
- #load(glob = '') ⇒ Object
Instance Attribute Details
#parsed_config ⇒ Object
Returns the value of attribute parsed_config.
2 3 4 |
# File 'lib/eye/dsl/main.rb', line 2 def parsed_config @parsed_config end |
#parsed_filename ⇒ Object
Returns the value of attribute parsed_filename.
2 3 4 |
# File 'lib/eye/dsl/main.rb', line 2 def parsed_filename @parsed_filename end |
Instance Method Details
#application(name, &block) ⇒ Object Also known as: project, app
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/eye/dsl/main.rb', line 4 def application(name, &block) Eye::Dsl.check_name(name) Eye::Dsl.debug "=> app: #{name}" opts = Eye::Dsl::ApplicationOpts.new(name) opts.instance_eval(&block) @parsed_config.applications[name.to_s] = opts.config if opts.config Eye::Dsl.debug "<= app: #{name}" end |
#config(&block) ⇒ Object Also known as: settings
33 34 35 36 37 38 39 40 41 |
# File 'lib/eye/dsl/main.rb', line 33 def config(&block) Eye::Dsl.debug '=> config' opts = Eye::Dsl::ConfigOpts.new opts.instance_eval(&block) @parsed_config.settings.merge!(opts.config) Eye::Dsl.debug '<= config' end |
#load(glob = '') ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/eye/dsl/main.rb', line 19 def load(glob = '') return if glob.blank? Eye::Dsl::Opts.with_parsed_file(glob) do |mask| Dir[mask].each do |path| Eye::Dsl.debug "=> load #{path}" Eye.parsed_filename = path res = Kernel.load(path) Eye.info "load: subload #{path} (#{res})" Eye::Dsl.debug "<= load #{path}" end end end |