goat 0.2.5 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/goat.rb +4 -4
  2. metadata +3 -3
data/lib/goat.rb CHANGED
@@ -671,9 +671,7 @@ module Goat
671
671
 
672
672
  if comp = Goat.rpc_handlers[c]
673
673
  if comp[rpc]
674
- resp = app.respond_with_hook("rpc_#{rpc}", req.params)
675
- resp[2] = resp[2].to_json
676
- return resp
674
+ return app.respond_with_hook("rpc_#{rpc}", req.params)
677
675
  end
678
676
  end
679
677
 
@@ -1080,7 +1078,9 @@ module Goat
1080
1078
  Goat.rpc_handlers[self.name.to_s] ||= {}
1081
1079
  Goat.rpc_handlers[self.name.to_s][name.to_s] = true
1082
1080
 
1083
- App.send(:define_method, "rpc_#{name}", blk)
1081
+ App.send(:define_method, "rpc_#{name}") do |params|
1082
+ blk.call(params).to_json
1083
+ end
1084
1084
  end
1085
1085
 
1086
1086
  def component_name_hierarchy(cls=self.class)
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: 29
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 5
10
- version: 0.2.5
9
+ - 7
10
+ version: 0.2.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Patrick Collison