roadie-rails 3.1.0 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16580bfa2467fceffbbc8e06e701098916fbcbb9bee06837939bdd8e8b8ee32c
4
- data.tar.gz: f0ef8c91dfb32a406a3a4e3d705fd0ccfc7a49b939e378acb1296a58e03c2314
3
+ metadata.gz: 3adee731af7278bfca961e1573c6ed2b6dcb666bbf862b42995d241d1558799c
4
+ data.tar.gz: 8dc5dbf397cbefe8465754dc609987cb3abf3f24b495b340e072bcef38d8313c
5
5
  SHA512:
6
- metadata.gz: 38c8fcad0c0b77105922656042f8f5e0ff515bcca6cad7f65b0f6817bffdd02920a7a1184d61a993ea54d6287b78f641726937d3c53d2784e319b3be4049b57f
7
- data.tar.gz: 1e35117740bbec441a9e7f443176695982db10e245b9d00491350a277fcbf66100e384798df04bfd6789478fdc3feaf85565b0581981b2078e689a4ea98405fa
6
+ metadata.gz: b8ab3af161873b9a05e887b5a0556094450d34b69b89d8703df9cc5f2cf8c48b248ea6ed23e28acca0fef274c5102b3ff7a7c47ab175ccaf619ed692239c5d8c
7
+ data.tar.gz: 5caf0748d8c9aadf006e3e3a7a21bd36b41214e1ecf83d7d6d387dc02cac0e82a5d6652865f29aace10cec05c25d5d87606193b59a5d22d08475f4e166a0b5a0
@@ -1,9 +1,19 @@
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'
16
+ - '**.txt'
7
17
 
8
18
  pull_request:
9
19
  types: [opened, synchronize, reopened]
@@ -21,6 +31,7 @@ jobs:
21
31
  - "3.0"
22
32
  - "3.1"
23
33
  - "3.2"
34
+ - "3.3"
24
35
 
25
36
  steps:
26
37
  - name: Checkout code
@@ -37,7 +48,7 @@ jobs:
37
48
  - name: Rake
38
49
  run: bundle exec rake
39
50
 
40
- - uses: codecov/codecov-action@v3
51
+ - uses: codecov/codecov-action@v4
41
52
 
42
53
  lint:
43
54
  runs-on: ubuntu-latest
@@ -50,7 +61,7 @@ jobs:
50
61
  - name: Setup Ruby
51
62
  uses: ruby/setup-ruby@v1
52
63
  with:
53
- ruby-version: "3.2"
64
+ ruby-version: "3.3"
54
65
  bundler-cache: true
55
66
 
56
67
  - name: standardrb
data/.standard.yml ADDED
@@ -0,0 +1,2 @@
1
+ ruby_version: 2.6
2
+ parallel: true
data/Changelog.md CHANGED
@@ -1,6 +1,14 @@
1
1
  ### development version
2
2
 
3
- [full changelog](https://github.com/Mange/roadie-rails/compare/v3.1.0...master)
3
+ [full changelog](https://github.com/Mange/roadie-rails/compare/v3.2.0...master)
4
+
5
+ ### 3.2.0
6
+
7
+ [full changelog](https://github.com/Mange/roadie-rails/compare/v3.1.0...v3.2.0)
8
+
9
+ * Support [Propshaft](https://github.com/rails/propshaft) - [Juani Villarejo](https://github.com/jvillarejo) [#114](https://github.com/Mange/roadie-rails/pull/114)
10
+ * Add support (CI) for Ruby 3.3.
11
+ * Last version for supporting Ruby 2.6 (EoL).
4
12
 
5
13
  ### 3.1.0
6
14
 
data/README.md CHANGED
@@ -281,16 +281,9 @@ end
281
281
  Tested with Github Actions on multiple Ruby and Rails versions:
282
282
 
283
283
  * Ruby:
284
- * MRI 2.6
285
- * MRI 2.7
286
- * MRI 3.0
287
- * MRI 3.1
284
+ See [Workflow Matrix](/.github/workflows/main.yml)
288
285
  * Rails
289
- * 5.1
290
- * 5.2
291
- * 6.0
292
- * 6.1
293
- * 7.0
286
+ See [Integration Spec File](/spec/integration_spec.rb)
294
287
 
295
288
  Please note that [all Rails-versions are not compatible with all Ruby-versions](https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html).
296
289
  Let me know if you want any other combination supported officially.
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Roadie
4
+ module Rails
5
+ class AssetPropshaftProvider
6
+ include Roadie::AssetProvider
7
+
8
+ def initialize(assembly)
9
+ @assembly = assembly
10
+ @stylesheets = {}
11
+ end
12
+
13
+ def find_stylesheet(stylesheet_asset_path)
14
+ stylesheet = @stylesheets[stylesheet_asset_path]
15
+ return stylesheet if stylesheet.present?
16
+
17
+ path, digest = extract_path_and_digest(stylesheet_asset_path)
18
+
19
+ asset = @assembly.load_path.find(path)
20
+ if asset.present? && asset.fresh?(digest)
21
+ compiled_content = @assembly.compilers.compile(asset)
22
+
23
+ stylesheet = Stylesheet.new(stylesheet_asset_path, compiled_content.force_encoding("UTF-8"))
24
+ @stylesheets[stylesheet_asset_path] = stylesheet
25
+ end
26
+
27
+ stylesheet
28
+ end
29
+
30
+ private
31
+
32
+ def extract_path_and_digest(stylesheet_asset_path)
33
+ full_path = stylesheet_asset_path.sub(%r{#{::Rails.configuration.assets.prefix}/}, "")
34
+ digest = full_path[/-([0-9a-zA-Z]{7,128})\.(?!digested)[^.]+\z/, 1]
35
+ path = digest ? full_path.sub("-#{digest}", "") : full_path
36
+
37
+ [path, digest]
38
+ end
39
+ end
40
+ end
41
+ end
@@ -106,7 +106,7 @@ module Roadie
106
106
 
107
107
  def []=(option, value)
108
108
  if ATTRIBUTE_NAMES.include?(option)
109
- public_send("#{option}=", value)
109
+ public_send(:"#{option}=", value)
110
110
  else
111
111
  raise ArgumentError, "#{option.inspect} is not a valid option"
112
112
  end
@@ -14,8 +14,11 @@ module Roadie
14
14
 
15
15
  if app.config.respond_to?(:assets) && app.config.assets
16
16
  if app.assets
17
- config.roadie.asset_providers <<
18
- AssetPipelineProvider.new(app.assets)
17
+ config.roadie.asset_providers << AssetPipelineProvider.new(app.assets)
18
+ elsif defined?(Propshaft)
19
+ config.after_initialize do |app|
20
+ config.roadie.asset_providers << AssetPropshaftProvider.new(app.assets)
21
+ end
19
22
  else
20
23
  app.config.assets.configure do |env|
21
24
  config.roadie.asset_providers <<
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Roadie
4
4
  module Rails
5
- VERSION = "3.1.0"
5
+ VERSION = "3.2.0"
6
6
  end
7
7
  end
data/lib/roadie/rails.rb CHANGED
@@ -15,6 +15,7 @@ require "roadie/rails/document_builder"
15
15
  require "roadie/rails/mail_inliner"
16
16
 
17
17
  require "roadie/rails/asset_pipeline_provider"
18
+ require "roadie/rails/asset_propshaft_provider"
18
19
 
19
20
  require "roadie/rails/mailer"
20
21
 
data/roadie-rails.gemspec CHANGED
@@ -30,4 +30,6 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "rspec-collection_matchers"
31
31
  spec.add_development_dependency "rspec-rails"
32
32
  spec.add_development_dependency "standard"
33
+
34
+ spec.post_install_message = "This would be the last version that supports ruby 2.6"
33
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roadie-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Bergmark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-19 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -148,6 +148,7 @@ files:
148
148
  - ".gitignore"
149
149
  - ".rubocop.yml"
150
150
  - ".solargraph.yml"
151
+ - ".standard.yml"
151
152
  - Changelog.md
152
153
  - Gemfile
153
154
  - LICENSE.txt
@@ -158,6 +159,7 @@ files:
158
159
  - lib/roadie-rails.rb
159
160
  - lib/roadie/rails.rb
160
161
  - lib/roadie/rails/asset_pipeline_provider.rb
162
+ - lib/roadie/rails/asset_propshaft_provider.rb
161
163
  - lib/roadie/rails/automatic.rb
162
164
  - lib/roadie/rails/document_builder.rb
163
165
  - lib/roadie/rails/inline_on_delivery.rb
@@ -173,7 +175,7 @@ homepage: http://github.com/Mange/roadie-rails
173
175
  licenses:
174
176
  - MIT
175
177
  metadata: {}
176
- post_install_message:
178
+ post_install_message: This would be the last version that supports ruby 2.6
177
179
  rdoc_options: []
178
180
  require_paths:
179
181
  - lib
@@ -188,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
188
190
  - !ruby/object:Gem::Version
189
191
  version: '0'
190
192
  requirements: []
191
- rubygems_version: 3.4.21
193
+ rubygems_version: 3.5.10
192
194
  signing_key:
193
195
  specification_version: 4
194
196
  summary: Making HTML emails comfortable for the Rails rockstars