Class: NetLinx::Rake::Compile

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/netlinx/rake/compile/compile.rb

Overview

Compile to deployable code from the source code files in the given workspace.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = :compile) {|_self| ... } ⇒ Compile

Returns a new instance of Compile.

Yields:

  • (_self)

Yield Parameters:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/netlinx/rake/compile/compile.rb', line 15

def initialize name = :compile
  @name = name
  yield self if block_given?
  
  desc "Compile to deployable code from the source code files in the given workspace."
  
  task(name) do
    workspace = Dir.glob("*.apw").first
    
    puts "\n\nLaunching NetLinx compiler...\n\n"
    # TODO: Invoke compiler through API.
    #       Just call the netlinx-compile rake task in rake/erb.
    system "netlinx-compile --smart -s \"#{workspace}\""
    # NetLinx::Compile::Script.run argv: ['--smart', '-s', "\"#{workspace}\""]
  end
  
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/netlinx/rake/compile/compile.rb', line 13

def name
  @name
end