Class: Rubuild::Build::Dep::ProtocolClass
- Inherits:
-
Object
- Object
- Rubuild::Build::Dep::ProtocolClass
- Defined in:
- lib/rubuild/build/dep.rb
Overview
Rubuild::Build::Dep::ProtocolClass Used to derive Rubuild::Build::Dep::Protocol
Instance Attribute Summary collapse
-
#args ⇒ Object
Array of additional arguments to :command.call().
-
#built ⇒ Object
readonly
Boolean indicates whether
self‘s dependency action has been run. -
#err ⇒ Object
readonly
Error that prevented dependency execution.
-
#name ⇒ Object
readonly
Human-readable name of this dependency.
Instance Method Summary collapse
-
#action_error(err, runctx) ⇒ Object
Error
erroccurred while executingself‘s dependency command. -
#action_error_real(err) ⇒ Object
Inform all children that a parent dependency (or
self) failed to execute a command due toerr. -
#add_parent(dep) ⇒ Object
Makes
depa parent dependency ofself- in other words,depmust be run beforeselfcan be run. -
#builders ⇒ Object
Return array of all Rubuild::Build::Context objects that will build this dependency.
-
#child_added(dep) ⇒ Object
Record that a child dependency has been added to
self. -
#circle_check(loading, check) ⇒ Object
Check for circular dependencies.
-
#initialize(command, name) ⇒ ProtocolClass
constructor
command-
command to execute.
-
#load(buildctx) ⇒ Object
Loads
selfand all parent dependancies into the execution contextbuildctx. -
#load_self(loading, buildctx) ⇒ Object
Record that a build-context is waiting to build this dependency.
-
#loaders(builder) ⇒ Object
Return the child-dependencies of
selfthat placedselfinto the Rubuild::Build::Contextbuilder. -
#make_runable ⇒ Object
Mark that all parent dependencies have been satisfied for
self. -
#parent_action_error(parent, err) ⇒ Object
Child is being informed by
parentthat errorerroccurred processing a dependency action. -
#parent_built(dep) ⇒ Object
Record that a parent dependency has been built.
-
#runctx_build(runctx) ⇒ Object
Used by a Rubuild::Build::Context to execute the dependency command for
self. -
#set_command(command) ⇒ Object
Resets the dependency action to be invoked.
-
#surrogate(dep) ⇒ Object
Inserts dependency between
selfand all child dependencies ofself.
Constructor Details
#initialize(command, name) ⇒ ProtocolClass
command-
command to execute. if supplied (i.e. non-
nil), object must respond to:call.command.callmethod will be invoked at time that this dependency should be processed, with first argument being this dependency object (self), and subsequent arguments as set by theargs=method. name-
name string for dependency. for pretty-printing dependency errors.
216 217 |
# File 'lib/rubuild/build/dep.rb', line 216 def initialize(command, name) end |
Instance Attribute Details
#args ⇒ Object
Array of additional arguments to :command.call(). The first argument to :command.call() is always self.
340 341 342 |
# File 'lib/rubuild/build/dep.rb', line 340 def args @args end |
#built ⇒ Object (readonly)
Boolean indicates whether self‘s dependency action has been run.
336 337 338 |
# File 'lib/rubuild/build/dep.rb', line 336 def built @built end |
#err ⇒ Object (readonly)
Error that prevented dependency execution.
343 344 345 |
# File 'lib/rubuild/build/dep.rb', line 343 def err @err end |
#name ⇒ Object (readonly)
Human-readable name of this dependency.
346 347 348 |
# File 'lib/rubuild/build/dep.rb', line 346 def name @name end |
Instance Method Details
#action_error(err, runctx) ⇒ Object
Error err occurred while executing self‘s dependency command. Inform all child dependencies of the event. Used internally.
err-
Exception that prevented
self‘s dependency command from completing. runctx-
Rubuild::Build::Context used to execute
self. - return
-
Rubuild::Build::Dep::Error::Action for
err.
307 308 |
# File 'lib/rubuild/build/dep.rb', line 307 def action_error(err, runctx) end |
#action_error_real(err) ⇒ Object
Inform all children that a parent dependency (or self) failed to execute a command due to err. Used internally.
err-
Exception that prevents
selffrom completing. - return
-
Rubuild::Build::Dep::Error::Action for
err.
297 298 |
# File 'lib/rubuild/build/dep.rb', line 297 def action_error_real(err) end |
#add_parent(dep) ⇒ Object
Makes dep a parent dependency of self - in other words, dep must be run before self can be run.
dep-
Dependency that must be executed before
selfcan execute.
235 236 |
# File 'lib/rubuild/build/dep.rb', line 235 def add_parent(dep) end |
#builders ⇒ Object
Return array of all Rubuild::Build::Context objects that will build this dependency.
280 281 |
# File 'lib/rubuild/build/dep.rb', line 280 def builders end |
#child_added(dep) ⇒ Object
Record that a child dependency has been added to self. Used internally.
dep-
New child dependency.
241 242 |
# File 'lib/rubuild/build/dep.rb', line 241 def child_added(dep) end |
#circle_check(loading, check) ⇒ Object
Check for circular dependencies. Used internally.
loading-
Rubuild::Build::Dep chain in progress. Used as a backtrace, in case a circular dependency is detected.
check-
Array of Rubuild::Build::Dep objects to place in ‘parent’ list, when searching for circular dependencies.
257 258 |
# File 'lib/rubuild/build/dep.rb', line 257 def circle_check(loading, check) end |
#load(buildctx) ⇒ Object
Loads self and all parent dependancies into the execution context buildctx.
buildctx-
Rubuild::Build::Context into which
selfis being loaded.
275 276 |
# File 'lib/rubuild/build/dep.rb', line 275 def load(buildctx) end |
#load_self(loading, buildctx) ⇒ Object
Record that a build-context is waiting to build this dependency. Search for circular dependencies. Used internally.
loading-
Rubuild::Build::Dep dependency chain in progress, that lead to
selfbeing loaded into a Rubuild::Build::Context. buildctx-
Rubuild::Build::Context into which
selfis being loaded.
268 269 |
# File 'lib/rubuild/build/dep.rb', line 268 def load_self(loading, buildctx) end |
#loaders(builder) ⇒ Object
Return the child-dependencies of self that placed self into the Rubuild::Build::Context builder.
builder-
A Rubuild::Build::Context into which
selfwas loaded. - return
-
The dependency hierarchy in
builderthat resulted inselfbeing loaded, or nil ifselfwas not loaded intobuilder.
289 290 |
# File 'lib/rubuild/build/dep.rb', line 289 def loaders(builder) end |
#make_runable ⇒ Object
Mark that all parent dependencies have been satisfied for self. Inform all build contexts that might execute this dependency that this dependency is now runable. Used internally.
248 249 |
# File 'lib/rubuild/build/dep.rb', line 248 def make_runable end |
#parent_action_error(parent, err) ⇒ Object
Child is being informed by parent that error err occurred processing a dependency action. Used internally.
parent-
Parent dependency that will not run, thus preventing
selffrom running. err-
Error that prevents
parentfrom running.
316 317 |
# File 'lib/rubuild/build/dep.rb', line 316 def parent_action_error(parent, err) end |
#parent_built(dep) ⇒ Object
Record that a parent dependency has been built. Will result in this dependency being made runable, when all parent dependencies are satisfied. Used internally.
dep-
Parent dependency that was built.
332 333 |
# File 'lib/rubuild/build/dep.rb', line 332 def parent_built(dep) end |
#runctx_build(runctx) ⇒ Object
Used by a Rubuild::Build::Context to execute the dependency command for self. Used internally.
runctx-
Rubuild::Build::Context used to execute
self‘s dependency command.
324 325 |
# File 'lib/rubuild/build/dep.rb', line 324 def runctx_build(runctx) end |
#set_command(command) ⇒ Object
Resets the dependency action to be invoked.
command-
New command to be invoked.
- return
-
self.
222 223 |
# File 'lib/rubuild/build/dep.rb', line 222 def set_command(command) end |
#surrogate(dep) ⇒ Object
Inserts dependency between self and all child dependencies of self.
dep-
Dependency against which all child dependencies of
selfshould wait.
229 230 |
# File 'lib/rubuild/build/dep.rb', line 229 def surrogate(dep) end |