Class: Bgem::Config
- Inherits:
-
Object
- Object
- Bgem::Config
- Defined in:
- lib/bgem.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#entry ⇒ Object
Returns the value of attribute entry.
-
#output ⇒ Object
Returns the value of attribute output.
-
#scope ⇒ Object
Returns the value of attribute scope.
Instance Method Summary collapse
- #define_macros ⇒ Object
-
#initialize(config_file) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(config_file) ⇒ Config
Returns a new instance of Config.
33 34 35 36 37 38 39 |
# File 'lib/bgem.rb', line 33 def initialize config_file @entry, @output, @scope = SOURCE_FILE, 'output.rb', nil DSL.new self, (IO.read config_file) @dir = Pathname File.dirname config_file define_macros end |
Instance Attribute Details
#entry ⇒ Object
Returns the value of attribute entry.
32 33 34 |
# File 'lib/bgem.rb', line 32 def entry @entry end |
#output ⇒ Object
Returns the value of attribute output.
32 33 34 |
# File 'lib/bgem.rb', line 32 def output @output end |
#scope ⇒ Object
Returns the value of attribute scope.
32 33 34 |
# File 'lib/bgem.rb', line 32 def scope @scope end |
Instance Method Details
#define_macros ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/bgem.rb', line 41 def define_macros Output::Ext.file_extensions.map do |type| dir = @dir + type.to_s MacroDir.new(type, dir) if dir.directory? end.compact.each do |macro_dir| macro_dir.define_macros end end |