web_components_rails 1.2.1 → 1.2.2

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: d7bdfbad4c6a74d2db71d9e442cfa5747861b495
4
- data.tar.gz: 3fa5d12c74fdfc04e40c44a24b26b63343ee752b
3
+ metadata.gz: e6af103fa4143fd99ba1eaee24c139aa2b8ec036
4
+ data.tar.gz: a20d26caf95e14e6c3576ed2765190db45775ed4
5
5
  SHA512:
6
- metadata.gz: b4bc22ffafe1d1c2900dfca9f0b40161a3f6506b939b362073da752363cd9a9fe9c80c69a115d87d670e5a209ad4532910bba4d248be4d1503cd2c3ef75ef178
7
- data.tar.gz: 25fe711be678ce15a9322731b132f01a8d30289bbefbbbb16f2f4a832a4c39ae34acfbde2146bea7fe96d61cdaf88e655508db8ca2bcd0946d1008ed0878624a
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
- check_errors_for(source, type: :html)
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 = lookup_asset_for_path(source, type: :html)
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
- def _html_import_tag(source, path_options = {})
27
- tag_options = {
28
- rel: 'import',
29
- href: path_to_asset(source, path_options.merge(extname: '.html', type: :html))
30
- }
31
- tag(:link, tag_options)
32
- end
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
@@ -1,3 +1,3 @@
1
1
  module WebComponentsRails
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
3
3
  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.1
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-04-07 00:00:00.000000000 Z
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: