web_components_rails 1.2.1 → 1.2.2
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/web_components_rails/asset_tag_helper.rb +21 -9
- data/lib/web_components_rails/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6af103fa4143fd99ba1eaee24c139aa2b8ec036
|
4
|
+
data.tar.gz: a20d26caf95e14e6c3576ed2765190db45775ed4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09a28812e9aa98e0556dd8e34439170096db97c8b05d39a639f4c23b524afc27c80ec21079c96318253de66521b06f5dfbb53268a62f199fce1d28f517a46212
|
7
|
+
data.tar.gz: ac7856cfd1f1a7d66837283183670dea6dd4231337b8b867b1b009b624321fa5114a82df456ca22b98583e7ad40567a6ed595474d2fcc2fff27a5265e1f2392d
|
@@ -6,10 +6,13 @@ module WebComponentsRails::AssetTagHelper
|
|
6
6
|
debug_mode = options['debug'] != false && request_debug_assets?
|
7
7
|
|
8
8
|
sources.map do |source|
|
9
|
-
|
9
|
+
# Optional; provided by better_errors
|
10
|
+
if respond_to?(:check_errors_for)
|
11
|
+
check_errors_for(source, type: :html)
|
12
|
+
end
|
10
13
|
# In debug mode, include each html asset separately (if we can find the asset)
|
11
14
|
if debug_mode
|
12
|
-
asset =
|
15
|
+
asset = lookup_html_debug_asset(source)
|
13
16
|
asset.to_a.map do |a|
|
14
17
|
_html_import_tag(path_to_asset(a.logical_path, path_options.merge(debug: true)))
|
15
18
|
end
|
@@ -23,11 +26,20 @@ module WebComponentsRails::AssetTagHelper
|
|
23
26
|
|
24
27
|
private
|
25
28
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
def _html_import_tag(source, path_options = {})
|
30
|
+
tag_options = {
|
31
|
+
rel: 'import',
|
32
|
+
href: path_to_asset(source, path_options.merge(extname: '.html', type: :html))
|
33
|
+
}
|
34
|
+
tag(:link, tag_options)
|
35
|
+
end
|
36
|
+
|
37
|
+
def lookup_html_debug_asset(path)
|
38
|
+
path = path_with_extname(path, type: :html)
|
39
|
+
|
40
|
+
resolve_asset do |resolver|
|
41
|
+
resolver.find_debug_asset path
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
33
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_components_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Botelho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogumbo
|
@@ -124,3 +124,4 @@ signing_key:
|
|
124
124
|
specification_version: 4
|
125
125
|
summary: Web components utils for rails
|
126
126
|
test_files: []
|
127
|
+
has_rdoc:
|