Class: Shakapacker::Runner
- Inherits:
-
Object
- Object
- Shakapacker::Runner
show all
- Defined in:
- lib/shakapacker/runner.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(argv) ⇒ Runner
Returns a new instance of Runner.
14
15
16
17
18
19
20
21
22
|
# File 'lib/shakapacker/runner.rb', line 14
def initialize(argv)
@argv = argv
@app_path = File.expand_path(".", Dir.pwd)
@shakapacker_config = ENV["SHAKAPACKER_CONFIG"] || File.join(@app_path, "config/shakapacker.yml")
@webpack_config = find_webpack_config
Shakapacker::Utils::Manager.error_unless_package_manager_is_obvious!
end
|
Class Method Details
.run(argv) ⇒ Object
8
9
10
11
12
|
# File 'lib/shakapacker/runner.rb', line 8
def self.run(argv)
$stdout.sync = true
ENV["NODE_ENV"] ||= (ENV["RAILS_ENV"] == "production") ? "production" : "development"
new(argv).run
end
|
Instance Method Details
#package_json ⇒ Object
24
25
26
|
# File 'lib/shakapacker/runner.rb', line 24
def package_json
@package_json ||= PackageJson.read(@app_path)
end
|