Class: Guard::Webpack::Runner
- Inherits:
-
Object
- Object
- Guard::Webpack::Runner
- Defined in:
- lib/guard/webpack/runner.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#thread ⇒ Object
Returns the value of attribute thread.
Instance Method Summary collapse
-
#initialize(options) ⇒ Runner
constructor
A new instance of Runner.
- #restart ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(options) ⇒ Runner
Returns a new instance of Runner.
4 5 6 |
# File 'lib/guard/webpack/runner.rb', line 4 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
2 3 4 |
# File 'lib/guard/webpack/runner.rb', line 2 def @options end |
#thread ⇒ Object
Returns the value of attribute thread.
2 3 4 |
# File 'lib/guard/webpack/runner.rb', line 2 def thread @thread end |
Instance Method Details
#restart ⇒ Object
8 |
# File 'lib/guard/webpack/runner.rb', line 8 def restart; stop; start; end |
#start ⇒ Object
10 11 12 13 14 15 |
# File 'lib/guard/webpack/runner.rb', line 10 def start unless_running do @thread = Thread.new { run_webpack } ::Guard::UI.info "Webpack watcher started." end end |
#stop ⇒ Object
17 18 19 20 21 22 |
# File 'lib/guard/webpack/runner.rb', line 17 def stop if_running do @thread.kill ::Guard::UI.info "Webpack watcher stopped." end end |