Sha256: 7917dadb17c41e511cc40de4393c7c3f07a27e5e915da6075264b88bf22672be
Contents?: true
Size: 1.32 KB
Versions: 18
Compression:
Stored size: 1.32 KB
Contents
module Rscons module Builders # A Generic builder class whose name and operation is defined at # instantiation. # # @since 1.8.0 class SimpleBuilder < Builder # @return [String] The name of this builder. attr_reader :name # Create a new builder with the given name and action. # # @param name [String,Symbol] The name of the builder when registered. # @param block [Block] # The action to perform when the builder is processed. The provided # block must return the target file on success or false on failure. # The provided block should have the same signature as {Builder#run}. def initialize(name, &block) @name = name.to_s @block = block end # Run the builder to produce a build target. # # @param target [String] Target file name. # @param sources [Array<String>] Source file name(s). # @param cache [Cache] The Cache object. # @param env [Environment] The Environment executing the builder. # @param vars [Hash,VarSet] Extra construction variables. # # @return [String,false] # Name of the target file on success or false on failure. def run(target, sources, cache, env, vars) @block.call(target, sources, cache, env, vars) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems