Sha256: 63de0ed979799b51d8687777e95480ef4e8fc30b592775afc7dac4cdf074be09
Contents?: true
Size: 1.22 KB
Versions: 5
Compression:
Stored size: 1.22 KB
Contents
module Eye::Dsl::Main attr_accessor :parsed_config, :parsed_filename, :parsed_default_app def application(name, &block) Eye::Dsl.check_name(name) name = name.to_s Eye::Dsl.debug "=> app: #{name}" if name == '__default__' @parsed_default_app ||= Eye::Dsl::ApplicationOpts.new(name) @parsed_default_app.instance_eval(&block) else opts = Eye::Dsl::ApplicationOpts.new(name, @parsed_default_app) opts.instance_eval(&block) @parsed_config.applications[name] = opts.config if opts.config end Eye::Dsl.debug "<= app: #{name}" end alias project application alias app application 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 def config(&block) Eye::Dsl.debug '=> config' opts = Eye::Dsl::ConfigOpts.new opts.instance_eval(&block) Eye::Utils.deep_merge!(@parsed_config.settings, opts.config) Eye::Dsl.debug '<= config' end alias settings config end
Version data entries
5 entries across 5 versions & 2 rubygems
Version | Path |
---|---|
eye-0.6.1 | lib/eye/dsl/main.rb |
ace-eye-0.6.3 | lib/eye/dsl/main.rb |
ace-eye-0.6.2 | lib/eye/dsl/main.rb |
ace-eye-0.6.1 | lib/eye/dsl/main.rb |
eye-0.6 | lib/eye/dsl/main.rb |