Class: RightScale::DevRepositories
- Includes:
- Serializable
- Defined in:
- lib/right_agent/core_payload_types/dev_repositories.rb
Overview
Sequence of cookbooks to be checked out on the instance.
Instance Attribute Summary collapse
-
#repositories ⇒ Object
Returns the value of attribute repositories.
Instance Method Summary collapse
-
#add_repo(repo_sha, repo_detail, cookbook_positions) ⇒ Object
Add a repository...
-
#empty? ⇒ Boolean
Return (Boolean):: true if there are no repositories, false otherwise.
-
#initialize(*args) ⇒ DevRepositories
constructor
Initialize fields from given arguments.
-
#serialized_members ⇒ Object
Array of serialized fields given to constructor.
Methods included from Serializable
Constructor Details
#initialize(*args) ⇒ DevRepositories
Initialize fields from given arguments
34 35 36 |
# File 'lib/right_agent/core_payload_types/dev_repositories.rb', line 34 def initialize(*args) @repositories = args[0] || {} end |
Instance Attribute Details
#repositories ⇒ Object
Returns the value of attribute repositories.
31 32 33 |
# File 'lib/right_agent/core_payload_types/dev_repositories.rb', line 31 def repositories @repositories end |
Instance Method Details
#add_repo(repo_sha, repo_detail, cookbook_positions) ⇒ Object
Add a repository...
Parameters
- (Hash)
collection of repos to be checked out on the instance
:repo_sha (String):: the hash id (SHA) of the repository
:repo_detail (Hash):: info needed to checkout this repo
{
Return
- result(Hash)
The entry added to the collection of repositories
79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/right_agent/core_payload_types/dev_repositories.rb', line 79 def add_repo(repo_sha, repo_detail, cookbook_positions) @repositories ||= {} @repositories[repo_sha] = DevRepository.new(repo_detail[:repo_type], repo_detail[:url], repo_detail[:tag], repo_detail[:cookboooks_path], repo_detail[:ssh_key], repo_detail[:username], repo_detail[:password], repo_sha, cookbook_positions) end |
#empty? ⇒ Boolean
Return
- (Boolean)
true if there are no repositories, false otherwise
95 96 97 |
# File 'lib/right_agent/core_payload_types/dev_repositories.rb', line 95 def empty? @repositories.count == 0 end |
#serialized_members ⇒ Object
Array of serialized fields given to constructor
39 40 41 |
# File 'lib/right_agent/core_payload_types/dev_repositories.rb', line 39 def serialized_members [ @repositories ] end |