goat 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ class HTMLString < String; end
2
+
3
+ def h!(str)
4
+ HTMLString.new(str)
5
+ end
6
+
7
+ class String
8
+ def h!
9
+ HTMLString.new(self)
10
+ end
11
+ end
data/lib/goat/yodel.rb ADDED
@@ -0,0 +1,38 @@
1
+ require 'rubygems'
2
+ require 'rubygems'
3
+ require 'eventmachine'
4
+
5
+ $verbose = ARGV.include?('-v')
6
+
7
+ module Yodel
8
+ NotifChannel = EM::Channel.new
9
+
10
+ class BroadcastServer < EM::Connection
11
+ def self.start(host='127.0.0.1', port=8000)
12
+ EM.start_server(host, port, self)
13
+ end
14
+
15
+ def post_init
16
+ @sub = NotifChannel.subscribe do |msg|
17
+ send_data(msg + "\n")
18
+ end
19
+ end
20
+
21
+ def unbind
22
+ NotifChannel.unsubscribe(@sub)
23
+ end
24
+ end
25
+
26
+ class RecvServer < EM::Connection
27
+ include EM::P::LineText2
28
+
29
+ def self.start(host='127.0.0.1', port=8001)
30
+ EM.start_server(host, port, self)
31
+ end
32
+
33
+ def receive_line(line)
34
+ $stdout.puts "got #{line}" if $verbose
35
+ NotifChannel << line
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,7 @@
1
+ <html><head>
2
+ <title><%= page.canvas.title %></title>
3
+ <script src="/jq.js"></script><% if page.class.live_updates_enabled? %><script>Goat.page_id = '<%= page.id %>'</script><% end %>
4
+ </head>
5
+ <body>
6
+ <%= yield %>
7
+ </body></html>
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: goat
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 3
10
+ version: 0.1.3
11
+ platform: ruby
12
+ authors:
13
+ - Patrick Collison
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-08-30 00:00:00 +00:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: Sinatra live
23
+ email: patrick@collison.ie
24
+ executables:
25
+ - yodel
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - bin/yodel
32
+ - lib/goat/extn.rb
33
+ - lib/goat/goat.js
34
+ - lib/goat.rb
35
+ - lib/goat/html.rb
36
+ - lib/goat/logger.rb
37
+ - lib/goat/mongo.rb
38
+ - lib/goat/notifications.rb
39
+ - lib/goat/sinatra.rb
40
+ - lib/goat/yodel.rb
41
+ - lib/views/plain_layout.erb
42
+ has_rdoc: true
43
+ homepage: http://goatweb.org
44
+ licenses: []
45
+
46
+ post_install_message:
47
+ rdoc_options: []
48
+
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ requirements: []
70
+
71
+ rubyforge_project: goat
72
+ rubygems_version: 1.3.7
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: Pre-release beta version of Goat
76
+ test_files: []
77
+