inline_svg 0.11.0 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/integration_test.yml +58 -0
- data/.github/workflows/ruby.yml +20 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +421 -0
- data/CHANGELOG.md +144 -2
- data/README.md +148 -34
- data/Rakefile +7 -0
- data/inline_svg.gemspec +4 -4
- data/lib/inline_svg.rb +41 -9
- data/lib/inline_svg/action_view/helpers.rb +72 -7
- data/lib/inline_svg/cached_asset_file.rb +71 -0
- data/lib/inline_svg/finds_asset_paths.rb +1 -1
- data/lib/inline_svg/id_generator.rb +12 -3
- data/lib/inline_svg/io_resource.rb +4 -3
- data/lib/inline_svg/railtie.rb +8 -3
- data/lib/inline_svg/static_asset_finder.rb +4 -2
- data/lib/inline_svg/transform_pipeline.rb +0 -1
- data/lib/inline_svg/transform_pipeline/transformations.rb +8 -1
- data/lib/inline_svg/transform_pipeline/transformations/aria_attributes.rb +17 -20
- data/lib/inline_svg/transform_pipeline/transformations/aria_hidden.rb +9 -0
- data/lib/inline_svg/transform_pipeline/transformations/aria_hidden_attribute.rb +9 -0
- data/lib/inline_svg/transform_pipeline/transformations/class_attribute.rb +5 -6
- data/lib/inline_svg/transform_pipeline/transformations/data_attributes.rb +10 -5
- data/lib/inline_svg/transform_pipeline/transformations/description.rb +7 -6
- data/lib/inline_svg/transform_pipeline/transformations/height.rb +3 -4
- data/lib/inline_svg/transform_pipeline/transformations/id_attribute.rb +3 -4
- data/lib/inline_svg/transform_pipeline/transformations/no_comment.rb +5 -2
- data/lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb +3 -4
- data/lib/inline_svg/transform_pipeline/transformations/size.rb +4 -5
- data/lib/inline_svg/transform_pipeline/transformations/style_attribute.rb +11 -0
- data/lib/inline_svg/transform_pipeline/transformations/title.rb +7 -6
- data/lib/inline_svg/transform_pipeline/transformations/transformation.rb +13 -0
- data/lib/inline_svg/transform_pipeline/transformations/width.rb +3 -4
- data/lib/inline_svg/version.rb +1 -1
- data/lib/inline_svg/webpack_asset_finder.rb +50 -0
- data/spec/cached_asset_file_spec.rb +73 -0
- data/spec/files/static_assets/assets0/known-document-two.svg +1 -0
- data/spec/files/static_assets/assets0/known-document.svg +1 -0
- data/spec/files/static_assets/assets0/some-document.svg +1 -0
- data/spec/files/static_assets/assets1/known-document.svg +1 -0
- data/spec/files/static_assets/assets1/other-document.svg +3 -0
- data/spec/files/static_assets/assets1/some-file.txt +1 -0
- data/spec/helpers/inline_svg_spec.rb +104 -21
- data/spec/id_generator_spec.rb +5 -3
- data/spec/inline_svg_spec.rb +48 -0
- data/spec/transformation_pipeline/transformations/aria_attributes_spec.rb +16 -16
- data/spec/transformation_pipeline/transformations/aria_hidden_attribute_spec.rb +12 -0
- data/spec/transformation_pipeline/transformations/data_attributes_spec.rb +18 -0
- data/spec/transformation_pipeline/transformations/height_spec.rb +9 -0
- data/spec/transformation_pipeline/transformations/style_attribute_spec.rb +26 -0
- data/spec/transformation_pipeline/transformations/title_spec.rb +9 -0
- data/spec/transformation_pipeline/transformations/transformation_spec.rb +39 -0
- data/spec/transformation_pipeline/transformations_spec.rb +5 -1
- metadata +49 -22
- data/circle.yml +0 -3
data/spec/id_generator_spec.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
require_relative '../lib/inline_svg/id_generator'
|
2
2
|
|
3
3
|
describe InlineSvg::IdGenerator do
|
4
|
-
it "generates a hexencoded ID based on a salt" do
|
5
|
-
|
6
|
-
|
4
|
+
it "generates a hexencoded ID based on a salt and a random value" do
|
5
|
+
randomizer = -> { "some-random-value" }
|
6
|
+
|
7
|
+
expect(InlineSvg::IdGenerator.generate("some-base", "some-salt", randomness: randomizer)).
|
8
|
+
to eq("at2c17mkqnvopy36iccxspura7wnreqf")
|
7
9
|
end
|
8
10
|
end
|
data/spec/inline_svg_spec.rb
CHANGED
@@ -13,6 +13,10 @@ class MyInvalidCustomTransformInstance
|
|
13
13
|
def self.create_with_value(value); end
|
14
14
|
end
|
15
15
|
|
16
|
+
class MyCustomAssetFile
|
17
|
+
def self.named(filename); end
|
18
|
+
end
|
19
|
+
|
16
20
|
describe InlineSvg do
|
17
21
|
describe "configuration" do
|
18
22
|
context "when a block is not given" do
|
@@ -42,6 +46,50 @@ describe InlineSvg do
|
|
42
46
|
end
|
43
47
|
end
|
44
48
|
|
49
|
+
context "configuring a custom asset file" do
|
50
|
+
it "falls back to the built-in asset file implementation by deafult" do
|
51
|
+
expect(InlineSvg.configuration.asset_file).to eq(InlineSvg::AssetFile)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "adds a collaborator that meets the interface specification" do
|
55
|
+
InlineSvg.configure do |config|
|
56
|
+
config.asset_file = MyCustomAssetFile
|
57
|
+
end
|
58
|
+
|
59
|
+
expect(InlineSvg.configuration.asset_file).to eq MyCustomAssetFile
|
60
|
+
end
|
61
|
+
|
62
|
+
it "rejects a collaborator that does not conform to the interface spec" do
|
63
|
+
bad_asset_file = double("bad_asset_file")
|
64
|
+
|
65
|
+
expect do
|
66
|
+
InlineSvg.configure do |config|
|
67
|
+
config.asset_file = bad_asset_file
|
68
|
+
end
|
69
|
+
end.to raise_error(InlineSvg::Configuration::Invalid, /asset_file should implement the #named method/)
|
70
|
+
end
|
71
|
+
|
72
|
+
it "rejects a collaborator that implements the correct interface with the wrong arity" do
|
73
|
+
bad_asset_file = double("bad_asset_file", named: nil)
|
74
|
+
|
75
|
+
expect do
|
76
|
+
InlineSvg.configure do |config|
|
77
|
+
config.asset_file = bad_asset_file
|
78
|
+
end
|
79
|
+
end.to raise_error(InlineSvg::Configuration::Invalid, /asset_file should implement the #named method with arity 1/)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
context "configuring the default svg-not-found class" do
|
84
|
+
it "sets the class name" do
|
85
|
+
InlineSvg.configure do |config|
|
86
|
+
config.svg_not_found_css_class = 'missing-svg'
|
87
|
+
end
|
88
|
+
|
89
|
+
expect(InlineSvg.configuration.svg_not_found_css_class).to eq 'missing-svg'
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
45
93
|
context "configuring custom transformation" do
|
46
94
|
it "allows a custom transformation to be added" do
|
47
95
|
InlineSvg.configure do |config|
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
1
|
+
require "inline_svg/transform_pipeline"
|
2
2
|
|
3
3
|
describe InlineSvg::TransformPipeline::Transformations::AriaAttributes do
|
4
4
|
it "adds a role attribute to the SVG document" do
|
5
|
-
document = Nokogiri::XML::Document.parse(
|
5
|
+
document = Nokogiri::XML::Document.parse("<svg>Some document</svg>")
|
6
6
|
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value({})
|
7
7
|
|
8
8
|
expect(transformation.transform(document).to_html).to eq(
|
@@ -12,10 +12,10 @@ describe InlineSvg::TransformPipeline::Transformations::AriaAttributes do
|
|
12
12
|
|
13
13
|
context "aria-labelledby attribute" do
|
14
14
|
it "adds 'title' when a title element is present" do
|
15
|
-
document = Nokogiri::XML::Document.parse(
|
16
|
-
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(
|
15
|
+
document = Nokogiri::XML::Document.parse("<svg><title>Some title</title>Some document</svg>")
|
16
|
+
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(true)
|
17
17
|
|
18
|
-
expect(InlineSvg::IdGenerator).to receive(:generate).with("title", "
|
18
|
+
expect(InlineSvg::IdGenerator).to receive(:generate).with("title", "Some title").
|
19
19
|
and_return("some-id")
|
20
20
|
|
21
21
|
expect(transformation.transform(document).to_html).to eq(
|
@@ -24,10 +24,10 @@ describe InlineSvg::TransformPipeline::Transformations::AriaAttributes do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "adds 'desc' when a description element is present" do
|
27
|
-
document = Nokogiri::XML::Document.parse(
|
28
|
-
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(
|
27
|
+
document = Nokogiri::XML::Document.parse("<svg><desc>Some description</desc>Some document</svg>")
|
28
|
+
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(true)
|
29
29
|
|
30
|
-
expect(InlineSvg::IdGenerator).to receive(:generate).with("desc", "
|
30
|
+
expect(InlineSvg::IdGenerator).to receive(:generate).with("desc", "Some description").
|
31
31
|
and_return("some-id")
|
32
32
|
|
33
33
|
expect(transformation.transform(document).to_html).to eq(
|
@@ -36,12 +36,12 @@ describe InlineSvg::TransformPipeline::Transformations::AriaAttributes do
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it "adds both 'desc' and 'title' when title and description elements are present" do
|
39
|
-
document = Nokogiri::XML::Document.parse(
|
40
|
-
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(
|
39
|
+
document = Nokogiri::XML::Document.parse("<svg><title>Some title</title><desc>Some description</desc>Some document</svg>")
|
40
|
+
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(true)
|
41
41
|
|
42
|
-
expect(InlineSvg::IdGenerator).to receive(:generate).with("title", "
|
42
|
+
expect(InlineSvg::IdGenerator).to receive(:generate).with("title", "Some title").
|
43
43
|
and_return("some-id")
|
44
|
-
expect(InlineSvg::IdGenerator).to receive(:generate).with("desc", "
|
44
|
+
expect(InlineSvg::IdGenerator).to receive(:generate).with("desc", "Some description").
|
45
45
|
and_return("some-other-id")
|
46
46
|
|
47
47
|
expect(transformation.transform(document).to_html).to eq(
|
@@ -50,12 +50,12 @@ describe InlineSvg::TransformPipeline::Transformations::AriaAttributes do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
it "uses existing IDs when they exist" do
|
53
|
-
document = Nokogiri::XML::Document.parse(
|
54
|
-
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(
|
53
|
+
document = Nokogiri::XML::Document.parse("<svg><title id='my-title'>Some title</title><desc id='my-desc'>Some description</desc>Some document</svg>")
|
54
|
+
transformation = InlineSvg::TransformPipeline::Transformations::AriaAttributes.create_with_value(true)
|
55
55
|
|
56
|
-
expect(InlineSvg::IdGenerator).to receive(:generate).with("my-title", "
|
56
|
+
expect(InlineSvg::IdGenerator).to receive(:generate).with("my-title", "Some title").
|
57
57
|
and_return("some-id")
|
58
|
-
expect(InlineSvg::IdGenerator).to receive(:generate).with("my-desc", "
|
58
|
+
expect(InlineSvg::IdGenerator).to receive(:generate).with("my-desc", "Some description").
|
59
59
|
and_return("some-other-id")
|
60
60
|
|
61
61
|
expect(transformation.transform(document).to_html).to eq(
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'inline_svg/transform_pipeline'
|
2
|
+
|
3
|
+
describe InlineSvg::TransformPipeline::Transformations::AriaHiddenAttribute do
|
4
|
+
it "adds an aria-hidden='true' attribute to a SVG document" do
|
5
|
+
document = Nokogiri::XML::Document.parse('<svg>Some document</svg>')
|
6
|
+
transformation = InlineSvg::TransformPipeline::Transformations::AriaHiddenAttribute.create_with_value(true)
|
7
|
+
|
8
|
+
expect(transformation.transform(document).to_html).to eq(
|
9
|
+
"<svg aria-hidden=\"true\">Some document</svg>\n"
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
@@ -10,6 +10,24 @@ describe InlineSvg::TransformPipeline::Transformations::DataAttributes do
|
|
10
10
|
)
|
11
11
|
end
|
12
12
|
|
13
|
+
it "dasherizes the data attribute name" do
|
14
|
+
document = Nokogiri::XML::Document.parse('<svg>Some document</svg>')
|
15
|
+
transformation = InlineSvg::TransformPipeline::Transformations::DataAttributes.create_with_value({some_name: "value"})
|
16
|
+
|
17
|
+
expect(transformation.transform(document).to_html).to eq(
|
18
|
+
"<svg data-some-name=\"value\">Some document</svg>\n"
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "dasherizes a data attribute name with multiple parts" do
|
23
|
+
document = Nokogiri::XML::Document.parse('<svg>Some document</svg>')
|
24
|
+
transformation = InlineSvg::TransformPipeline::Transformations::DataAttributes.create_with_value({some_other_name: "value"})
|
25
|
+
|
26
|
+
expect(transformation.transform(document).to_html).to eq(
|
27
|
+
"<svg data-some-other-name=\"value\">Some document</svg>\n"
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
13
31
|
context "when multiple data attributes are supplied" do
|
14
32
|
it "adds data attributes to the SVG for each supplied value" do
|
15
33
|
document = Nokogiri::XML::Document.parse('<svg>Some document</svg>')
|
@@ -9,4 +9,13 @@ describe InlineSvg::TransformPipeline::Transformations::Height do
|
|
9
9
|
"<svg height=\"5%\">Some document</svg>\n"
|
10
10
|
)
|
11
11
|
end
|
12
|
+
|
13
|
+
it "handles documents without SVG root elements" do
|
14
|
+
document = Nokogiri::XML::Document.parse("<foo>bar</foo><svg>Some document</svg>")
|
15
|
+
transformation = InlineSvg::TransformPipeline::Transformations::Height.create_with_value("5%")
|
16
|
+
|
17
|
+
expect(transformation.transform(document).to_html).to eq(
|
18
|
+
"<foo>bar</foo>\n"
|
19
|
+
)
|
20
|
+
end
|
12
21
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "inline_svg/transform_pipeline"
|
2
|
+
|
3
|
+
describe InlineSvg::TransformPipeline::Transformations::ClassAttribute do
|
4
|
+
it "adds a style attribute to a SVG document" do
|
5
|
+
document = Nokogiri::XML::Document.parse('<svg>Some document</svg>')
|
6
|
+
transformation =
|
7
|
+
InlineSvg::TransformPipeline::Transformations::StyleAttribute
|
8
|
+
.create_with_value("padding: 10px")
|
9
|
+
|
10
|
+
expect(transformation.transform(document).to_html).to eq(
|
11
|
+
"<svg style=\"padding: 10px\">Some document</svg>\n"
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "preserves existing style attributes on a SVG document" do
|
16
|
+
xml = '<svg style="fill: red">Some document</svg>'
|
17
|
+
document = Nokogiri::XML::Document.parse(xml)
|
18
|
+
transformation =
|
19
|
+
InlineSvg::TransformPipeline::Transformations::StyleAttribute
|
20
|
+
.create_with_value("padding: 10px")
|
21
|
+
|
22
|
+
expect(transformation.transform(document).to_html).to eq(
|
23
|
+
"<svg style=\"fill: red;padding: 10px\">Some document</svg>\n"
|
24
|
+
)
|
25
|
+
end
|
26
|
+
end
|
@@ -27,4 +27,13 @@ describe InlineSvg::TransformPipeline::Transformations::Title do
|
|
27
27
|
"<svg><title>Some Title</title></svg>\n"
|
28
28
|
)
|
29
29
|
end
|
30
|
+
|
31
|
+
it "handles non-ASCII characters" do
|
32
|
+
document = Nokogiri::XML::Document.parse('<svg>Some document</svg>')
|
33
|
+
transformation = InlineSvg::TransformPipeline::Transformations::Title.create_with_value("åäö")
|
34
|
+
|
35
|
+
expect(transformation.transform(document).to_html).to eq(
|
36
|
+
"<svg><title>åäö</title>Some document</svg>\n"
|
37
|
+
)
|
38
|
+
end
|
30
39
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'inline_svg'
|
2
|
+
require 'inline_svg/transform_pipeline'
|
3
|
+
|
4
|
+
describe InlineSvg::TransformPipeline::Transformations::Transformation do
|
5
|
+
context "#with_svg" do
|
6
|
+
it "returns a Nokogiri::XML::Document representing the parsed document fragment" do
|
7
|
+
document = Nokogiri::XML::Document.parse("<svg>Some document</svg>")
|
8
|
+
|
9
|
+
transformation = InlineSvg::TransformPipeline::Transformations::Transformation.new(:irrelevant)
|
10
|
+
expect(transformation.with_svg(document).to_html).to eq(
|
11
|
+
"<svg>Some document</svg>\n"
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "yields to the block when the document contains an SVG element" do
|
16
|
+
document = Nokogiri::XML::Document.parse("<svg>Some document</svg>")
|
17
|
+
svg = document.at_css("svg")
|
18
|
+
|
19
|
+
transformation = InlineSvg::TransformPipeline::Transformations::Transformation.new(:irrelevant)
|
20
|
+
|
21
|
+
returned_document = nil
|
22
|
+
expect do |b|
|
23
|
+
returned_document = transformation.with_svg(document, &b)
|
24
|
+
end.to yield_control
|
25
|
+
|
26
|
+
expect(returned_document.to_s).to match(/<svg>Some document<\/svg>/)
|
27
|
+
end
|
28
|
+
|
29
|
+
it "does not yield if the document does not contain an SVG element at the root" do
|
30
|
+
document = Nokogiri::XML::Document.parse("<foo>bar</foo><svg>Some document</svg>")
|
31
|
+
|
32
|
+
transformation = InlineSvg::TransformPipeline::Transformations::Transformation.new(:irrelevant)
|
33
|
+
|
34
|
+
expect do |b|
|
35
|
+
transformation.with_svg(document, &b)
|
36
|
+
end.not_to yield_control
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -15,6 +15,7 @@ describe InlineSvg::TransformPipeline::Transformations do
|
|
15
15
|
transformations = InlineSvg::TransformPipeline::Transformations.lookup(
|
16
16
|
nocomment: 'irrelevant',
|
17
17
|
class: 'irrelevant',
|
18
|
+
style: 'irrelevant',
|
18
19
|
title: 'irrelevant',
|
19
20
|
desc: 'irrelevant',
|
20
21
|
size: 'irrelevant',
|
@@ -24,11 +25,13 @@ describe InlineSvg::TransformPipeline::Transformations do
|
|
24
25
|
data: 'irrelevant',
|
25
26
|
preserve_aspect_ratio: 'irrelevant',
|
26
27
|
aria: 'irrelevant',
|
28
|
+
aria_hidden: "true"
|
27
29
|
)
|
28
30
|
|
29
31
|
expect(transformations.map(&:class)).to match_array([
|
30
32
|
InlineSvg::TransformPipeline::Transformations::NoComment,
|
31
33
|
InlineSvg::TransformPipeline::Transformations::ClassAttribute,
|
34
|
+
InlineSvg::TransformPipeline::Transformations::StyleAttribute,
|
32
35
|
InlineSvg::TransformPipeline::Transformations::Title,
|
33
36
|
InlineSvg::TransformPipeline::Transformations::Description,
|
34
37
|
InlineSvg::TransformPipeline::Transformations::Size,
|
@@ -37,7 +40,8 @@ describe InlineSvg::TransformPipeline::Transformations do
|
|
37
40
|
InlineSvg::TransformPipeline::Transformations::IdAttribute,
|
38
41
|
InlineSvg::TransformPipeline::Transformations::DataAttributes,
|
39
42
|
InlineSvg::TransformPipeline::Transformations::PreserveAspectRatio,
|
40
|
-
InlineSvg::TransformPipeline::Transformations::AriaAttributes
|
43
|
+
InlineSvg::TransformPipeline::Transformations::AriaAttributes,
|
44
|
+
InlineSvg::TransformPipeline::Transformations::AriaHiddenAttribute
|
41
45
|
])
|
42
46
|
end
|
43
47
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inline_svg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Martin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,47 +81,47 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
90
|
-
type: :
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: activesupport
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '3.0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '3.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: nokogiri
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '1.6'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '1.6'
|
125
125
|
description: Get an SVG into your view and then style it with CSS.
|
126
126
|
email:
|
127
127
|
- inline_svg@jmrtn.com
|
@@ -129,17 +129,21 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
+
- ".github/workflows/integration_test.yml"
|
133
|
+
- ".github/workflows/ruby.yml"
|
132
134
|
- ".gitignore"
|
135
|
+
- ".rubocop.yml"
|
136
|
+
- ".rubocop_todo.yml"
|
133
137
|
- CHANGELOG.md
|
134
138
|
- Gemfile
|
135
139
|
- LICENSE.txt
|
136
140
|
- README.md
|
137
141
|
- Rakefile
|
138
|
-
- circle.yml
|
139
142
|
- inline_svg.gemspec
|
140
143
|
- lib/inline_svg.rb
|
141
144
|
- lib/inline_svg/action_view/helpers.rb
|
142
145
|
- lib/inline_svg/asset_file.rb
|
146
|
+
- lib/inline_svg/cached_asset_file.rb
|
143
147
|
- lib/inline_svg/finds_asset_paths.rb
|
144
148
|
- lib/inline_svg/id_generator.rb
|
145
149
|
- lib/inline_svg/io_resource.rb
|
@@ -148,6 +152,8 @@ files:
|
|
148
152
|
- lib/inline_svg/transform_pipeline.rb
|
149
153
|
- lib/inline_svg/transform_pipeline/transformations.rb
|
150
154
|
- lib/inline_svg/transform_pipeline/transformations/aria_attributes.rb
|
155
|
+
- lib/inline_svg/transform_pipeline/transformations/aria_hidden.rb
|
156
|
+
- lib/inline_svg/transform_pipeline/transformations/aria_hidden_attribute.rb
|
151
157
|
- lib/inline_svg/transform_pipeline/transformations/class_attribute.rb
|
152
158
|
- lib/inline_svg/transform_pipeline/transformations/data_attributes.rb
|
153
159
|
- lib/inline_svg/transform_pipeline/transformations/description.rb
|
@@ -156,18 +162,28 @@ files:
|
|
156
162
|
- lib/inline_svg/transform_pipeline/transformations/no_comment.rb
|
157
163
|
- lib/inline_svg/transform_pipeline/transformations/preserve_aspect_ratio.rb
|
158
164
|
- lib/inline_svg/transform_pipeline/transformations/size.rb
|
165
|
+
- lib/inline_svg/transform_pipeline/transformations/style_attribute.rb
|
159
166
|
- lib/inline_svg/transform_pipeline/transformations/title.rb
|
160
167
|
- lib/inline_svg/transform_pipeline/transformations/transformation.rb
|
161
168
|
- lib/inline_svg/transform_pipeline/transformations/width.rb
|
162
169
|
- lib/inline_svg/version.rb
|
170
|
+
- lib/inline_svg/webpack_asset_finder.rb
|
163
171
|
- spec/asset_file_spec.rb
|
172
|
+
- spec/cached_asset_file_spec.rb
|
164
173
|
- spec/files/example.svg
|
174
|
+
- spec/files/static_assets/assets0/known-document-two.svg
|
175
|
+
- spec/files/static_assets/assets0/known-document.svg
|
176
|
+
- spec/files/static_assets/assets0/some-document.svg
|
177
|
+
- spec/files/static_assets/assets1/known-document.svg
|
178
|
+
- spec/files/static_assets/assets1/other-document.svg
|
179
|
+
- spec/files/static_assets/assets1/some-file.txt
|
165
180
|
- spec/finds_asset_paths_spec.rb
|
166
181
|
- spec/helpers/inline_svg_spec.rb
|
167
182
|
- spec/id_generator_spec.rb
|
168
183
|
- spec/inline_svg_spec.rb
|
169
184
|
- spec/io_resource_spec.rb
|
170
185
|
- spec/transformation_pipeline/transformations/aria_attributes_spec.rb
|
186
|
+
- spec/transformation_pipeline/transformations/aria_hidden_attribute_spec.rb
|
171
187
|
- spec/transformation_pipeline/transformations/class_attribute_spec.rb
|
172
188
|
- spec/transformation_pipeline/transformations/data_attributes_spec.rb
|
173
189
|
- spec/transformation_pipeline/transformations/description_spec.rb
|
@@ -175,14 +191,16 @@ files:
|
|
175
191
|
- spec/transformation_pipeline/transformations/id_attribute_spec.rb
|
176
192
|
- spec/transformation_pipeline/transformations/preserve_aspect_ratio_spec.rb
|
177
193
|
- spec/transformation_pipeline/transformations/size_spec.rb
|
194
|
+
- spec/transformation_pipeline/transformations/style_attribute_spec.rb
|
178
195
|
- spec/transformation_pipeline/transformations/title_spec.rb
|
196
|
+
- spec/transformation_pipeline/transformations/transformation_spec.rb
|
179
197
|
- spec/transformation_pipeline/transformations/width_spec.rb
|
180
198
|
- spec/transformation_pipeline/transformations_spec.rb
|
181
199
|
homepage: https://github.com/jamesmartin/inline_svg
|
182
200
|
licenses:
|
183
201
|
- MIT
|
184
202
|
metadata: {}
|
185
|
-
post_install_message:
|
203
|
+
post_install_message:
|
186
204
|
rdoc_options: []
|
187
205
|
require_paths:
|
188
206
|
- lib
|
@@ -197,20 +215,27 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
215
|
- !ruby/object:Gem::Version
|
198
216
|
version: '0'
|
199
217
|
requirements: []
|
200
|
-
|
201
|
-
|
202
|
-
signing_key:
|
218
|
+
rubygems_version: 3.1.2
|
219
|
+
signing_key:
|
203
220
|
specification_version: 4
|
204
221
|
summary: Embeds an SVG document, inline.
|
205
222
|
test_files:
|
206
223
|
- spec/asset_file_spec.rb
|
224
|
+
- spec/cached_asset_file_spec.rb
|
207
225
|
- spec/files/example.svg
|
226
|
+
- spec/files/static_assets/assets0/known-document-two.svg
|
227
|
+
- spec/files/static_assets/assets0/known-document.svg
|
228
|
+
- spec/files/static_assets/assets0/some-document.svg
|
229
|
+
- spec/files/static_assets/assets1/known-document.svg
|
230
|
+
- spec/files/static_assets/assets1/other-document.svg
|
231
|
+
- spec/files/static_assets/assets1/some-file.txt
|
208
232
|
- spec/finds_asset_paths_spec.rb
|
209
233
|
- spec/helpers/inline_svg_spec.rb
|
210
234
|
- spec/id_generator_spec.rb
|
211
235
|
- spec/inline_svg_spec.rb
|
212
236
|
- spec/io_resource_spec.rb
|
213
237
|
- spec/transformation_pipeline/transformations/aria_attributes_spec.rb
|
238
|
+
- spec/transformation_pipeline/transformations/aria_hidden_attribute_spec.rb
|
214
239
|
- spec/transformation_pipeline/transformations/class_attribute_spec.rb
|
215
240
|
- spec/transformation_pipeline/transformations/data_attributes_spec.rb
|
216
241
|
- spec/transformation_pipeline/transformations/description_spec.rb
|
@@ -218,6 +243,8 @@ test_files:
|
|
218
243
|
- spec/transformation_pipeline/transformations/id_attribute_spec.rb
|
219
244
|
- spec/transformation_pipeline/transformations/preserve_aspect_ratio_spec.rb
|
220
245
|
- spec/transformation_pipeline/transformations/size_spec.rb
|
246
|
+
- spec/transformation_pipeline/transformations/style_attribute_spec.rb
|
221
247
|
- spec/transformation_pipeline/transformations/title_spec.rb
|
248
|
+
- spec/transformation_pipeline/transformations/transformation_spec.rb
|
222
249
|
- spec/transformation_pipeline/transformations/width_spec.rb
|
223
250
|
- spec/transformation_pipeline/transformations_spec.rb
|