lib/webpack_rails/task.rb in webpack_rails-1.2.2 vs lib/webpack_rails/task.rb in webpack_rails-1.3.0
- old
+ new
@@ -7,12 +7,10 @@
# wraps NodeTask::Error
class Error < StandardError
def initialize(node_task_error)
super(node_task_error.to_s)
- # TODO: expose @js_error from NodeTask::Error
- js_error = node_task_error.instance_variable_get(:@js_error)
set_backtrace(js_error[:stack].split('\n')) if js_error
end
end
class << self
@@ -59,29 +57,9 @@
Dir.chdir(root_dir) do
return_value = yield
end
ENV['NODE_PATH'] = prev_node_path
return_value
- end
-
- # TODO: move to NodeTask
- def alive?
- current_pid = nil
- alive = false
- if @controller
- begin
- current_pid = @controller.pid
- rescue Errno::ENOENT
- end
- end
- if current_pid
- begin
- Process.getpgid(current_pid)
- alive = true
- rescue Errno::ESRCH
- end
- end
- alive
end
def build_once(webpack_task_config)
WebpackRails::Task.with_app_node_path do
webpack_cmd_script = `#{WebpackRails::Task.node_command} -e "process.stdout.write(require.resolve('webpack/bin/webpack.js'))"`