Module: Escobar

Defined in:
lib/escobar.rb,
lib/escobar/client.rb,
lib/escobar/version.rb,
lib/escobar/heroku/app.rb,
lib/escobar/heroku/slug.rb,
lib/escobar/heroku/user.rb,
lib/escobar/heroku/build.rb,
lib/escobar/heroku/dynos.rb,
lib/escobar/github/client.rb,
lib/escobar/heroku/client.rb,
lib/escobar/heroku/release.rb,
lib/escobar/heroku/coupling.rb,
lib/escobar/heroku/pipeline.rb,
lib/escobar/heroku/config_vars.rb,
lib/escobar/heroku/build_request.rb,
lib/escobar/github/deployment_error.rb,
lib/escobar/heroku/pipeline_promotion.rb,
lib/escobar/github/response/raise_error.rb,
lib/escobar/heroku/pipeline_promotion_request.rb,
lib/escobar/heroku/pipeline_promotion_targets.rb

Overview

Top-level module for Escobar code

Defined Under Namespace

Modules: GitHub, Heroku Classes: Client

Constant Summary collapse

UUID_REGEX =
/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/
VERSION =
"0.4.17".freeze

Class Method Summary collapse

Class Method Details

.env_netrcObject



20
21
22
23
24
25
26
27
28
# File 'lib/escobar.rb', line 20

def self.env_netrc
  @env_netrc ||= begin
                   if ENV["NETRC"]
                     Netrc.read("#{ENV['NETRC']}/.netrc")
                   end
                 rescue Errno::ENOTDIR
                   nil
                 end
end

.github_api_tokenObject



44
45
46
# File 'lib/escobar.rb', line 44

def self.github_api_token
  netrc["api.github.com"]["password"]
end

.heroku_api_tokenObject



40
41
42
# File 'lib/escobar.rb', line 40

def self.heroku_api_token
  netrc["api.heroku.com"]["password"]
end

.home_netrcObject



30
31
32
33
34
35
36
37
38
# File 'lib/escobar.rb', line 30

def self.home_netrc
  @home_netrc ||= begin
                    if ENV["HOME"]
                      Netrc.read("#{ENV['HOME']}/.netrc")
                    end
                  rescue Errno::ENOTDIR
                    nil
                  end
end

.http_open_timeoutObject



52
53
54
55
56
57
58
# File 'lib/escobar.rb', line 52

def self.http_open_timeout
  if http_open_timeout_from_environment
    http_open_timeout_from_environment.to_i
  else
    3
  end
end

.http_open_timeout_from_environmentObject



68
69
70
# File 'lib/escobar.rb', line 68

def self.http_open_timeout_from_environment
  ENV["ESCOBAR_HTTP_OPEN_TIMEOUT"]
end

.http_timeoutObject



60
61
62
63
64
65
66
# File 'lib/escobar.rb', line 60

def self.http_timeout
  if http_timeout_from_environment
    http_timeout_from_environment.to_i
  else
    6
  end
end

.http_timeout_from_environmentObject



72
73
74
# File 'lib/escobar.rb', line 72

def self.http_timeout_from_environment
  ENV["ESCOBAR_HTTP_TIMEOUT"]
end

.netrcObject



10
11
12
13
14
15
16
17
18
# File 'lib/escobar.rb', line 10

def self.netrc
  @netrc ||= begin
               if env_netrc
                 env_netrc
               else
                 home_netrc
               end
             end
end

.zipkin_enabled?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/escobar.rb', line 48

def self.zipkin_enabled?
  !ENV["ZIPKIN_SERVICE_NAME"].nil? && !ENV["ZIPKIN_API_HOST"].nil?
end