Class: 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 BaseStore
Instance Method Summary collapse
- #create ⇒ Object
- #file_exists?(project = project_id, file = pool_file) ⇒ Boolean
-
#initialize(options = nil) ⇒ GitlabCommitStore
constructor
A new instance of GitlabCommitStore.
- #save ⇒ Object
- #update(content = nil) ⇒ Object
Methods inherited from BaseStore
Constructor Details
#initialize(options = nil) ⇒ GitlabCommitStore
Returns a new instance of GitlabCommitStore.
16 17 18 19 20 21 22 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 16 def initialize( = nil) ||= { project_id: nil, pool_file: 'vmpool.yaml'} 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.yaml' @branch = 'master' end |
Instance Attribute Details
#branch ⇒ Object (readonly)
Returns the value of attribute branch.
11 12 13 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 11 def branch @branch end |
#pool_file ⇒ Object (readonly)
Returns the value of attribute pool_file.
11 12 13 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 11 def pool_file @pool_file end |
#project_id ⇒ Object
Returns the value of attribute project_id.
10 11 12 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 10 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 |
#file_exists?(project = project_id, file = pool_file) ⇒ Boolean
42 43 44 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_commit_store.rb', line 42 def file_exists?(project = project_id, file = pool_file) read_content(project, file) 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 |