Class: DeisInteractive::Rails::Base
- Inherits:
-
Object
- Object
- DeisInteractive::Rails::Base
- Defined in:
- lib/deis-interactive/rails/base.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#process ⇒ Object
readonly
Returns the value of attribute process.
Instance Method Summary collapse
-
#initialize(app, process) ⇒ Base
constructor
A new instance of Base.
- #pod_ids ⇒ Object
- #processes_pattern ⇒ Object
Constructor Details
#initialize(app, process) ⇒ Base
Returns a new instance of Base.
6 7 8 9 |
# File 'lib/deis-interactive/rails/base.rb', line 6 def initialize(app, process) @app = app @process = process end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
4 5 6 |
# File 'lib/deis-interactive/rails/base.rb', line 4 def app @app end |
#process ⇒ Object (readonly)
Returns the value of attribute process.
4 5 6 |
# File 'lib/deis-interactive/rails/base.rb', line 4 def process @process end |
Instance Method Details
#pod_ids ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/deis-interactive/rails/base.rb', line 17 def pod_ids @pod_ids ||= ( puts "Fetching pod ids..." output= `kubectl get pods --namespace #{app} -o name | grep #{processes_pattern}` output.split("\n").reject(&:empty?).map do |str| str.split("/").last end ) end |
#processes_pattern ⇒ Object
11 12 13 14 15 |
# File 'lib/deis-interactive/rails/base.rb', line 11 def processes_pattern patterns = [app] patterns << process if process patterns.join("-") end |