Class: Bob::Test::BuildableStub
- Inherits:
-
Struct
- Object
- Struct
- Bob::Test::BuildableStub
- Includes:
- Buildable
- Defined in:
- lib/bob/test/buildable_stub.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#build_script ⇒ Object
Returns the value of attribute build_script.
-
#builds ⇒ Object
readonly
Returns the value of attribute builds.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#scm ⇒ Object
Returns the value of attribute scm.
-
#uri ⇒ Object
Returns the value of attribute uri.
Class Method Summary collapse
Instance Method Summary collapse
- #finish_building(commit_id, status, output) ⇒ Object
-
#initialize(*args) ⇒ BuildableStub
constructor
A new instance of BuildableStub.
- #start_building(commit_id, commit_info) ⇒ Object
Constructor Details
#initialize(*args) ⇒ BuildableStub
Returns a new instance of BuildableStub.
22 23 24 25 26 27 |
# File 'lib/bob/test/buildable_stub.rb', line 22 def initialize(*args) super @builds = {} @metadata = {} end |
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch
2 3 4 |
# File 'lib/bob/test/buildable_stub.rb', line 2 def branch @branch end |
#build_script ⇒ Object
Returns the value of attribute build_script
2 3 4 |
# File 'lib/bob/test/buildable_stub.rb', line 2 def build_script @build_script end |
#builds ⇒ Object (readonly)
Returns the value of attribute builds.
5 6 7 |
# File 'lib/bob/test/buildable_stub.rb', line 5 def builds @builds end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/bob/test/buildable_stub.rb', line 5 def @metadata end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
5 6 7 |
# File 'lib/bob/test/buildable_stub.rb', line 5 def repo @repo end |
#scm ⇒ Object
Returns the value of attribute scm
2 3 4 |
# File 'lib/bob/test/buildable_stub.rb', line 2 def scm @scm end |
#uri ⇒ Object
Returns the value of attribute uri
2 3 4 |
# File 'lib/bob/test/buildable_stub.rb', line 2 def uri @uri end |
Class Method Details
.call(repo) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bob/test/buildable_stub.rb', line 7 def self.call(repo) scm = (Bob::Test::GitRepo === repo) ? :git : :svn uri = if scm == :git repo.path else "file://#{SvnRepo.server_root}/#{repo.name}" end # move to repo branch = (scm == :git) ? "master" : "" build_script = "./test" new(scm, uri, branch, build_script) end |
Instance Method Details
#finish_building(commit_id, status, output) ⇒ Object
33 34 35 |
# File 'lib/bob/test/buildable_stub.rb', line 33 def finish_building(commit_id, status, output) @builds[commit_id] = [status ? :successful : :failed, output] end |
#start_building(commit_id, commit_info) ⇒ Object
29 30 31 |
# File 'lib/bob/test/buildable_stub.rb', line 29 def start_building(commit_id, commit_info) @metadata[commit_id] = commit_info end |