roda-component 0.1.45 → 0.1.46
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 +17 -1
- data/lib/roda/component/version.rb +1 -1
- data/lib/roda/plugins/component.rb +1 -3
- 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: a37accc2a509987a4cc84739978f698929bb74cc
|
4
|
+
data.tar.gz: 1c60476fc587fa408012bf6565c0b142f288a5d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 113ef63e5eb521f6a4bf282c6f721f506155e55aee3bcfa04e01864af1a135d7327808d70ae334426fa353cf70efd183bbe86843195b6b8c2a63bbf4a6530564
|
7
|
+
data.tar.gz: 82dae7f4f53186c30cc4e41a81daa1cf58455a95ebccb28aad09ea7e57ceb48cf5a4ca76d7f1cda70e7538e08daadf80ef71470aa73c749d950b7edea3f06725
|
data/lib/roda/component.rb
CHANGED
@@ -126,10 +126,25 @@ class Roda
|
|
126
126
|
class << self
|
127
127
|
attr_accessor :_name
|
128
128
|
|
129
|
+
def file_location
|
130
|
+
@_file_location
|
131
|
+
end
|
132
|
+
|
129
133
|
def new(*args, &block)
|
130
134
|
obj = self.allocate
|
131
135
|
obj.instance_variable_set :@_scope, args.shift
|
132
|
-
|
136
|
+
|
137
|
+
# don't send any args if none are wanted
|
138
|
+
if server?
|
139
|
+
if obj.method(:initialize).parameters.length > 0
|
140
|
+
obj.send :initialize, *args, &block
|
141
|
+
else
|
142
|
+
obj.send :initialize, &block
|
143
|
+
end
|
144
|
+
else
|
145
|
+
obj.send :initialize, *args, &block
|
146
|
+
end
|
147
|
+
|
133
148
|
obj._initialize
|
134
149
|
obj
|
135
150
|
end
|
@@ -218,6 +233,7 @@ class Roda
|
|
218
233
|
@_name = _name.to_s
|
219
234
|
|
220
235
|
if server?
|
236
|
+
@_file_location = caller.first.split(':').first
|
221
237
|
component_opts[:class_name][@_name] = self.to_s
|
222
238
|
end
|
223
239
|
end
|
@@ -91,9 +91,7 @@ class Roda
|
|
91
91
|
comp_name = comp.class._name
|
92
92
|
class_name = Base64.encode64 component_opts[:class_name].to_json
|
93
93
|
|
94
|
-
file_path = comp.class.
|
95
|
-
comp.class.instance_method(m).source_location.first
|
96
|
-
}.uniq.first.gsub("#{Dir.pwd}/#{component_opts[:path]}", '').gsub(/\.rb\Z/, '.js')
|
94
|
+
file_path = comp.class.file_location.gsub("#{Dir.pwd}/#{component_opts[:path]}", '').gsub(/\.rb\Z/, '.js')
|
97
95
|
|
98
96
|
js = <<-EOF
|
99
97
|
action = '#{action || 'false'}'
|
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.46
|
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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|