Class: Base

Inherits:
Object
  • Object
show all
Defined in:
lib/pry-byetypo/base.rb,
lib/pry-byetypo/setup/checks/base.rb

Class Method Summary collapse

Class Method Details

.callObject



5
6
7
# File 'lib/pry-byetypo/base.rb', line 5

def call(...)
  new(...).call
end

.check(database_config, logger) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/pry-byetypo/setup/checks/base.rb', line 7

def check(database_config, logger)
  URI.parse(database_config[name])
rescue URI::InvalidURIError
  # Try to connect using the ENV variables.
  if ENV[variable]
    database_config[name] = ENV[variable]
  else
    logger.warn(missing_variable_msg)
  end
end