motion-pixate-observer 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
data/bin/pixate_server CHANGED
@@ -1,29 +1,4 @@
1
- #!/usr/local/bin/macruby
2
- framework "Cocoa"
3
- require "socket"
1
+ #!/usr/bin/ruby
4
2
 
5
- cssfile = ARGV[0] || ""
6
- unless File.exists?(cssfile)
7
- warn "USAGE : #{$0} css_file_path"
8
- exit
9
- end
10
-
11
- SERVER_PORT = 8000
12
- SERVER_NAME = "Pixate CSS Notifier"
13
-
14
- netservice = NSNetService.alloc.initWithDomain("", type: "_pixate._tcp", name: SERVER_NAME, port: SERVER_PORT)
15
- netservice.publish
16
-
17
- serv = TCPServer.open("", SERVER_PORT)
18
- fd = open(cssfile, "r")
19
- gcdq = Dispatch::Queue.new('pixate')
20
- mask = Dispatch::Source::VNODE_WRITE | Dispatch::Source::VNODE_EXTEND
21
-
22
- while true
23
- Thread.start(serv.accept) do |sock|
24
- source ||= Dispatch::Source.new(Dispatch::Source::VNODE, fd, mask, gcdq) do
25
- fd.rewind
26
- sock.write(fd.read)
27
- end
28
- end
29
- end
3
+ lib_dir_path = File.join(File.dirname(File.expand_path(__FILE__)), "../lib")
4
+ system "/usr/local/bin/macruby #{lib_dir_path}/motion-pixate-server.rb #{ARGV[0]}"
Binary file
@@ -0,0 +1,28 @@
1
+ framework "Cocoa"
2
+ require "socket"
3
+
4
+ cssfile = ARGV[0] || ""
5
+ unless File.exists?(cssfile)
6
+ warn "USAGE : #{$0} css_file_path"
7
+ exit
8
+ end
9
+
10
+ SERVER_PORT = 8000
11
+ SERVER_NAME = "Pixate CSS Notifier"
12
+
13
+ netservice = NSNetService.alloc.initWithDomain("", type: "_pixate._tcp", name: SERVER_NAME, port: SERVER_PORT)
14
+ netservice.publish
15
+
16
+ serv = TCPServer.open("", SERVER_PORT)
17
+ fd = open(cssfile, "r")
18
+ gcdq = Dispatch::Queue.new('pixate')
19
+ mask = Dispatch::Source::VNODE_WRITE | Dispatch::Source::VNODE_EXTEND
20
+
21
+ while true
22
+ Thread.start(serv.accept) do |sock|
23
+ source ||= Dispatch::Source.new(Dispatch::Source::VNODE, fd, mask, gcdq) do
24
+ fd.rewind
25
+ sock.write(fd.read)
26
+ end
27
+ end
28
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-pixate-observer
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -22,6 +22,7 @@ extra_rdoc_files: []
22
22
  files:
23
23
  - README.md
24
24
  - lib/motion-pixate-observer.rb
25
+ - lib/motion-pixate-server.rb
25
26
  - lib/project/pixate_style_watch.rb
26
27
  - lib/Socket/libSocket.a
27
28
  - lib/Socket/Socket-Prefix.pch