Module: Bob

Defined in:
lib/bob.rb,
lib/bob/scm.rb,
lib/bob/engine.rb,
lib/bob/builder.rb,
lib/bob/scm/git.rb,
lib/bob/scm/svn.rb,
lib/bob/buildable.rb,
lib/bob/scm/abstract.rb,
lib/bob/engine/threaded.rb,
lib/bob/engine/foreground.rb

Defined Under Namespace

Modules: Buildable, Engine, SCM Classes: Builder

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.directoryObject

Directory where the code for the different buildables will be checked out. Make sure the user running Bob is allowed to write to this directory.



37
38
39
# File 'lib/bob.rb', line 37

def self.directory
  @directory || "/tmp"
end

.engineObject

What will you use to build in background. Must respond to call and take a block which will be run “in background”. The default is to run in foreground.



44
45
46
# File 'lib/bob.rb', line 44

def self.engine
  @engine || Engine::Foreground
end

.loggerObject

What to log with (must implement ruby’s Logger interface). Logs to STDOUT by default.



50
51
52
# File 'lib/bob.rb', line 50

def self.logger
  @logger || Logger.new(STDOUT)
end

Class Method Details

.build(buildable, commit_ids) ⇒ Object

Builds the specified buildable. This object must understand the API described in the README.

The second argument will take an array of commit_ids, which should be strings with the relevant identifier (a SHA1 hash for git repositories, a numerical revision for svn repositories, etc).

You can pass :head as a commit identifier to build the latest commit in the repo. Examples:

Bob.build(buildable, :head) # just build the head
Bob.build(buildable, ["4", "3", "2"]) # build revision 4, 3, and 2
                                      # (in that order)
Bob.build(buildable, [:head, "a30fb12"]) # build the HEAD and a30fb12
                                         # commits in this repo.


29
30
31
32
33
# File 'lib/bob.rb', line 29

def self.build(buildable, commit_ids)
  Array(commit_ids).each do |commit_id|
    Builder.new(buildable, commit_id).build
  end
end