bridgetown-svg-inliner 2.0.0 → 2.1.1

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
  SHA256:
3
- metadata.gz: cdbbc8cc09b143dedcdaf53803f191059d3de42504ef0b0ad046bd93bd17de73
4
- data.tar.gz: d719c7f793ec4855c55e84144bf7dd827f49181237fb61002a19bbe48acf3878
3
+ metadata.gz: 98a01851b297ee6f58c0a099a0d2878f59afc0f3ee59600e0691d504f43ad785
4
+ data.tar.gz: 83fc2cbedc60f1a3438a43363f33a3912faee5e8f0d8f083c2465555c56d7993
5
5
  SHA512:
6
- metadata.gz: 15cac52b4da8c37fb501c98fb42754d03983066b63bfbacd97467a914fdda9f45df3f935af01da17893f9a5377cf6a859ec678372b459a364e13dda5874576b9
7
- data.tar.gz: 4795bed73862614a5d1d6b8f2faf17d2dd1ea6d77824697d8325fae5c4c9944554c5aece51c484547839b8dd9a3891e7cacb27bbca858ad1dfc1d31d54108e4e
6
+ metadata.gz: 89a0c709c5806fe770c034b3742dd4d5cddfba1d8d3dec8b2c8f33b5a3e8835e9bb930e1842b8425f563eaf74dcdeb20d6a1affa78bb351b8b9aab434d8c77c8
7
+ data.tar.gz: a7be063753f3ecb63a3f78e07d8d7f12736401f79b094177de044ea32d84c295758a65d46e29325314d747230c1c5388e7d927a5c098c758e2cc742c4226f481
@@ -13,7 +13,7 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
  strategy:
15
15
  matrix:
16
- ruby_version: [2.7.7, 3.0.5, 3.1.3, 3.2.0]
16
+ ruby_version: [3.0.5, 3.1.3, 3.2.8, 3.3.9, 3.4.5]
17
17
  bridgetown_version: [1.2.0]
18
18
  continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
19
19
  # Has to be top level to cache properly
data/.rubocop.yml CHANGED
@@ -4,27 +4,46 @@ inherit_gem:
4
4
  rubocop-bridgetown: .rubocop.yml
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.6
8
- Include:
9
- - lib/**/*.rb
10
- - test/**/*.rb
7
+ TargetRubyVersion: 2.7
11
8
 
12
9
  Exclude:
13
10
  - .gitignore
14
11
  - .rubocop.yml
12
+ - "*.gemspec"
15
13
 
16
14
  - Gemfile.lock
17
15
  - CHANGELOG.md
18
- - LICENSE.md
16
+ - LICENSE.txt
19
17
  - README.md
18
+ - Rakefile
19
+ - bridgetown.automation.rb
20
20
 
21
21
  - script/**/*
22
+ - test/fixtures/**/*
22
23
  - vendor/**/*
23
24
 
25
+ Layout/LineLength:
26
+ Max: 140
27
+
28
+ Metrics/BlockLength:
29
+ Enabled: false
30
+
31
+ Bundler/OrderedGems:
32
+ Enabled: false
33
+
34
+ Style/IfUnlessModifier:
35
+ Enabled: false
36
+
37
+ Layout/IndentationConsistency:
38
+ Enabled: false
39
+
40
+ Layout/IndentationWidth:
41
+ Enabled: false
42
+
24
43
  Style/MultilineIfModifier:
25
44
  Enabled: false
26
45
 
27
- Style/RescueStandardError:
46
+ Style/MapToHash:
28
47
  Enabled: false
29
48
 
30
49
  Lint/AmbiguousBlockAssociation:
data/README.md CHANGED
@@ -37,6 +37,11 @@ This plugin provides an `svg` tag in Liquid and an `svg` helper in ERB or other
37
37
  <%= svg "/assets/icons/thumbs-up.svg" %>
38
38
  ```
39
39
 
40
+ ```serb
41
+ <!-- Serbea -->
42
+ {%= svg "/assets/icons/thumbs-up.svg" %}
43
+ ```
44
+
40
45
  ### Attributes
41
46
 
42
47
  You can pass in attributes that you'd like to include on the `svg` tag in the HTML output.
@@ -51,14 +56,19 @@ You can pass in attributes that you'd like to include on the `svg` tag in the HT
51
56
  <%= svg "/assets/icons/thumbs-up.svg", class: "icon" %>
52
57
  ```
53
58
 
59
+ ```serb
60
+ <!-- Serbea -->
61
+ {%= svg "/assets/icons/thumbs-up.svg", class: "icon" %}
62
+ ```
63
+
54
64
  ```html
55
65
  <!-- Output -->
56
- <svg class="icon">
57
- ...
58
- </svg>
66
+ <svg class="icon">...</svg>
59
67
  ```
60
68
 
61
- ### Liquid variables
69
+ ### Variables
70
+
71
+ #### Liquid variables
62
72
 
63
73
  You can use Liquid variables by enclosing them in double braces (`{{ }}`)
64
74
 
@@ -69,10 +79,30 @@ You can use Liquid variables by enclosing them in double braces (`{{ }}`)
69
79
  {% svg "/assets/icons/{{ svg_file }}.svg", class: "{{ svg_class_list }}" %}
70
80
  ```
71
81
 
82
+ #### ERB variables
83
+
84
+ You can use ERB variables.
85
+
86
+ ```erb
87
+ <% svg_file = "thumbs-up.svg" %>
88
+ <% svg_class_list = "icon icon--small" %>
89
+ <%= svg "/assets/icons/" + svg_file, class: "svg_class_list" %>
90
+ ```
91
+
92
+ #### Serbea variables
93
+
94
+ You can use Serbea variables.
95
+
96
+ ```serb
97
+ {% svg_file = "thumbs-up.svg" %}
98
+ {% svg_class_list = "icon icon--small" %}
99
+ {%= svg "/assets/icons/" + svg_file, class: "svg_class_list" %}
100
+ ```
101
+
72
102
  ## Testing
73
103
 
74
- * Run `bundle exec rake test` to run the test suite
75
- * Or run `script/cibuild` to validate with Rubocop and Minitest together.
104
+ - Run `bundle exec rake test` to run the test suite
105
+ - Or run `script/cibuild` to validate with Rubocop and Minitest together.
76
106
 
77
107
  ## Contributing
78
108
 
@@ -87,4 +117,4 @@ You can use Liquid variables by enclosing them in double braces (`{{ }}`)
87
117
 
88
118
  Bridgetown SVG Inliner is released under the [MIT License](https://opensource.org/licenses/MIT).
89
119
 
90
- Copyright © 2023 [Ayush Newatia](https://twitter.com/ayushn21)
120
+ Copyright © 2023 [Ayush Newatia](https://twitter.com/ayushn21)
@@ -16,10 +16,11 @@ Gem::Specification.new do |spec|
16
16
  spec.require_paths = ["lib"]
17
17
  spec.metadata = {}
18
18
 
19
- spec.required_ruby_version = ">= 2.7.0"
19
+ spec.required_ruby_version = ">= 3.0.0"
20
20
 
21
- spec.add_dependency "bridgetown", ">= 1.2.0", "< 2.0"
21
+ spec.add_dependency "bridgetown", ">= 1.2.0", "< 3.0"
22
22
  spec.add_dependency "nokogiri"
23
+ spec.add_dependency "csv"
23
24
 
24
25
  spec.add_development_dependency "bundler"
25
26
  spec.add_development_dependency "rake"
@@ -8,7 +8,7 @@ module BridgetownSvgInliner
8
8
  path, args = attributes.split(",", 2)
9
9
 
10
10
  @path = unescape_string(path)
11
- @args = args.scan(%r{([a-zA-Z0-9_\-]+)\s*:\s*(#{Liquid::QuotedFragment})}o).map do |arg|
11
+ @args = args.scan(%r{([a-zA-Z0-9_-]+)\s*:\s*(#{Liquid::QuotedFragment})}o).map do |arg|
12
12
  [arg[0], unescape_string(arg[1])]
13
13
  end.to_h if args.present?
14
14
  end
@@ -17,7 +17,7 @@ module BridgetownSvgInliner
17
17
 
18
18
  def unescape_string(string)
19
19
  string.undump
20
- rescue
20
+ rescue # rubocop:disable Style/RescueStandardError
21
21
  string
22
22
  end
23
23
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgetownSvgInliner
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-svg-inliner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ayush Newatia
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2023-01-25 00:00:00.000000000 Z
10
+ date: 2025-09-16 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bridgetown
@@ -19,7 +18,7 @@ dependencies:
19
18
  version: 1.2.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '2.0'
21
+ version: '3.0'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +28,7 @@ dependencies:
29
28
  version: 1.2.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '2.0'
31
+ version: '3.0'
33
32
  - !ruby/object:Gem::Dependency
34
33
  name: nokogiri
35
34
  requirement: !ruby/object:Gem::Requirement
@@ -44,6 +43,20 @@ dependencies:
44
43
  - - ">="
45
44
  - !ruby/object:Gem::Version
46
45
  version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: csv
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ type: :runtime
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
47
60
  - !ruby/object:Gem::Dependency
48
61
  name: bundler
49
62
  requirement: !ruby/object:Gem::Requirement
@@ -86,7 +99,6 @@ dependencies:
86
99
  - - ">="
87
100
  - !ruby/object:Gem::Version
88
101
  version: '0'
89
- description:
90
102
  email: ayush@hey.com
91
103
  executables: []
92
104
  extensions: []
@@ -109,7 +121,6 @@ homepage: https://github.com/ayushn21/bridgetown-svg-inliner
109
121
  licenses:
110
122
  - MIT
111
123
  metadata: {}
112
- post_install_message:
113
124
  rdoc_options: []
114
125
  require_paths:
115
126
  - lib
@@ -117,15 +128,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
117
128
  requirements:
118
129
  - - ">="
119
130
  - !ruby/object:Gem::Version
120
- version: 2.7.0
131
+ version: 3.0.0
121
132
  required_rubygems_version: !ruby/object:Gem::Requirement
122
133
  requirements:
123
134
  - - ">="
124
135
  - !ruby/object:Gem::Version
125
136
  version: '0'
126
137
  requirements: []
127
- rubygems_version: 3.2.33
128
- signing_key:
138
+ rubygems_version: 3.6.2
129
139
  specification_version: 4
130
140
  summary: Liquid and ERB helper for Bridgetown to inline SVG files within HTML
131
141
  test_files: []