motion-pixate-observer 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 345775a342b359d5452ca1604284dada5f9fe7ac
4
- data.tar.gz: 26df0b82705e1404b7bce02f00a867fbda74d712
3
+ metadata.gz: b4bdbb11ad0d60ca618831d43a490ac0250e60a5
4
+ data.tar.gz: 645e0a851841cbb32a0cee2d384d4af18270115a
5
5
  SHA512:
6
- metadata.gz: c20899e889768b524853c059b04f350c3646aa64f40a708eb81c008d2da84b6cdfabc43d498dfe5e0bc563333b6a19c9003176dac1850ebec168c13a54f2b47f
7
- data.tar.gz: 0945e4a885d93060a335477144124e6b98580e506bf4de309cd2f62d05b2b215c453dec05cd64dc9eddc5129e84f3ebb10823227949b9ac740f02dd444b91afd
6
+ metadata.gz: eb6cecfa145265ba57ea8e96ab646c283591c84840db39f37c28026a23bb8752d632b72d4b9aa81a49b5ab37de5335beb6158e53f5118499bef50ddc425f8971
7
+ data.tar.gz: d514a83d85791f641b7c4b4b2cbbf90d26929ca1c6ffb1cee0a7947b993ea12a43a7681c80038f85c8fa7a46c8fabf34bdf3bbc27104c29f21ef16ecc8cebeca
@@ -1,4 +1,31 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
+ require "socket"
3
+ require "rubygems"
4
+ require "dnssd"
5
+ require "fssm"
2
6
 
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]}"
7
+ SERVER_PORT = 54321
8
+ SERVER_NAME = "Pixate CSS Notifier"
9
+
10
+ cssfile = ARGV[0] || ""
11
+ cssfile = File.expand_path(cssfile)
12
+ unless File.exists?(cssfile)
13
+ warn "USAGE : #{$0} css_file_path"
14
+ exit
15
+ end
16
+
17
+ serv = TCPServer.open("", SERVER_PORT)
18
+ DNSSD.announce(serv, SERVER_NAME, "pixate-observer",)
19
+
20
+ $sock = serv.accept
21
+ puts "Connected"
22
+
23
+ FSSM.monitor(File.dirname(cssfile), File.basename(cssfile)) do
24
+ update do |basedir, filename|
25
+ File.open("#{basedir}/#{filename}") { |f|
26
+ data = f.read
27
+ $sock.write(data)
28
+ puts "SENT : #{data.bytesize} bytes"
29
+ }
30
+ end
31
+ end
Binary file
@@ -24,6 +24,7 @@ module Motion; module Pixate; module Observer
24
24
  end
25
25
 
26
26
  def socketDidReceive(string)
27
+ NSLog(string)
27
28
  style(string)
28
29
  end
29
30
  end; end; end
metadata CHANGED
@@ -1,15 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-pixate-observer
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-26 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2013-07-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dnssd
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: fssm
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
13
41
  description: This gem provides a function that you changes css files, apply changes
14
42
  into your application that uses Pixate Framework immediately.
15
43
  email:
@@ -21,7 +49,6 @@ extra_rdoc_files: []
21
49
  files:
22
50
  - README.md
23
51
  - lib/motion-pixate-observer.rb
24
- - lib/motion-pixate-server.rb
25
52
  - lib/project/pixate_style_watch.rb
26
53
  - lib/Socket/libSocket.a
27
54
  - lib/Socket/Socket-Prefix.pch
@@ -46,9 +73,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
73
  version: '0'
47
74
  requirements: []
48
75
  rubyforge_project:
49
- rubygems_version: 2.0.2
76
+ rubygems_version: 2.0.3
50
77
  signing_key:
51
78
  specification_version: 4
52
79
  summary: This gem provides a function that you changes css files, apply changes into
53
80
  your application that uses Pixate Framework immediately.
54
81
  test_files: []
82
+ has_rdoc:
@@ -1,35 +0,0 @@
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 = 54321
11
- SERVER_NAME = "Pixate CSS Notifier"
12
-
13
- netservice = NSNetService.alloc.initWithDomain("", type: "_pixate-observer._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
- conn = serv.accept
23
- NSLog "Connected : #{conn.addr[2]}"
24
-
25
- @sock.close if @sock
26
- @sock = conn
27
-
28
- Dispatch::Source.new(Dispatch::Source::VNODE, fd, mask, gcdq) do
29
- begin
30
- fd.rewind
31
- @sock.write(fd.read)
32
- rescue
33
- end
34
- end
35
- end