roadie 5.2.1 → 5.3.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
  SHA256:
3
- metadata.gz: bf21805d618315993a32ce718e78c756c82627d3139c5ad9823e539d183c244f
4
- data.tar.gz: 2d440a7a8f27d4ab08b4f5795222b329863816f4c55c593b217488ef0b97b5b0
3
+ metadata.gz: 96742d54db0bcce3378c12b2b689505fd01be6aa7ce21332f04e846f838d4cb7
4
+ data.tar.gz: ea28fe9a85e44b1148ae8c42ef30eb56f91b716c2626139f2e2e88e70e8f26a0
5
5
  SHA512:
6
- metadata.gz: 2c411ae8897ebbcf2e57dea6c1dd265c8d4c6e5ed43ca9dc20b085cb3cac084e7e92189ae2f621609a406621e7ebea4676d13d6ef38dde88394bd004a57d836e
7
- data.tar.gz: cedc2284f27ab48522989550440235af8c39c86ff4d6f437d722b971d4356f36db674a116c3427d71374a7075d358bb478c759f5178125e6ae53e0c38072892a
6
+ metadata.gz: bbfd1d8f8ecb48f6e19e935494dad63f74b3a5bf10cc4c35144fc0566c182df714ad287fe848e467a597c5ba3fc2aeaced0b8d517b1e0a7f021f4ad630e52107
7
+ data.tar.gz: eaad01a99309b26937df224ec5bfad1cc3c76407d307ca34823d8ad90d04c779176edcb6c75492240788a37c3f8d8085972c45ac51ccc2610ac9774ad645897b
@@ -1,25 +1,41 @@
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
+
37
+ env:
38
+ BUNDLE_GEMFILE: ${{ matrix.css_parser.gemfile }}
23
39
 
24
40
  steps:
25
41
  - name: Checkout code
@@ -36,7 +52,7 @@ jobs:
36
52
  - name: Rake
37
53
  run: bundle exec rake
38
54
 
39
- - uses: codecov/codecov-action@v3
55
+ - uses: codecov/codecov-action@v4
40
56
 
41
57
  lint:
42
58
  runs-on: ubuntu-latest
@@ -49,7 +65,7 @@ jobs:
49
65
  - name: Setup Ruby
50
66
  uses: ruby/setup-ruby@v1
51
67
  with:
52
- ruby-version: "3.2"
68
+ ruby-version: "3.4"
53
69
  bundler-cache: true
54
70
 
55
71
  - 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,19 @@
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.0...master)
4
4
 
5
- Nothing yet.
5
+ ### 5.3.0
6
6
 
7
- ### dev
7
+ [full changelog](https://github.com/Mange/roadie/compare/v5.2.1...v5.3.0)
8
+
9
+ All listed changes by [Andrei Andriichuk (@faraquet)](https://github.com/faraquet).
10
+
11
+ - Accept `css_parser` 2.x.
12
+ - Add CI coverage for both `css_parser` 1.x and 2.x.
13
+ - Drop support for Ruby versions before 3.3.
14
+ - Add Ruby 4.0 to the CI matrix.
15
+
16
+ ### 5.2.1
8
17
 
9
18
  [full changelog](https://github.com/Mange/roadie/compare/v5.2.0...v5.2.1)
10
19
 
@@ -73,7 +82,6 @@ Nothing yet.
73
82
  [full changelog](https://github.com/Mange/roadie/compare/v3.3.0...v3.4.0)
74
83
 
75
84
  - Enhancements
76
-
77
85
  - Better support for media queries - [BroiSatse (Stanislaw
78
86
  Klajn)](https://github.com/BroiSatse) and [jeznag (Jeremy
79
87
  Nagel)](https://github.com/jeznag) (#157).
@@ -216,7 +224,6 @@ Nothing yet.
216
224
  [full changelog](https://github.com/Mange/roadie/compare/v3.0.0.pre1...v3.0.0)
217
225
 
218
226
  - Enhancements:
219
-
220
227
  - `Roadie::ProviderList` responds to `#empty?` and `#last`
221
228
  - `Roadie::FilesystemProvider` ignores query string in filename.
222
229
 
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"
@@ -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"
@@ -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
@@ -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.0"
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", "< 3.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.0
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: '3.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: '3.0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rake
43
48
  requirement: !ruby/object:Gem::Requirement
@@ -115,8 +120,8 @@ 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:
121
126
  - ".github/workflows/main.yml"
122
127
  - ".gitignore"
@@ -129,6 +134,8 @@ files:
129
134
  - LICENSE
130
135
  - README.md
131
136
  - Rakefile
137
+ - gemfiles/css_parser_1.gemfile
138
+ - gemfiles/css_parser_2.gemfile
132
139
  - lib/roadie.rb
133
140
  - lib/roadie/asset_provider.rb
134
141
  - lib/roadie/asset_scanner.rb
@@ -192,11 +199,10 @@ files:
192
199
  - spec/support/have_styling_matcher.rb
193
200
  - spec/support/have_xpath_matcher.rb
194
201
  - spec/support/test_provider.rb
195
- homepage: http://github.com/Mange/roadie
202
+ homepage: https://github.com/Mange/roadie
196
203
  licenses:
197
204
  - MIT
198
205
  metadata: {}
199
- post_install_message:
200
206
  rdoc_options: []
201
207
  require_paths:
202
208
  - lib
@@ -204,15 +210,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
204
210
  requirements:
205
211
  - - ">="
206
212
  - !ruby/object:Gem::Version
207
- version: '2.7'
213
+ version: '3.3'
208
214
  required_rubygems_version: !ruby/object:Gem::Requirement
209
215
  requirements:
210
216
  - - ">="
211
217
  - !ruby/object:Gem::Version
212
218
  version: '0'
213
219
  requirements: []
214
- rubygems_version: 3.5.5
215
- signing_key:
220
+ rubygems_version: 3.7.2
216
221
  specification_version: 4
217
222
  summary: Making HTML emails comfortable for the Ruby rockstars
218
223
  test_files: []