roda-component 0.1.47 → 0.1.48

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db967a5d53670bf26c1ac99c411d102b9fca65aa
4
- data.tar.gz: de3138f17fca28020fb597d56c5ec6f309096d38
3
+ metadata.gz: ad6c2b14f1d526e6b5f8853508477823396d086a
4
+ data.tar.gz: 43638f0a8d10315bcff452763f2521cf7806eb13
5
5
  SHA512:
6
- metadata.gz: 63552b4280b8e375c8aaff6b1b19e029dae92f550b4cdb0c59718eba1a92b648fc6061fa146d4af83add8171da394d9ca776ed142953e94c04c652f159b0c6b1
7
- data.tar.gz: 59b16710cff293192b61145ae2d158dd86a4d3cec4f2033e0c595534a4708b6da0ef178b00369bb4deaafcb94e168d3bbfd0c7b62ac17ce4dbe7aa2fb9bc971c
6
+ metadata.gz: 32b2ef520e19cc645682e4605764b3eaa533c0b79872bc9cccc9f3be99b11fca0b370d53b6a5cd2d43aa36d1bb2352329189cb79f201d0d197da1143ff8e1e32
7
+ data.tar.gz: 10cb7029004e83e18fd3ac5a58102a96d78ca0ffd422baaa2aca1540b7106495a54acff89dd9373f0b0b5eb60135d3c542660740b52df6b4050a35a495f8d869
@@ -1,5 +1,5 @@
1
1
  class Roda
2
2
  class Component
3
- VERSION = "0.1.47"
3
+ VERSION = "0.1.48"
4
4
  end
5
5
  end
@@ -170,11 +170,15 @@ class Roda
170
170
  m.public_instance_methods(false).each do |meth|
171
171
  alias_method :"original_#{meth}", :"#{meth}"
172
172
  define_method "#{meth}" do |*args, &blk|
173
- if blk
174
- blk.call send("original_#{meth}", *args)
173
+ o_name = "original_#{meth}"
174
+
175
+ if method(o_name).parameters.length > 0
176
+ result = send(o_name, *args, &block)
175
177
  else
176
- send("original_#{meth}", *args)
178
+ result = send(o_name, &block)
177
179
  end
180
+
181
+ blk ? blk.call(result) : result
178
182
  end
179
183
  end
180
184
  else
@@ -239,7 +243,7 @@ class Roda
239
243
  end
240
244
 
241
245
  # The html source
242
- def comp_html _html, &block
246
+ def comp_html _html = false, &block
243
247
  if server?
244
248
  if _html.is_a? String
245
249
  if _html[%r{\A./}]
@@ -178,7 +178,7 @@ class Roda
178
178
  load_component_js comp, action, options
179
179
 
180
180
  if js && comp_response.is_a?(Roda::Component::DOM)
181
- comp_response = comp_response.to_xml
181
+ comp_response = comp_response.to_html
182
182
  end
183
183
 
184
184
  if comp_response.is_a?(String) && js
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.1.47
4
+ version: 0.1.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-25 00:00:00.000000000 Z
11
+ date: 2015-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opal