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, GlobalDsl
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.
194 195 196 197 |
# File 'lib/rscons/script.rb', line 194 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).
187 188 189 |
# File 'lib/rscons/script.rb', line 187 def autoconf @autoconf end |
#operations ⇒ Hash (readonly)
Returns Operation lambdas.
191 192 193 |
# File 'lib/rscons/script.rb', line 191 def operations @operations end |
#project_name ⇒ String?
Returns Project name.
182 183 184 |
# File 'lib/rscons/script.rb', line 182 def project_name @project_name end |
Instance Method Details
#build ⇒ Object
Perform build operation.
211 212 213 214 215 |
# File 'lib/rscons/script.rb', line 211 def build if build_proc = @operations["build"] build_proc.call end end |
#configure(configure_op) ⇒ Object
Perform configure operation.
218 219 220 221 222 223 |
# File 'lib/rscons/script.rb', line 218 def configure(configure_op) if operation_lambda = @operations["configure"] cdsl = ConfigureDsl.new(configure_op) cdsl.instance_eval(&operation_lambda) end end |