roda-component 0.1.32 → 0.1.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/roda/component/version.rb +1 -1
- data/lib/roda/component.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fcaa4c0679c09e6a9069c746125953d2b99ff0a
|
4
|
+
data.tar.gz: 371d39e0be53e7a81630ab70da3c4b2729c65218
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00b04cc7fb8befcc3d4539bac1659301df76124f18f4ee4a87f9bc164bd103769016e27fc3fea1b528d6f5a53035cfd16e205c09457cf0d5853d7dabad415822
|
7
|
+
data.tar.gz: db05cde6ce3cf267299e9ae88a3dc342b607a86f350302bb706120518ce251171089e383d281c698b4a616dd847089298dbd2407450b09977fab7ccc8ae4a003
|
data/lib/roda/component.rb
CHANGED
@@ -368,6 +368,24 @@ class Roda
|
|
368
368
|
events.trigger(*args)
|
369
369
|
end
|
370
370
|
|
371
|
+
def function *args, &block
|
372
|
+
args.any? && raise(ArgumentError, '`function` does not accept arguments')
|
373
|
+
block || raise(ArgumentError, 'block required')
|
374
|
+
proc do |*a|
|
375
|
+
a.map! {|x| Native(`x`)}
|
376
|
+
@this = Native(`this`)
|
377
|
+
%x{
|
378
|
+
var bs = block.$$s,
|
379
|
+
result;
|
380
|
+
block.$$s = null;
|
381
|
+
result = block.apply(self, a);
|
382
|
+
block.$$s = bs;
|
383
|
+
|
384
|
+
return result;
|
385
|
+
}
|
386
|
+
end
|
387
|
+
end
|
388
|
+
|
371
389
|
def method_missing method, *args, &block
|
372
390
|
if server? && scope.respond_to?(method, true)
|
373
391
|
scope.send method, *args, &block
|
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.
|
4
|
+
version: 0.1.33
|
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-
|
11
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|