Module: XRefreshServer

Defined in:
lib/xrefresh-server.rb,
lib/xrefresh-server/client.rb,
lib/xrefresh-server/server.rb,
lib/xrefresh-server/monitor.rb

Defined Under Namespace

Classes: Client, Monitor, Server

Constant Summary collapse

VERSION =
File.read(File.join(File.expand_path(File.dirname(__FILE__)), '..', 'VERSION'))
AGENT =
"OSX xrefresh-server"
CONFIG_FILE =
".xrefresh-server.yml"
XREFRESH_MESSAGE_SEPARATOR =
"---XREFRESH-MESSAGE---"

Class Method Summary collapse

Class Method Details

.die(s) ⇒ Object



24
25
26
27
# File 'lib/xrefresh-server.rb', line 24

def self.die(s)
    $stderr.puts s
    exit 1
end

.generate_config(path) ⇒ Object



29
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
55
56
57
58
59
# File 'lib/xrefresh-server.rb', line 29

def self.generate_config(path)
    puts "Generating config in #{path}"
    File.open(path, "w") do |file|
        file.puts "paths:\n  - \#{File.expand_path('~')} # by default watch user's home directory\n# - /you/may/add/here/some/other/path\n# - /you/may/add/here/some/another/path\n\n# you can various filters (ruby regexp pattern)\n# every file is split to dir and file part (for example /Users/mick/proj/coolapp and some_file.rb)\n#   both include filters must be satisfied\n#   both exclude filters must not be satisfied\n# empty value means \"apply no filtering\"\ndir_include:\ndir_exclude: ^\#{File.expand_path('~')}/Library|/\\\\.(svn|git|framework|app|pbproj|pbxproj|xcode(proj)?|bundle)/\nfile_include:\nfile_exclude: ^(CVS|SCCS|vssver.?.scc|\\\\.(cvsignore|git|svn|DS_Store)|_svn|Thumbs\\\\.db)$|~$|^(\\\\.(?!htaccess)[^/]*|\\\\.(tmproj|o|pyc)|svn-commit(\\\\.[2-9])?\\\\.tmp)$ # merged TextMate and Netbeans patterns\n\n# xpert settings\nhost: \#{GServer::DEFAULT_HOST}\nport: 41258 # known port for clients to connect \nmax_connections: 4 # max client connections\ndebug: false # run in debug mode?\naudit: false # audit server activity\ndefer_time: 0.5 # aggregation time for events\nsleep_time: 0.1 # don't hung cpu in main loop\n"\
# here specify list of paths to monitor
    end
end