roadie 5.2.1 → 5.3.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: bf21805d618315993a32ce718e78c756c82627d3139c5ad9823e539d183c244f
4
- data.tar.gz: 2d440a7a8f27d4ab08b4f5795222b329863816f4c55c593b217488ef0b97b5b0
3
+ metadata.gz: bf09ebd39e5df6de904dd29d3d2962713d3528bfa971e159dace62168992a934
4
+ data.tar.gz: 2cc21635c9109f1160562d61ef259addb80c1c7174568bbff742ec66b6906065
5
5
  SHA512:
6
- metadata.gz: 2c411ae8897ebbcf2e57dea6c1dd265c8d4c6e5ed43ca9dc20b085cb3cac084e7e92189ae2f621609a406621e7ebea4676d13d6ef38dde88394bd004a57d836e
7
- data.tar.gz: cedc2284f27ab48522989550440235af8c39c86ff4d6f437d722b971d4356f36db674a116c3427d71374a7075d358bb478c759f5178125e6ae53e0c38072892a
6
+ metadata.gz: dbe53da038fd12980969a1c9f5aefc2d42cc311e71e535ef54d59ed1fa176ced6a727e1f3949883a1ffeb17d55a0677eb9c4c440a5ac4df1c9d41b72964f1df4
7
+ data.tar.gz: 9b8da1c24184823d9fbb4609d349c596609c21315a2f7627c8d7183e1dc59a1c6747c3a37be3be0635107be09771429b60c3360f3a0fe10242ef9cf70cf10805
@@ -0,0 +1,9 @@
1
+ version: 2
2
+
3
+ updates:
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ day: "sunday"
9
+ time: "16:00"
@@ -1,34 +1,52 @@
1
1
  name: Main
2
2
  on:
3
+ schedule:
4
+ # Run on the first day of every month
5
+ # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
6
+ - cron: '0 0 1 * *'
7
+ # Allow running manually
8
+ # For more details: https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow?tool=webui
9
+ workflow_dispatch:
3
10
  push:
4
11
  branches:
5
12
  - main
6
13
  - master
14
+ paths-ignore:
15
+ - '**.md'
7
16
 
8
17
  pull_request:
9
18
  types: [opened, synchronize, reopened]
10
19
 
11
20
  jobs:
12
21
  base:
13
- name: Ruby ${{ matrix.ruby }}
22
+ name: Ruby ${{ matrix.ruby }} / ${{ matrix.css_parser.name }}
14
23
  runs-on: ubuntu-latest
15
24
  strategy:
16
25
  fail-fast: false
17
26
  matrix:
18
27
  ruby:
19
- - "2.7"
20
- - "3.0"
21
- - "3.1"
22
- - "3.2"
28
+ - "3.3"
29
+ - "3.4"
30
+ - "4.0"
31
+ css_parser:
32
+ - gemfile: gemfiles/css_parser_1.gemfile
33
+ name: css_parser 1.x
34
+ - gemfile: gemfiles/css_parser_2.gemfile
35
+ name: css_parser 2.x
36
+ - gemfile: gemfiles/css_parser_3.gemfile
37
+ name: css_parser 3.x
38
+
39
+ env:
40
+ BUNDLE_GEMFILE: ${{ matrix.css_parser.gemfile }}
23
41
 
24
42
  steps:
25
43
  - name: Checkout code
26
- uses: actions/checkout@v4
44
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
27
45
 
28
46
  # This setup is not compatible with the way Travis CI was
29
47
  # setup, so the cache will only work for the root folder.
30
48
  - name: Setup Ruby
31
- uses: ruby/setup-ruby@v1
49
+ uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
32
50
  with:
33
51
  ruby-version: ${{ matrix.ruby }}
34
52
  bundler-cache: true
@@ -36,20 +54,20 @@ jobs:
36
54
  - name: Rake
37
55
  run: bundle exec rake
38
56
 
39
- - uses: codecov/codecov-action@v3
57
+ - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
40
58
 
41
59
  lint:
42
60
  runs-on: ubuntu-latest
43
61
  steps:
44
62
  - name: Checkout code
45
- uses: actions/checkout@v4
63
+ uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
46
64
 
47
65
  # This setup is not compatible with the way Travis CI was
48
66
  # setup, so the cache will only work for the root folder.
49
67
  - name: Setup Ruby
50
- uses: ruby/setup-ruby@v1
68
+ uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0
51
69
  with:
52
- ruby-version: "3.2"
70
+ ruby-version: "3.4"
53
71
  bundler-cache: true
54
72
 
55
73
  - name: standardrb
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  .ruby-version
6
6
 
7
7
  Gemfile.lock
8
+ gemfiles/*.lock
8
9
  doc
9
10
  tmp
10
11
  pkg
data/Changelog.md CHANGED
@@ -1,10 +1,25 @@
1
1
  ### dev
2
2
 
3
- [full changelog](https://github.com/Mange/roadie/compare/v5.2.1...master)
3
+ [full changelog](https://github.com/Mange/roadie/compare/v5.3.1...master)
4
4
 
5
- Nothing yet.
5
+ ### 5.3.1
6
6
 
7
- ### dev
7
+ [full changelog](https://github.com/Mange/roadie/compare/v5.3.0...v5.3.1)
8
+
9
+ - Add support for `css_parser` 3.x.
10
+
11
+ ### 5.3.0
12
+
13
+ [full changelog](https://github.com/Mange/roadie/compare/v5.2.1...v5.3.0)
14
+
15
+ All listed changes by [Andrei Andriichuk (@faraquet)](https://github.com/faraquet).
16
+
17
+ - Accept `css_parser` 2.x.
18
+ - Add CI coverage for both `css_parser` 1.x and 2.x.
19
+ - Drop support for Ruby versions before 3.3.
20
+ - Add Ruby 4.0 to the CI matrix.
21
+
22
+ ### 5.2.1
8
23
 
9
24
  [full changelog](https://github.com/Mange/roadie/compare/v5.2.0...v5.2.1)
10
25
 
@@ -73,7 +88,6 @@ Nothing yet.
73
88
  [full changelog](https://github.com/Mange/roadie/compare/v3.3.0...v3.4.0)
74
89
 
75
90
  - Enhancements
76
-
77
91
  - Better support for media queries - [BroiSatse (Stanislaw
78
92
  Klajn)](https://github.com/BroiSatse) and [jeznag (Jeremy
79
93
  Nagel)](https://github.com/jeznag) (#157).
@@ -216,7 +230,6 @@ Nothing yet.
216
230
  [full changelog](https://github.com/Mange/roadie/compare/v3.0.0.pre1...v3.0.0)
217
231
 
218
232
  - Enhancements:
219
-
220
233
  - `Roadie::ProviderList` responds to `#empty?` and `#last`
221
234
  - `Roadie::FilesystemProvider` ignores query string in filename.
222
235
 
data/Gemfile CHANGED
@@ -4,7 +4,8 @@ source "https://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  # Added here so it does not show up on the Gemspec; I only want it for CI builds
7
- gem "codecov", group: :test, require: false
7
+ gem "simplecov", group: :test, require: false
8
+ gem "simplecov-cobertura", group: :test, require: false
8
9
  # Not actually required to run the tests for the gem, but a real convenience
9
10
  # for local development.
10
11
  gem "standard", group: [:test, :development], require: false
data/README.md CHANGED
@@ -448,12 +448,8 @@ Partial documents does not have a `<!DOCTYPE>`.
448
448
  Build Status
449
449
  ------------
450
450
 
451
- Tested with Github CI using:
452
-
453
- * MRI 2.7
454
- * MRI 3.0
455
- * MRI 3.1
456
- * MRI 3.2
451
+ Tested with Github CI using:
452
+ See [Workflow Matrix](/.github/workflows/main.yml)
457
453
 
458
454
  Let me know if you want any other runtime supported officially.
459
455
 
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ eval_gemfile "../Gemfile"
6
+
7
+ gem "css_parser", "~> 1.4"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ eval_gemfile "../Gemfile"
6
+
7
+ gem "css_parser", "~> 2.0"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ eval_gemfile "../Gemfile"
6
+
7
+ gem "css_parser", "~> 3.0"
@@ -59,6 +59,7 @@ module Roadie
59
59
  # call in #find_css.
60
60
  "link[rel=stylesheet][href]:not([data-roadie-ignore])"
61
61
  ).freeze
62
+ private_constant :STYLE_ELEMENT_QUERY
62
63
 
63
64
  # Cleans out stupid CDATA and/or HTML comments from the style text
64
65
  # TinyMCE causes this, allegedly
@@ -71,6 +72,7 @@ module Roadie
71
72
  (\]\]>)
72
73
  $)
73
74
  /x.freeze
75
+ private_constant :CLEANING_MATCHER
74
76
 
75
77
  def read_stylesheet(element)
76
78
  if element.name == "style"
@@ -167,7 +167,7 @@ module Roadie
167
167
  # @return {Array<String>}
168
168
  def styles_in_shared_media_queries(style_blocks)
169
169
  style_blocks.group_by(&:media).map do |media_types, blocks|
170
- css_rules = blocks.map(&:to_s).join("\n")
170
+ css_rules = blocks.join("\n")
171
171
 
172
172
  if media_types == ["all"]
173
173
  css_rules
@@ -73,6 +73,7 @@ module Roadie
73
73
  :host
74
74
  :root
75
75
  ].freeze
76
+ private_constant :BAD_PSEUDO_FUNCTIONS
76
77
 
77
78
  def pseudo_element?
78
79
  selector.include? "::"
@@ -7,6 +7,7 @@ module Roadie
7
7
  # A style block is the combination of a {Selector} and a list of {StyleProperty}.
8
8
  class StyleBlock
9
9
  extend Forwardable
10
+
10
11
  attr_reader :selector, :properties, :media
11
12
 
12
13
  # @param [Selector] selector
@@ -39,7 +40,7 @@ module Roadie
39
40
  # @return {String}
40
41
  def to_s
41
42
  # NB - leave off redundant final semicolon - see https://www.w3.org/TR/CSS2/syndata.html#declaration
42
- "#{selector}{#{properties.map(&:to_s).join(";")}}"
43
+ "#{selector}{#{properties.join(";")}}"
43
44
  end
44
45
 
45
46
  private
@@ -137,6 +137,7 @@ module Roadie
137
137
  end
138
138
 
139
139
  VALID_OPTIONS = Set[:host, :port, :path, :protocol, :scheme].freeze
140
+ private_constant :VALID_OPTIONS
140
141
 
141
142
  def validate_options(options)
142
143
  keys = Set.new(options.keys)
@@ -73,6 +73,7 @@ module Roadie
73
73
  \k'quote' # Closing quote
74
74
  \)
75
75
  }x
76
+ private_constant :CSS_URL_REGEXP
76
77
 
77
78
  def transform_element(element)
78
79
  case element.name
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Roadie
4
- VERSION = "5.2.1"
4
+ VERSION = "5.3.1"
5
5
  end
data/roadie.gemspec CHANGED
@@ -10,15 +10,15 @@ Gem::Specification.new do |s|
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = ["Magnus Bergmark"]
12
12
  s.email = ["magnus.bergmark@gmail.com"]
13
- s.homepage = "http://github.com/Mange/roadie"
13
+ s.homepage = "https://github.com/Mange/roadie"
14
14
  s.summary = "Making HTML emails comfortable for the Ruby rockstars"
15
15
  s.description = "Roadie tries to make sending HTML emails a little less painful by inlining stylesheets and rewriting relative URLs for you."
16
16
  s.license = "MIT"
17
17
 
18
- s.required_ruby_version = ">= 2.7"
18
+ s.required_ruby_version = ">= 3.3"
19
19
 
20
20
  s.add_dependency "nokogiri", "~> 1.15"
21
- s.add_dependency "css_parser", "~> 1.4"
21
+ s.add_dependency "css_parser", ">= 1.4", "< 4.0"
22
22
 
23
23
  s.add_development_dependency "rake"
24
24
  s.add_development_dependency "rspec", "~> 3.0"
data/spec/spec_helper.rb CHANGED
@@ -7,8 +7,8 @@ if ENV["CI"]
7
7
  require "simplecov"
8
8
  SimpleCov.start
9
9
 
10
- require "codecov"
11
- SimpleCov.formatter = SimpleCov::Formatter::Codecov
10
+ require "simplecov-cobertura"
11
+ SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
12
12
  end
13
13
 
14
14
  $: << File.dirname(__FILE__) + "/../lib"
metadata CHANGED
@@ -1,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadie
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.1
4
+ version: 5.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Bergmark
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
10
  date: 1980-01-01 00:00:00.000000000 Z
@@ -28,16 +27,22 @@ dependencies:
28
27
  name: css_parser
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - "~>"
30
+ - - ">="
32
31
  - !ruby/object:Gem::Version
33
32
  version: '1.4'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '4.0'
34
36
  type: :runtime
35
37
  prerelease: false
36
38
  version_requirements: !ruby/object:Gem::Requirement
37
39
  requirements:
38
- - - "~>"
40
+ - - ">="
39
41
  - !ruby/object:Gem::Version
40
42
  version: '1.4'
43
+ - - "<"
44
+ - !ruby/object:Gem::Version
45
+ version: '4.0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rake
43
48
  requirement: !ruby/object:Gem::Requirement
@@ -115,9 +120,10 @@ email:
115
120
  executables: []
116
121
  extensions: []
117
122
  extra_rdoc_files:
118
- - README.md
119
123
  - Changelog.md
124
+ - README.md
120
125
  files:
126
+ - ".github/dependabot.yml"
121
127
  - ".github/workflows/main.yml"
122
128
  - ".gitignore"
123
129
  - ".rubocop.yml"
@@ -129,6 +135,9 @@ files:
129
135
  - LICENSE
130
136
  - README.md
131
137
  - Rakefile
138
+ - gemfiles/css_parser_1.gemfile
139
+ - gemfiles/css_parser_2.gemfile
140
+ - gemfiles/css_parser_3.gemfile
132
141
  - lib/roadie.rb
133
142
  - lib/roadie/asset_provider.rb
134
143
  - lib/roadie/asset_scanner.rb
@@ -192,11 +201,10 @@ files:
192
201
  - spec/support/have_styling_matcher.rb
193
202
  - spec/support/have_xpath_matcher.rb
194
203
  - spec/support/test_provider.rb
195
- homepage: http://github.com/Mange/roadie
204
+ homepage: https://github.com/Mange/roadie
196
205
  licenses:
197
206
  - MIT
198
207
  metadata: {}
199
- post_install_message:
200
208
  rdoc_options: []
201
209
  require_paths:
202
210
  - lib
@@ -204,15 +212,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
212
  requirements:
205
213
  - - ">="
206
214
  - !ruby/object:Gem::Version
207
- version: '2.7'
215
+ version: '3.3'
208
216
  required_rubygems_version: !ruby/object:Gem::Requirement
209
217
  requirements:
210
218
  - - ">="
211
219
  - !ruby/object:Gem::Version
212
220
  version: '0'
213
221
  requirements: []
214
- rubygems_version: 3.5.5
215
- signing_key:
222
+ rubygems_version: 3.7.2
216
223
  specification_version: 4
217
224
  summary: Making HTML emails comfortable for the Ruby rockstars
218
225
  test_files: []