Class: WashoutBuilder::EnvChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/washout_builder/env_checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ EnvChecker


7
8
9
# File 'lib/washout_builder/env_checker.rb', line 7

def initialize(app)
  self.app = app
end

Instance Attribute Details

#appObject

Returns the value of attribute app


4
5
6
# File 'lib/washout_builder/env_checker.rb', line 4

def app
  @app
end

Instance Method Details

#available_for_env?(env_name) ⇒ Boolean


11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/washout_builder/env_checker.rb', line 11

def available_for_env?(env_name)
  if (whitelist.present? || blacklist.present?)
    if whitelist.find{|a| blacklist.include?(a) }.blank?
      if whitelist.include?('*') || (!valid_for_env?(blacklist, env_name) && valid_for_env?(whitelist, env_name))
        return true
      end
    end
  else
    return true
  end
  return false
end