Class: Magica::Toolchain
- Includes:
- Rake::DSL
- Defined in:
- lib/magica/toolchain.rb
Overview
:nodoc:
Class Attribute Summary collapse
-
.toolchains ⇒ Object
Returns the value of attribute toolchains.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Toolchain
constructor
A new instance of Toolchain.
- #setup(builder, options = {}) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Toolchain
Returns a new instance of Toolchain.
11 12 13 14 15 16 |
# File 'lib/magica/toolchain.rb', line 11 def initialize(name, &block) @name = name.to_s @initializer = block Toolchain.toolchains ||= {} Toolchain.toolchains[@name] = self end |
Class Attribute Details
.toolchains ⇒ Object
Returns the value of attribute toolchains.
8 9 10 |
# File 'lib/magica/toolchain.rb', line 8 def toolchains @toolchains end |
Class Method Details
.load ⇒ Object
22 23 24 25 26 27 |
# File 'lib/magica/toolchain.rb', line 22 def self.load builtin_path = File.join(File.dirname(__FILE__), 'toolchains') Dir.glob("#{builtin_path}/*.rake").each do |file| Kernel.load file end end |
Instance Method Details
#setup(builder, options = {}) ⇒ Object
18 19 20 |
# File 'lib/magica/toolchain.rb', line 18 def setup(builder, = {}) builder.instance_exec(builder, , &@initializer) end |