Class: SmallCage::Commands::Auto
- Defined in:
- lib/smallcage/commands/auto.rb
Overview
‘smc auto’ command
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(opts) ⇒ Auto
constructor
A new instance of Auto.
Methods inherited from Base
Constructor Details
#initialize(opts) ⇒ Auto
Returns a new instance of Auto.
6 7 8 9 10 11 12 |
# File 'lib/smallcage/commands/auto.rb', line 6 def initialize(opts) super(opts) @target = Pathname.new(opts[:path]) @port = opts[:port] @sleep = 1 = {} end |
Instance Method Details
#execute ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/smallcage/commands/auto.rb', line 30 def execute start_http_server unless @port.nil? init_sig_handler @loader = SmallCage::Loader.new(@target) first_loop = true @update_loop = true while @update_loop if first_loop first_loop = false if @opts[:fast] update_modified_files else update_target end else update_modified_files end sleep @sleep end end |