roda-component 0.0.6 → 0.0.7
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 +4 -4
- data/lib/roda/component.rb +3 -19
- data/lib/roda/component/version.rb +1 -1
- data/lib/roda/plugins/component.rb +10 -10
- 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: b2560ddb0c7245a3dffa1213a056835210210ce0
|
4
|
+
data.tar.gz: e0258445c18e2bd5d0751cea9131e224cef4f607
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea779987429e6497a73b8d59ba02a0f8105ce2fba1dbef3edd5f8f88ec7665941188431318d5ae4f6aac5d207f0b094a71e8932f994f5422b53f920effb79cb8
|
7
|
+
data.tar.gz: 97d25418936d3fbafab553a4c69ffe2bd86dc7417c6fb0f4e8fc4b5fa0734f044c431a732c0d96bd7249194c691ea55212b0fdb595bf1eded590cc30ad1aab86
|
data/lib/roda/component.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
+
require 'opal'
|
2
|
+
require 'opal-jquery'
|
3
|
+
|
1
4
|
unless RUBY_ENGINE == 'opal'
|
2
5
|
require 'tilt'
|
3
6
|
require 'awesome_print'
|
4
7
|
end
|
5
8
|
|
6
|
-
require 'opal'
|
7
|
-
require 'opal-jquery'
|
8
9
|
require "base64"
|
9
10
|
require 'roda/component/faye'
|
10
11
|
require 'roda/component/instance'
|
@@ -19,23 +20,6 @@ if RUBY_ENGINE == 'opal'
|
|
19
20
|
}
|
20
21
|
end
|
21
22
|
|
22
|
-
module Overrideable
|
23
|
-
def self.included(c)
|
24
|
-
c.instance_methods(false).each do |m|
|
25
|
-
m = m.to_sym
|
26
|
-
c.class_eval %Q{
|
27
|
-
alias #{m}_original #{m}
|
28
|
-
def #{m}(*args, &block)
|
29
|
-
puts "Foo"
|
30
|
-
result = #{m}_original(*args, &block)
|
31
|
-
puts "Bar"
|
32
|
-
result
|
33
|
-
end
|
34
|
-
}
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
23
|
class Roda
|
40
24
|
class Component
|
41
25
|
attr_accessor :scope
|
@@ -79,16 +79,14 @@ class Roda
|
|
79
79
|
comp_name = comp.class._name
|
80
80
|
|
81
81
|
js = <<-EOF
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
c.#{action}(JSON.parse(Base64.decode64('#{options}')))
|
91
|
-
end
|
82
|
+
unless $faye
|
83
|
+
$faye = Roda::Component::Faye.new(`document.location.origin` + '/faye')
|
84
|
+
end
|
85
|
+
|
86
|
+
unless $component_opts[:comp][:"#{comp_name}"]
|
87
|
+
c = $component_opts[:comp][:"#{comp_name}"] = #{comp.class}.new
|
88
|
+
c.cache = JSON.parse Base64.decode64('#{cache}')
|
89
|
+
c.#{action}(JSON.parse(Base64.decode64('#{options}')))
|
92
90
|
end
|
93
91
|
EOF
|
94
92
|
|
@@ -169,7 +167,9 @@ class Roda
|
|
169
167
|
Opal::Processor.source_map_enabled = false
|
170
168
|
env = Opal::Environment.new
|
171
169
|
# Append the gems path
|
170
|
+
env.append_path Dir.pwd
|
172
171
|
env.append_path Gem::Specification.find_by_name("roda-component").gem_dir + '/lib'
|
172
|
+
env.append_path Gem::Specification.find_by_name("scrivener-cj").gem_dir + '/lib'
|
173
173
|
js = env['roda/component'].to_s
|
174
174
|
# Append the path to the components folder
|
175
175
|
env.append_path scope.component_opts[:path]
|
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.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cj
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|