roda-component 0.1.42 → 0.1.43

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: 157e0338814cd82f0ce49eaa75810ca4781da116
4
- data.tar.gz: 8bc1c85b5d02b0cce611552f6eb46ffeb9634700
3
+ metadata.gz: 92de764f146e178968f17bebd9476cc8f7268278
4
+ data.tar.gz: 475b2bc9ef2c91d05393b79a9163e4a7ea4767eb
5
5
  SHA512:
6
- metadata.gz: d82750d6fe41bdccc366a8a72dbc240e3ec6f10a66a2d091aba4af75d706581df3f3abaad54e9dae993952d203e691055583ec900fcb3ff123ca2a0ceddc6ae1
7
- data.tar.gz: 82ecdd4090365b39b368a7c7daf40af0ad85b423267d2abb42fa259ebd2a2c7fa045ea3432d550d1b6319350228998ff62cbaf4badaace559a3296ecb81a78c9
6
+ metadata.gz: 719b51510a012f8849d60942062988c6939a925ca5b2e5a1a8a9f5a4338ae7ab5c5a06afab0531ae36bb59643b08bcc684d54e0aa41498aa2edfa498ba84b939
7
+ data.tar.gz: 1848090168526fd3a4824297f07670ee97a5edd4a3381424111d721e93911025a1fb4a5a7f29968dee90c189319fe730c60564113ecbc1d29c69843f39c7b81a
@@ -134,6 +134,10 @@ class Roda
134
134
  obj
135
135
  end
136
136
 
137
+ def comp_requires
138
+ (@_comp_requires ||= []).uniq
139
+ end
140
+
137
141
  if RUBY_ENGINE == 'ruby'
138
142
  def inherited(subclass)
139
143
  super
@@ -235,6 +239,12 @@ class Roda
235
239
  end
236
240
  end
237
241
 
242
+ def comp_require *names
243
+ @_comp_requires ||= []
244
+ names.each { |n| @_comp_requires << n}
245
+ @_comp_requires
246
+ end
247
+
238
248
  def HTML raw_html
239
249
  if raw_html[/\A<!DOCTYPE/] || raw_html[/\A<html/]
240
250
  Nokogiri::HTML(raw_html)
@@ -1,5 +1,5 @@
1
1
  class Roda
2
2
  class Component
3
- VERSION = "0.1.42"
3
+ VERSION = "0.1.43"
4
4
  end
5
5
  end
@@ -73,6 +73,12 @@ class Roda
73
73
  end
74
74
 
75
75
  def load_component_js comp, action = false, options = {}
76
+ if comp.is_a? Roda::Component
77
+ comp.class.comp_requires.each do |c|
78
+ load_component_js(load_component(c), false, js: true)
79
+ end
80
+ end
81
+
76
82
  # grab a copy of the cache
77
83
  cache = comp.class.cache.dup
78
84
  # remove html and dom cache as we don't need that for the client
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-component
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.42
4
+ version: 0.1.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - cj