escobar 0.3.12 → 0.3.13

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: d2dce68fdb0558f3ae3fd88c156fc299ee3aa03b
4
- data.tar.gz: 249ec79d552abb75c1618f67db62d16bbcea0c29
3
+ metadata.gz: e71745bfcd53e7c75a54b5694813bd011d29fe29
4
+ data.tar.gz: b2feb2071751806a09f9ca8b18919fc125e12b41
5
5
  SHA512:
6
- metadata.gz: 6f7458956bd760e9eaff0364c7e7c467f2358868cb15a2729f0053fb4a77e78ef85de534d7192762fb95b54931d235bbf9547133e7f614eb932a509ebb47cf79
7
- data.tar.gz: 9996c6ad38d516140cde86184b4a14224af8718f02e6da489a2944144956ec3f1e5e1f5d9686c32ab46644db47b097c33ad5af4ad5fdcad3f926ece3c6ec10fe
6
+ metadata.gz: 9810909eff6588fef615bcb68571aae1036ee4072804d14d86de26f8266d9dabe503f104bd3acc735f1e525d577b9c95f7e1f223a617190b8f4fdaec57242cfb
7
+ data.tar.gz: 4778ac1e78dae976db05cd1b5bc2cc79dfc4460297a0543d9cea14ef1b0b7052ff7fdef3b6b3d7c54f443a2b27c855192c3c18e79feb064af2d048c6eb3d20df
data/lib/escobar.rb CHANGED
@@ -56,7 +56,8 @@ require_relative "./escobar/heroku/app"
56
56
  require_relative "./escobar/heroku/build"
57
57
  require_relative "./escobar/heroku/build_request"
58
58
  require_relative "./escobar/heroku/client"
59
- require_relative "./escobar/heroku/coupling"
60
59
  require_relative "./escobar/heroku/dynos"
61
- require_relative "./escobar/heroku/pipeline"
62
60
  require_relative "./escobar/heroku/release"
61
+ require_relative "./escobar/heroku/coupling"
62
+ require_relative "./escobar/heroku/pipeline"
63
+ require_relative "./escobar/heroku/config_vars"
@@ -32,6 +32,10 @@ module Escobar
32
32
  @dynos ||= Escobar::Heroku::Dynos.new(client, id)
33
33
  end
34
34
 
35
+ def config_vars
36
+ @config_vars ||= Escobar::Heroku::ConfigVars.new(client, id)
37
+ end
38
+
35
39
  def dashboard_url
36
40
  "https://dashboard.heroku.com/apps/#{name}"
37
41
  end
@@ -0,0 +1,34 @@
1
+ module Escobar
2
+ module Heroku
3
+ # Class representing a heroku application's environment variables
4
+ class ConfigVars
5
+ attr_reader :client, :app_id
6
+ def initialize(client, app_id)
7
+ @app_id = app_id
8
+ @client = client
9
+ end
10
+
11
+ # Retrieve an environmental variable by name
12
+ def [](key)
13
+ values[key]
14
+ end
15
+
16
+ def values
17
+ @info ||= info
18
+ end
19
+
20
+ def info
21
+ if info_json["id"] == "two_factor" &&
22
+ info_json["message"].match(/second authentication factor/)
23
+ {}
24
+ else
25
+ info_json
26
+ end
27
+ end
28
+
29
+ def info_json
30
+ @info_json ||= client.heroku.get("/apps/#{app_id}/config-vars")
31
+ end
32
+ end
33
+ end
34
+ end
@@ -1,3 +1,3 @@
1
1
  module Escobar
2
- VERSION = "0.3.12".freeze
2
+ VERSION = "0.3.13".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: escobar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-09 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -194,6 +194,7 @@ files:
194
194
  - lib/escobar/heroku/build.rb
195
195
  - lib/escobar/heroku/build_request.rb
196
196
  - lib/escobar/heroku/client.rb
197
+ - lib/escobar/heroku/config_vars.rb
197
198
  - lib/escobar/heroku/coupling.rb
198
199
  - lib/escobar/heroku/dynos.rb
199
200
  - lib/escobar/heroku/pipeline.rb