Class: Rebi::EB
- Inherits:
-
Object
show all
- Defined in:
- lib/rebi/eb.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(client = Aws::ElasticBeanstalk::Client.new) ⇒ EB
Returns a new instance of EB.
4
5
6
|
# File 'lib/rebi/eb.rb', line 4
def initialize client=Aws::ElasticBeanstalk::Client.new
@client = client
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
40
41
42
|
# File 'lib/rebi/eb.rb', line 40
def method_missing(m, *args, &block)
client.send(m, *args, &block)
end
|
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3
4
5
|
# File 'lib/rebi/eb.rb', line 3
def client
@client
end
|
Instance Method Details
#applications ⇒ Object
8
9
10
|
# File 'lib/rebi/eb.rb', line 8
def applications
client.describe_applications.applications.map(&:application_name)
end
|
#get_solution_stack(platform, version) ⇒ Object
34
35
36
37
38
|
# File 'lib/rebi/eb.rb', line 34
def get_solution_stack platform, version
solution_stacks.find do |st|
st["platform"] == platform && st["version"] == version
end["solution_stack"]
end
|
18
19
20
21
22
|
# File 'lib/rebi/eb.rb', line 18
def platforms
@platforms ||= solution_stacks.map do |st|
st["platform"]
end.uniq
end
|
#solution_stacks ⇒ Object
12
13
14
15
16
|
# File 'lib/rebi/eb.rb', line 12
def solution_stacks
@solution_stacks = client.list_available_solution_stacks.solution_stacks.map do |s|
stacks_from_string s
end
end
|
24
25
26
27
28
29
30
31
32
|
# File 'lib/rebi/eb.rb', line 24
def versions_by_platform platform
raise "Invalid platform" unless platforms.include?(platform)
solution_stacks.select do |st|
st["platform"] == platform
end.map do |st|
st["version"]
end.uniq
end
|