Class: Pbind::Command::Serv

Inherits:
Pbind::Command show all
Defined in:
lib/pbind/command/serv.rb

Instance Method Summary collapse

Methods inherited from Pbind::Command

#initialize, options, report_error, #verify_project_exists

Constructor Details

This class inherits a constructor from Pbind::Command

Instance Method Details

#runObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/pbind/command/serv.rb', line 23

def run
  @src_name = 'PBLiveLoader'
  @api_name = 'PBLocalhost'
  @src_key = 'PBResourcesPath'
  @project_root = File.dirname(@project_path)
  @src_install_dir = File.absolute_path(File.join(@project_root, @src_name))
  @api_install_dir = File.absolute_path(File.join(@project_root, @api_name))
  @project = Xcodeproj::Project.open(@project_path)
  @changed = false

  listen_file_changes
  open_tcp_server

  trap("SIGINT") {
    @server.close
    @listener.stop
    exit
  }

  super
  # sleep
end

#validate!Object



19
20
21
# File 'lib/pbind/command/serv.rb', line 19

def validate!
  verify_project_exists
end