Class: Kitchen::Driver::VmpoolStores::GitlabStore
- Inherits:
-
Object
- Object
- Kitchen::Driver::VmpoolStores::GitlabStore
- Defined in:
- lib/kitchen/driver/vmpool_stores/gitlab_store.rb
Instance Attribute Summary collapse
-
#pool_file ⇒ Object
readonly
Returns the value of attribute pool_file.
-
#project_id ⇒ Object
Returns the value of attribute project_id.
-
#snippet_id ⇒ Object
Returns the value of attribute snippet_id.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(options = nil) ⇒ GitlabStore
constructor
A new instance of GitlabStore.
- #pool_content ⇒ Object
- #pool_data ⇒ Object
- #read ⇒ Object
- #save ⇒ Object
- #update ⇒ Object
Constructor Details
#initialize(options = nil) ⇒ GitlabStore
Returns a new instance of GitlabStore.
13 14 15 16 17 18 19 20 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 13 def initialize( = nil) ||= { project_id: nil, snippet_id: nil, pool_file: 'vmpool.yaml'} raise ArgumentError.new("You must pass the project_id option") unless ['project_id'].to_i > 0 raise ArgumentError.new("You must pass the snippet_id option") unless ['snippet_id'].to_i > 0 @snippet_id = ['snippet_id'] #ie. 630 @project_id = ['project_id'] #ie. 89 @pool_file = ['pool_file'] end |
Instance Attribute Details
#pool_file ⇒ Object (readonly)
Returns the value of attribute pool_file.
8 9 10 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 8 def pool_file @pool_file end |
#project_id ⇒ Object
Returns the value of attribute project_id.
7 8 9 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 7 def project_id @project_id end |
#snippet_id ⇒ Object
Returns the value of attribute snippet_id.
7 8 9 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 7 def snippet_id @snippet_id end |
Instance Method Details
#create ⇒ Object
27 28 29 30 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 27 def create create_snippet read end |
#pool_content ⇒ Object
46 47 48 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 46 def pool_content read_snippet end |
#pool_data ⇒ Object
37 38 39 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 37 def pool_data @pool_data ||= YAML.load(pool_content) end |
#read ⇒ Object
32 33 34 35 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 32 def read puts "Reading snippet" pool_content end |
#save ⇒ Object
41 42 43 44 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 41 def save update_snippet read end |
#update ⇒ Object
22 23 24 25 |
# File 'lib/kitchen/driver/vmpool_stores/gitlab_store.rb', line 22 def update update_snippet read end |