Class: Webpacker::Env

Inherits:
Object
  • Object
show all
Defined in:
lib/webpacker/env.rb

Constant Summary collapse

DEFAULT =
"production".freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(webpacker) ⇒ Env

Returns a new instance of Env.



10
11
12
# File 'lib/webpacker/env.rb', line 10

def initialize(webpacker)
  @webpacker = webpacker
end

Class Method Details

.inquire(webpacker) ⇒ Object



6
7
8
# File 'lib/webpacker/env.rb', line 6

def self.inquire(webpacker)
  new(webpacker).inquire
end

Instance Method Details

#inquireObject



14
15
16
17
# File 'lib/webpacker/env.rb', line 14

def inquire
  fallback_env_warning if config_path.exist? && !current
  current || DEFAULT.inquiry
end