Class: Rscons::Script
- Inherits:
-
Object
- Object
- Rscons::Script
- Defined in:
- lib/rscons/script.rb
Overview
The Script class encapsulates the state of a build script.
Defined Under Namespace
Classes: ConfigureDsl, Dsl
Instance Attribute Summary collapse
-
#autoconf ⇒ Boolean
Whether to autoconfigure if the user does not explicitly perform a configure operation before building (default: true).
-
#operations ⇒ Hash
readonly
Operation lambdas.
-
#project_name ⇒ String?
Project name.
Instance Method Summary collapse
-
#build ⇒ Object
Perform build operation.
-
#configure(configure_op) ⇒ Object
Perform configure operation.
-
#initialize ⇒ Script
constructor
Construct a Script.
-
#load(path) ⇒ void
Load a script from the specified file.
Constructor Details
#initialize ⇒ Script
Construct a Script.
115 116 117 118 |
# File 'lib/rscons/script.rb', line 115 def initialize @autoconf = true @operations = {} end |
Instance Attribute Details
#autoconf ⇒ Boolean
Returns Whether to autoconfigure if the user does not explicitly perform a configure operation before building (default: true).
108 109 110 |
# File 'lib/rscons/script.rb', line 108 def autoconf @autoconf end |
#operations ⇒ Hash (readonly)
Returns Operation lambdas.
112 113 114 |
# File 'lib/rscons/script.rb', line 112 def operations @operations end |
#project_name ⇒ String?
Returns Project name.
103 104 105 |
# File 'lib/rscons/script.rb', line 103 def project_name @project_name end |
Instance Method Details
#build ⇒ Object
Perform build operation.
132 133 134 135 136 |
# File 'lib/rscons/script.rb', line 132 def build if build_proc = @operations["build"] build_proc.call end end |
#configure(configure_op) ⇒ Object
Perform configure operation.
139 140 141 142 143 144 |
# File 'lib/rscons/script.rb', line 139 def configure(configure_op) if operation_lambda = @operations["configure"] cdsl = ConfigureDsl.new(configure_op) cdsl.instance_eval(&operation_lambda) end end |