Class: Rubuild::Build::Dep::ProtocolClass

Inherits:
Object
  • Object
show all
Defined in:
lib/rubuild/build/dep.rb

Overview

Rubuild::Build::Dep::ProtocolClass Used to derive Rubuild::Build::Dep::Protocol

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, name) ⇒ ProtocolClass

command

command to execute. if supplied (i.e. non-nil), object must respond to :call. command.call method 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 the args= 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

#argsObject

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

#builtObject (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

#errObject (readonly)

Error that prevented dependency execution.



343
344
345
# File 'lib/rubuild/build/dep.rb', line 343

def err
  @err
end

#nameObject (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 self from 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 self can execute.



235
236
# File 'lib/rubuild/build/dep.rb', line 235

def add_parent(dep)
end

#buildersObject

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 self is 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 self being loaded into a Rubuild::Build::Context.

buildctx

Rubuild::Build::Context into which self is 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 self was loaded.

return

The dependency hierarchy in builder that resulted in self being loaded, or nil if self was not loaded into builder.



289
290
# File 'lib/rubuild/build/dep.rb', line 289

def loaders(builder)
end

#make_runableObject

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 self from running.

err

Error that prevents parent from 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 self should wait.



229
230
# File 'lib/rubuild/build/dep.rb', line 229

def surrogate(dep)
end