goat 0.3.25 → 0.3.27

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.
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'goat'
3
- s.version = '0.3.25'
3
+ s.version = '0.3.27'
4
4
  s.summary = 'Pre-release beta version of Goat'
5
5
  s.author = 'Patrick Collison'
6
6
  s.email = 'patrick@collison.ie'
@@ -1111,20 +1111,20 @@ module Goat
1111
1111
  def self.live_enabled?; @live_enabled; end
1112
1112
  def live_enabled?; self.class.live_enabled?; end
1113
1113
 
1114
- def self.rerender_and_update(spec)
1115
- cls = self.name
1116
-
1117
- Profile.request_start
1118
-
1119
- Profile.in(:render_and_update)
1120
- StateSrvClient.live_components(cls, spec).each do |skel|
1121
- Profile.in(:cls_rerender)
1122
- rerender(skel)
1123
- Profile.out(:cls_rerender)
1114
+ def self.rerender_and_update_inner(to_process)
1115
+ # send updates as we calculate them; don't wait to compute everything
1116
+ unless to_process.empty?
1117
+ rerender(to_process.shift)
1118
+ unless to_process.empty?
1119
+ EM.next_tick { rerender_and_update_inner(to_process) }
1120
+ end
1124
1121
  end
1125
- Profile.out(:render_and_update)
1122
+ end
1126
1123
 
1127
- Profile.request_end
1124
+ def self.rerender_and_update(spec)
1125
+ cls = self.name
1126
+ to_process = StateSrvClient.live_components(cls, spec)
1127
+ rerender_and_update_inner(to_process)
1128
1128
  end
1129
1129
 
1130
1130
  def self.rerender(skel)
@@ -299,7 +299,9 @@ Goat.RPC = Class.extend({
299
299
  data['id'] = this.component.id;
300
300
  data['rpc'] = this.name;
301
301
  data['pgid'] = Goat.page_id;
302
- data['args'] = JSON.stringify(this.args);
302
+
303
+ if(this.args)
304
+ data['args'] = JSON.stringify(this.args);
303
305
 
304
306
  if(this.rt) {
305
307
  var txn = Goat.RT.newTxn();
@@ -217,17 +217,25 @@ module Goat
217
217
  @attrs = new
218
218
  end
219
219
 
220
- def identity
220
+ def build_node
221
221
  [@tag, @attrs, @body]
222
222
  end
223
223
 
224
+ def a_tag
225
+ unless @attrs.include?(:href)
226
+ @attrs[:href] = 'javascript:void(0)'
227
+ end
228
+
229
+ build_node
230
+ end
231
+
224
232
  def dispatch
225
233
  meth = "#{@tag}_tag".to_sym
226
234
 
227
235
  if self.respond_to?(meth)
228
236
  self.send(meth)
229
237
  else
230
- identity
238
+ build_node
231
239
  end
232
240
  end
233
241
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 33
4
+ hash: 37
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 25
10
- version: 0.3.25
9
+ - 27
10
+ version: 0.3.27
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Collison
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-03 00:00:00 +00:00
18
+ date: 2011-01-04 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21