silian-rail 0.1.0 → 0.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c111b502a1503228a57b19b429945ee20094d057
4
- data.tar.gz: f3306d95bc03b98ad44b21d18bb87d0984ef62fc
3
+ metadata.gz: 71a41365b1ab41d40657274527d108ce970a6ffe
4
+ data.tar.gz: 3f633bde81a202edc8fdbe0685c6cc773f3a1bb7
5
5
  SHA512:
6
- metadata.gz: d1c1f820f779d2ed91910bd66bc1cf18b02b0009a306f49aed74bae3876ddf316e6754d36287f593ae1e5bddad8ac2c8c0d26d26bf0648a4ba11863c5c646a83
7
- data.tar.gz: 9af698941183a93b38738ef9a108e93b53844bf5e8899728e140dd7b6fc2a488a7287d6f6a4a4ee44e8852a81e0f56bb1dfe54fb0c81452409c89bf2a16fffb0
6
+ metadata.gz: d3ee34b914bacd528c9091bce2d01dfd47418db561db5676a6af0529a4c27eeff8e6c7f44083d3bacce7385333614b79e6714946ac78ffe1d8c7f9a8e489168b
7
+ data.tar.gz: af4a6e0d35dd564ef86851153f3c1f6982af2c0fdefec33b3b5b4c6872a819ab5465c7dcde825c29ab358e2e2c852c55311cb99c8c362820da2ba899d0a2c697
@@ -23,7 +23,7 @@ module ActionView
23
23
  sources.map { |source|
24
24
  options = options.merge('integrity' => asset_integrity(source, type: :html)) if integrity
25
25
  construct_html_include_tag source, options
26
- }.join('\n').html_safe
26
+ }.join("\n").html_safe
27
27
  end
28
28
  end
29
29
 
@@ -7,11 +7,6 @@ module SilianRail
7
7
  comments: [['<!--', '-->']]
8
8
  )
9
9
 
10
- require 'silian-rail/post_processor'
11
- env.register_postprocessor 'text/html', :web_components do |context, data|
12
- SilianRail::PostProcessor.new(context).call(data)
13
- end
14
-
15
10
  require 'sprockets/bundle'
16
11
  env.register_bundle_processor 'text/html', Sprockets::Bundle
17
12
 
@@ -1,3 +1,3 @@
1
1
  module SilianRail
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silian-rail
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Robins
@@ -24,20 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.2'
27
- - !ruby/object:Gem::Dependency
28
- name: loofah
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '2.0'
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '2.0'
41
27
  description:
42
28
  email: brandon.robins@onebnottwo.com
43
29
  executables: []
@@ -50,7 +36,6 @@ files:
50
36
  - lib/generators/silian_rail/templates/component_manifest.html
51
37
  - lib/silian-rail.rb
52
38
  - lib/silian-rail/asset_helpers.rb
53
- - lib/silian-rail/post_processor.rb
54
39
  - lib/silian-rail/railtie.rb
55
40
  - lib/silian-rail/version.rb
56
41
  homepage: http://www.github.com/eanlain/silian-rail
@@ -1,40 +0,0 @@
1
- module SilianRail
2
- class PostProcessor
3
- COMMENT_PATTERN = Regexp.new("<!---->|<!--[^\\[].*?-->", Regexp::MULTILINE | Regexp::IGNORECASE)
4
-
5
- def initialize(context)
6
- @context = context
7
- @current_directory = File.dirname(context.pathname)
8
- @import_assets = []
9
-
10
- @remove_link_imports = Loofah::Scrubber.new do |node|
11
- if (node.name == 'link') && (node['rel'] == 'import')
12
- @import_assets.push get_asset_abs_path(node['href'])
13
-
14
- node.remove
15
- end
16
- end
17
- end
18
-
19
- def call(data)
20
- data = scrub_link_imports(data)
21
- require_import_assets
22
-
23
- data.to_s.gsub(COMMENT_PATTERN, '')
24
- end
25
-
26
- private
27
-
28
- def get_asset_abs_path(relative_path)
29
- File.absolute_path(relative_path, @current_directory)
30
- end
31
-
32
- def require_import_assets
33
- @import_assets.each { |asset| @context.require_asset(asset) }
34
- end
35
-
36
- def scrub_link_imports(data)
37
- Loofah.scrub_fragment(data, @remove_link_imports)
38
- end
39
- end
40
- end