Class: Kitchen::Driver::VmpoolStores::GitlabCommitStore
- Inherits:
-
GitlabBaseStore
- Object
- BaseStore
- FileBaseStore
- GitlabBaseStore
- Kitchen::Driver::VmpoolStores::GitlabCommitStore
- Defined in:
- lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb
Instance Attribute Summary collapse
-
#branch ⇒ Object
readonly
Returns the value of attribute branch.
-
#pool_file ⇒ Object
readonly
Returns the value of attribute pool_file.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
Attributes inherited from FileBaseStore
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(options = nil) ⇒ GitlabCommitStore
constructor
A new instance of GitlabCommitStore.
- #save ⇒ Object
- #update(content = nil) ⇒ Object
Methods inherited from FileBaseStore
#cleanup, #read, #reread, #take_pool_member
Methods inherited from BaseStore
Constructor Details
#initialize(options = nil) ⇒ GitlabCommitStore
Returns a new instance of GitlabCommitStore.
14 15 16 17 18 19 20 21 22 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 14 def initialize( = nil) # there is currently some sort of weird bug in gitlab that prevents us from creating files with a yaml extension # thus we have ranmed the default pool file to vmpool ||= { "project_id" => nil, "pool_file" => 'vmpool'} raise ArgumentError.new("You must pass the project_id option") unless ['project_id'].to_i > 0 @project_id = ['project_id'] #ie. 89 @pool_file = ['pool_file'] || 'vmpool' @branch = 'master' end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
9 10 11 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 9 def branch @branch end |
#pool_file ⇒ Object (readonly)
Returns the value of attribute pool_file.
9 10 11 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 9 def pool_file @pool_file end |
#project_id ⇒ Object
Returns the value of attribute project_id.
8 9 10 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 8 def project_id @project_id end |
Instance Method Details
#create ⇒ Object
30 31 32 33 34 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 30 def create #info("Creating new vmpool data commit") create_file unless file_exists? read end |
#save ⇒ Object
36 37 38 39 40 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 36 def save # info("Saving vmpool data") update_file read end |
#update(content = nil) ⇒ Object
24 25 26 27 28 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 24 def update(content = nil) #info("Updating vmpool data") update_file read end |