escobar 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e1e4a6792723ce5b679672f36a2e62f1d94b94a
4
- data.tar.gz: 5121cb555396519f823790a52d785dca9d35ecfe
3
+ metadata.gz: 343adec7bff5a835b00169a2f8afad75759f8cf1
4
+ data.tar.gz: bdedccdd983055a9e1611817757d521f379b7fb6
5
5
  SHA512:
6
- metadata.gz: ea78c3f9a67ce9b1298d9b1690dae42dd4a52d54fefd63d7b5d32dfc4eaa0d8f4003d5fef26d3469c8fd1af37dbd0dbc5b79f7cff4777a0387ad8b50cfa8f2cf
7
- data.tar.gz: 8307ea8d1abc282843e0f91ca47226a101642e92cf9acf535b26377d7e402689bb50eed28884e3f2496da845e8fe98a3218968ff808f6c6615b29afcb718eb72
6
+ metadata.gz: a0ec16918caa31cafd9bcb0fe5f32880b2de23c35ca7b00160c896913c18e657a1533870099d50e18bf4af53a6208cb12ad0594a2a3bc23c90edb732816b9d58
7
+ data.tar.gz: 8cc1e6c8fadc0398ecf8eba8f104b52dae56ae7a07a1ef9615bf6464ee5b7fcb469ebb4e8be83d1cc36d6707b4c13024a28cb8d4434a984ca41daccd2cde7bae
data/exe/escobar ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "pry"
4
+ require "escobar"
5
+
6
+ client = Escobar::Client.from_environment
7
+
8
+ client.app_names.sort.each do |name|
9
+ pipeline = client[name]
10
+ puts "#{name}:"
11
+ pipeline.couplings.each do |environment|
12
+ puts " #{environment.name}: #{environment.app.name}"
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ module Escobar
2
+ module Heroku
3
+ # Class representing a heroku application
4
+ class App
5
+ attr_reader :client, :id
6
+ def initialize(client, id)
7
+ @id = id
8
+ @client = client
9
+ end
10
+
11
+ def name
12
+ info["name"]
13
+ end
14
+
15
+ def info
16
+ @info ||= client.get("/apps/#{id}")
17
+ end
18
+ end
19
+ end
20
+ end
21
+
@@ -2,13 +2,17 @@ module Escobar
2
2
  module Heroku
3
3
  # Class representing a deployable environment
4
4
  class Coupling
5
- attr_reader :app, :client, :id, :name
5
+ attr_reader :app, :app_id, :client, :id, :name
6
6
  def initialize(client, coupling)
7
7
  @id = coupling["id"]
8
- @app = coupling["app"]["id"]
9
8
  @name = coupling["stage"]
9
+ @app_id = coupling["app"]["id"]
10
10
  @client = client
11
11
  end
12
+
13
+ def app
14
+ @app ||= Escobar::Heroku::App.new(client, app_id)
15
+ end
12
16
  end
13
17
  end
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module Escobar
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
data/lib/escobar.rb CHANGED
@@ -47,6 +47,7 @@ end
47
47
 
48
48
  require_relative "./escobar/client"
49
49
  require_relative "./escobar/github"
50
+ require_relative "./escobar/heroku/app"
50
51
  require_relative "./escobar/heroku/client"
51
52
  require_relative "./escobar/heroku/coupling"
52
53
  require_relative "./escobar/heroku/pipeline"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escobar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe
@@ -167,7 +167,8 @@ dependencies:
167
167
  description: Heroku pipelines and GitHub Deployments
168
168
  email:
169
169
  - atmos@atmos.org
170
- executables: []
170
+ executables:
171
+ - escobar
171
172
  extensions: []
172
173
  extra_rdoc_files: []
173
174
  files:
@@ -185,9 +186,11 @@ files:
185
186
  - bin/console
186
187
  - bin/setup
187
188
  - escobar.gemspec
189
+ - exe/escobar
188
190
  - lib/escobar.rb
189
191
  - lib/escobar/client.rb
190
192
  - lib/escobar/github.rb
193
+ - lib/escobar/heroku/app.rb
191
194
  - lib/escobar/heroku/client.rb
192
195
  - lib/escobar/heroku/coupling.rb
193
196
  - lib/escobar/heroku/pipeline.rb