Class: Bob::Test::BuildableStub
- Inherits:
-
Object
- Object
- Bob::Test::BuildableStub
- Includes:
- Buildable
- Defined in:
- lib/bob/test/buildable_stub.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#build_script ⇒ Object
readonly
Returns the value of attribute build_script.
-
#commit ⇒ Object
readonly
Returns the value of attribute commit.
-
#commit_info ⇒ Object
readonly
Returns the value of attribute commit_info.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#scm ⇒ Object
readonly
Returns the value of attribute scm.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Class Method Summary collapse
Instance Method Summary collapse
- #finish_building(commit_info, status, output) ⇒ Object
-
#initialize(scm, uri, branch, commit, build_script) ⇒ BuildableStub
constructor
A new instance of BuildableStub.
Methods included from Buildable
Constructor Details
#initialize(scm, uri, branch, commit, build_script) ⇒ BuildableStub
Returns a new instance of BuildableStub.
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bob/test/buildable_stub.rb', line 24 def initialize(scm, uri, branch, commit, build_script) @scm = scm.to_s @uri = uri.to_s @branch = branch @commit = commit @build_script = build_script @status = nil @output = "" @commit_info = {} end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def branch @branch end |
#build_script ⇒ Object (readonly)
Returns the value of attribute build_script.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def build_script @build_script end |
#commit ⇒ Object (readonly)
Returns the value of attribute commit.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def commit @commit end |
#commit_info ⇒ Object (readonly)
Returns the value of attribute commit_info.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def commit_info @commit_info end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def output @output end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def repo @repo end |
#scm ⇒ Object (readonly)
Returns the value of attribute scm.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def scm @scm end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def status @status end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
21 22 23 |
# File 'lib/bob/test/buildable_stub.rb', line 21 def uri @uri end |
Class Method Details
.for(repo, commit) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bob/test/buildable_stub.rb', line 6 def self.for(repo, commit) scm = (Bob::Test::GitRepo === repo) ? "git" : "svn" uri = if scm == "git" repo.path else "file://#{SvnRepo.server_root}/#{repo.name}" end # TODO: move onto repo object? branch = (scm == "git") ? "master" : "" build_script = "./test" new(scm, uri, branch, commit, build_script) end |
Instance Method Details
#finish_building(commit_info, status, output) ⇒ Object
36 37 38 39 40 |
# File 'lib/bob/test/buildable_stub.rb', line 36 def finish_building(commit_info, status, output) @commit_info = commit_info @status = status ? :successful : :failed @output = output end |