roda-component 0.0.9 → 0.0.10

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: 0d5343e546dd1c9d54ae9bbaa2e2fdae49e061ad
4
- data.tar.gz: 851248b2131d64a76746bcd2cb2a4b7fc741902c
3
+ metadata.gz: 593646329d5c319bc13063df03ac54d68dad4ea9
4
+ data.tar.gz: a10c68c8fa64cb522d3d4305c548a158101f2271
5
5
  SHA512:
6
- metadata.gz: 9f08bdb58ba232e07185fd7f9b0f4c71962fef1ffd5150ac17c11cbd66128af1c32b412e3467ee4bfc6eeccfb305ef335019ea284ac691f3d5c357a24aa91342
7
- data.tar.gz: 9e6412426f15d27686daf9d66923bada27742c1103128b427dcaee40936dbfd4954b789014cdfd1ae6dc2a86772185cc6fa0d5ba025c4fa893832253a150680f
6
+ metadata.gz: d6b11c2f8010465b3b51fb37c074ae64fb5d2d1237f28b7d070620d82b0268830ca815c829a34dc70bfe1b7ef740ca2a7c688dd65e9f95df69b68509e51181bb
7
+ data.tar.gz: 891ac724dd26eea83b5e30295f008e56c554bc9138346ec6f11b6aa3a83b114bd447157c41a4017698aca49859a73d10dbfa56b64f1adb1adcc17f008366ee1a
@@ -156,7 +156,7 @@ class Roda
156
156
  end
157
157
 
158
158
  def method_missing method, *args, &block
159
- if server && app.respond_to?(method, true)
159
+ if server? && app.respond_to?(method, true)
160
160
  app.send method, *args, &block
161
161
  else
162
162
  super
@@ -219,7 +219,7 @@ class Roda
219
219
  end
220
220
 
221
221
  def method_missing method, *args, &block
222
- if server && scope.respond_to?(method, true)
222
+ if server? && scope.respond_to?(method, true)
223
223
  scope.send method, *args, &block
224
224
  else
225
225
  super
@@ -1,5 +1,5 @@
1
1
  class Roda
2
2
  class Component
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
@@ -104,14 +104,20 @@ class Roda
104
104
  if trigger
105
105
  comp_response = comp.trigger trigger, options
106
106
  else
107
- if comp.method(action).parameters.length > 0
108
- comp_response = comp.send(action, options, &block)
107
+ # We want to make sure it's not a method that already exists in ruba
108
+ # otherwise that would give us a false positive.
109
+ if comp.respond_to?(action) && !"#{comp.method(action)}"[/\(Kernel\)/]
110
+ if comp.method(action).parameters.length > 0
111
+ comp_response = comp.send(action, options, &block)
112
+ else
113
+ comp_response = comp.send(action, &block)
114
+ end
109
115
  else
110
- comp_response = comp.send(action, &block)
116
+ fail "##{action} doesn't exist for #{comp.class}"
111
117
  end
112
118
  end
113
119
 
114
- if defined?(env) && !env['RODA_COMPONENT_FROM_FAYE']
120
+ if req && !req.env['RODA_COMPONENT_FROM_FAYE']
115
121
  if comp_response.is_a? Roda::Component::DOM
116
122
  content = comp_response.to_html
117
123
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal