rails-metro 0.2.0 → 0.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 +4 -4
- data/CHANGELOG.md +15 -0
- data/lib/rails/metro/packs/azure_storage_pack.rb +45 -0
- data/lib/rails/metro/packs/carrierwave_pack.rb +32 -0
- data/lib/rails/metro/packs/elasticsearch_pack.rb +0 -1
- data/lib/rails/metro/packs/error_tracking_pack.rb +1 -2
- data/lib/rails/metro/packs/gcs_storage_pack.rb +49 -0
- data/lib/rails/metro/packs/honeybadger_pack.rb +0 -1
- data/lib/rails/metro/packs/image_processing_pack.rb +32 -0
- data/lib/rails/metro/packs/meilisearch_pack.rb +0 -1
- data/lib/rails/metro/packs/r2_storage_pack.rb +1 -1
- data/lib/rails/metro/packs/rollbar_pack.rb +0 -1
- data/lib/rails/metro/packs/s3_storage_pack.rb +1 -1
- data/lib/rails/metro/packs/search_pack.rb +0 -1
- data/lib/rails/metro/packs/shrine_pack.rb +62 -0
- data/lib/rails/metro/version.rb +1 -1
- metadata +6 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 84b44dd4a5dbe6e0e67f533e55e8e94a6613fe1075bb7e3a7359c6d6d883f8be
|
|
4
|
+
data.tar.gz: 606865cb7520167ac819128949997de9de9768119e38340d69852c0bb61182f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a96b1dad92b57c8230a57a2fdbfdbfd847cfb2fe2512eb5d286aa32e75fd39fac76e58cb808d76c85bd45b26207df72595567e4f659af4e74240c3af2555c4dc
|
|
7
|
+
data.tar.gz: 6cbe3467d654073cfa19f33b59ba14b35eb16b646af2e379e91ebfa54828c8bf294ad5dd65484c608c7afcaedb240ec588d53cd783bd99583c1f613810c6190d
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.0] - 2026-03-31
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **`image_processing` pack** — ActiveStorage image variants via libvips (`image_processing` + `ruby-vips`)
|
|
7
|
+
- **`gcs_storage` pack** — Google Cloud Storage backend for ActiveStorage
|
|
8
|
+
- **`azure_storage` pack** — Azure Blob Storage backend for ActiveStorage
|
|
9
|
+
- **`shrine` pack** — Shrine file attachment library, alternative to ActiveStorage (conflicts with `carrierwave`)
|
|
10
|
+
- **`carrierwave` pack** — CarrierWave file upload library (conflicts with `shrine`)
|
|
11
|
+
- **`sentry` pack** — renamed from `error_tracking` to match the actual gem installed
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- Removed unnecessary conflicts between error tracking packs (`sentry`, `honeybadger`, `rollbar`) — all can coexist
|
|
15
|
+
- Removed unnecessary conflicts between search packs (`search`, `elasticsearch`, `meilisearch`) — all can coexist
|
|
16
|
+
- Storage backend packs (`s3_storage`, `r2_storage`, `gcs_storage`, `azure_storage`) now correctly conflict with each other
|
|
17
|
+
|
|
3
18
|
## [0.2.0] - 2026-03-31
|
|
4
19
|
|
|
5
20
|
### Added
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
module Rails
|
|
2
|
+
module Metro
|
|
3
|
+
module Packs
|
|
4
|
+
class AzureStoragePack < FeaturePack
|
|
5
|
+
pack_name "azure_storage"
|
|
6
|
+
description "Azure Blob Storage for Active Storage file uploads"
|
|
7
|
+
category "core"
|
|
8
|
+
|
|
9
|
+
conflicts_with "s3_storage", "r2_storage", "gcs_storage"
|
|
10
|
+
|
|
11
|
+
def gems
|
|
12
|
+
[
|
|
13
|
+
{name: "azure-storage-blob"}
|
|
14
|
+
]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def template_lines
|
|
18
|
+
[
|
|
19
|
+
'inject_into_file "config/storage.yml", <<~YML',
|
|
20
|
+
"",
|
|
21
|
+
" azure:",
|
|
22
|
+
" service: AzureStorage",
|
|
23
|
+
" storage_account_name: <%= Rails.application.credentials.dig(:azure, :storage_account_name) %>",
|
|
24
|
+
" storage_access_key: <%= Rails.application.credentials.dig(:azure, :storage_access_key) %>",
|
|
25
|
+
" container: <%= Rails.application.credentials.dig(:azure, :container) %>",
|
|
26
|
+
"YML",
|
|
27
|
+
"",
|
|
28
|
+
'environment "config.active_storage.service = :azure", env: "production"'
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def post_install_notes
|
|
33
|
+
[
|
|
34
|
+
"Azure: Add your credentials with `bin/rails credentials:edit`:",
|
|
35
|
+
" azure:",
|
|
36
|
+
" storage_account_name: your-account-name",
|
|
37
|
+
" storage_access_key: your-access-key",
|
|
38
|
+
" container: your-container-name",
|
|
39
|
+
"Azure: Create a storage account at portal.azure.com and grab the access key from Access Keys"
|
|
40
|
+
]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Rails
|
|
2
|
+
module Metro
|
|
3
|
+
module Packs
|
|
4
|
+
class CarrierWavePack < FeaturePack
|
|
5
|
+
pack_name "carrierwave"
|
|
6
|
+
description "CarrierWave file upload library"
|
|
7
|
+
category "core"
|
|
8
|
+
|
|
9
|
+
conflicts_with "shrine"
|
|
10
|
+
|
|
11
|
+
def gems
|
|
12
|
+
[
|
|
13
|
+
{name: "carrierwave"}
|
|
14
|
+
]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def template_lines
|
|
18
|
+
[]
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def post_install_notes
|
|
22
|
+
[
|
|
23
|
+
"CarrierWave: Generate your first uploader: rails generate uploader Avatar",
|
|
24
|
+
"CarrierWave: Mount in a model: mount_uploader :avatar, AvatarUploader",
|
|
25
|
+
"CarrierWave: Add migration: add_column :users, :avatar, :string",
|
|
26
|
+
"CarrierWave: See https://github.com/carrierwaveuploader/carrierwave for docs"
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -2,10 +2,9 @@ module Rails
|
|
|
2
2
|
module Metro
|
|
3
3
|
module Packs
|
|
4
4
|
class ErrorTrackingPack < FeaturePack
|
|
5
|
-
pack_name "
|
|
5
|
+
pack_name "sentry"
|
|
6
6
|
description "Sentry for error tracking and performance monitoring"
|
|
7
7
|
category "ops"
|
|
8
|
-
conflicts_with "honeybadger", "rollbar"
|
|
9
8
|
|
|
10
9
|
def gems
|
|
11
10
|
[
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module Rails
|
|
2
|
+
module Metro
|
|
3
|
+
module Packs
|
|
4
|
+
class GcsStoragePack < FeaturePack
|
|
5
|
+
pack_name "gcs_storage"
|
|
6
|
+
description "Google Cloud Storage for Active Storage file uploads"
|
|
7
|
+
category "core"
|
|
8
|
+
|
|
9
|
+
conflicts_with "s3_storage", "r2_storage", "azure_storage"
|
|
10
|
+
|
|
11
|
+
def gems
|
|
12
|
+
[
|
|
13
|
+
{name: "google-cloud-storage"}
|
|
14
|
+
]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def template_lines
|
|
18
|
+
[
|
|
19
|
+
'inject_into_file "config/storage.yml", <<~YML',
|
|
20
|
+
"",
|
|
21
|
+
" google:",
|
|
22
|
+
" service: GCS",
|
|
23
|
+
" project: <%= Rails.application.credentials.dig(:gcs, :project) %>",
|
|
24
|
+
" credentials: <%= Rails.application.credentials.dig(:gcs, :credentials) %>",
|
|
25
|
+
" bucket: <%= Rails.application.credentials.dig(:gcs, :bucket) %>",
|
|
26
|
+
"YML",
|
|
27
|
+
"",
|
|
28
|
+
'environment "config.active_storage.service = :google", env: "production"'
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def post_install_notes
|
|
33
|
+
[
|
|
34
|
+
"GCS: Add your credentials with `bin/rails credentials:edit`:",
|
|
35
|
+
" gcs:",
|
|
36
|
+
" project: your-gcp-project-id",
|
|
37
|
+
" bucket: your-bucket-name",
|
|
38
|
+
" credentials:",
|
|
39
|
+
" type: service_account",
|
|
40
|
+
" project_id: your-gcp-project-id",
|
|
41
|
+
" private_key_id: ...",
|
|
42
|
+
" private_key: ...",
|
|
43
|
+
"GCS: Create a service account at console.cloud.google.com with Storage Object Admin role"
|
|
44
|
+
]
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Rails
|
|
2
|
+
module Metro
|
|
3
|
+
module Packs
|
|
4
|
+
class ImageProcessingPack < FeaturePack
|
|
5
|
+
pack_name "image_processing"
|
|
6
|
+
description "Image processing for Active Storage variants using libvips (Rails 7+ recommended)"
|
|
7
|
+
category "core"
|
|
8
|
+
|
|
9
|
+
def gems
|
|
10
|
+
[
|
|
11
|
+
{name: "image_processing"},
|
|
12
|
+
{name: "ruby-vips"}
|
|
13
|
+
]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def template_lines
|
|
17
|
+
[]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def post_install_notes
|
|
21
|
+
[
|
|
22
|
+
"ImageProcessing: Install libvips on your system:",
|
|
23
|
+
" macOS: brew install vips",
|
|
24
|
+
" Ubuntu: apt install libvips-tools",
|
|
25
|
+
" Heroku: add the heroku/heroku-buildpack-apt buildpack and apt-packages: libvips",
|
|
26
|
+
"ImageProcessing: Use variants in views: <%= image_tag user.avatar.variant(resize_to_limit: [300, 300]) %>"
|
|
27
|
+
]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module Rails
|
|
2
|
+
module Metro
|
|
3
|
+
module Packs
|
|
4
|
+
class ShrinePack < FeaturePack
|
|
5
|
+
pack_name "shrine"
|
|
6
|
+
description "Shrine file attachment library — flexible alternative to Active Storage"
|
|
7
|
+
category "core"
|
|
8
|
+
|
|
9
|
+
conflicts_with "carrierwave"
|
|
10
|
+
|
|
11
|
+
def gems
|
|
12
|
+
[
|
|
13
|
+
{name: "shrine"}
|
|
14
|
+
]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def template_lines
|
|
18
|
+
[
|
|
19
|
+
'create_file "config/initializers/shrine.rb", <<~RUBY',
|
|
20
|
+
" require \"shrine\"",
|
|
21
|
+
" require \"shrine/storage/file_system\"",
|
|
22
|
+
"",
|
|
23
|
+
" if Rails.env.production?",
|
|
24
|
+
" require \"shrine/storage/s3\"",
|
|
25
|
+
"",
|
|
26
|
+
" s3_options = {",
|
|
27
|
+
" bucket: Rails.application.credentials.dig(:aws, :bucket),",
|
|
28
|
+
" region: Rails.application.credentials.dig(:aws, :region) || \"us-east-1\",",
|
|
29
|
+
" access_key_id: Rails.application.credentials.dig(:aws, :access_key_id),",
|
|
30
|
+
" secret_access_key: Rails.application.credentials.dig(:aws, :secret_access_key)",
|
|
31
|
+
" }",
|
|
32
|
+
"",
|
|
33
|
+
" Shrine.storages = {",
|
|
34
|
+
" cache: Shrine::Storage::S3.new(prefix: \"cache\", **s3_options),",
|
|
35
|
+
" store: Shrine::Storage::S3.new(**s3_options)",
|
|
36
|
+
" }",
|
|
37
|
+
" else",
|
|
38
|
+
" Shrine.storages = {",
|
|
39
|
+
" cache: Shrine::Storage::FileSystem.new(\"public\", prefix: \"uploads/cache\"),",
|
|
40
|
+
" store: Shrine::Storage::FileSystem.new(\"public\", prefix: \"uploads\")",
|
|
41
|
+
" }",
|
|
42
|
+
" end",
|
|
43
|
+
"",
|
|
44
|
+
" Shrine.plugin :activerecord",
|
|
45
|
+
" Shrine.plugin :cached_attachment_data",
|
|
46
|
+
" Shrine.plugin :restore_cached_data",
|
|
47
|
+
"RUBY"
|
|
48
|
+
]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def post_install_notes
|
|
52
|
+
[
|
|
53
|
+
"Shrine: Create an uploader: app/uploaders/image_uploader.rb",
|
|
54
|
+
"Shrine: Include in models: include ImageUploader::Attachment(:photo)",
|
|
55
|
+
"Shrine: Add migration: add_column :users, :photo_data, :text",
|
|
56
|
+
"Shrine: See https://shrinerb.com for full documentation"
|
|
57
|
+
]
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
data/lib/rails/metro/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-metro
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- rails-metro contributors
|
|
@@ -63,10 +63,12 @@ files:
|
|
|
63
63
|
- lib/rails/metro/packs/authorization_pack.rb
|
|
64
64
|
- lib/rails/metro/packs/avo_pack.rb
|
|
65
65
|
- lib/rails/metro/packs/aws_ses_pack.rb
|
|
66
|
+
- lib/rails/metro/packs/azure_storage_pack.rb
|
|
66
67
|
- lib/rails/metro/packs/background_jobs_pack.rb
|
|
67
68
|
- lib/rails/metro/packs/blazer_pack.rb
|
|
68
69
|
- lib/rails/metro/packs/breadcrumbs_pack.rb
|
|
69
70
|
- lib/rails/metro/packs/caching_pack.rb
|
|
71
|
+
- lib/rails/metro/packs/carrierwave_pack.rb
|
|
70
72
|
- lib/rails/metro/packs/charting_pack.rb
|
|
71
73
|
- lib/rails/metro/packs/circuit_breaker_pack.rb
|
|
72
74
|
- lib/rails/metro/packs/clicky_pack.rb
|
|
@@ -87,6 +89,7 @@ files:
|
|
|
87
89
|
- lib/rails/metro/packs/fathom_pack.rb
|
|
88
90
|
- lib/rails/metro/packs/feature_flags_pack.rb
|
|
89
91
|
- lib/rails/metro/packs/friendly_id_pack.rb
|
|
92
|
+
- lib/rails/metro/packs/gcs_storage_pack.rb
|
|
90
93
|
- lib/rails/metro/packs/geocoder_pack.rb
|
|
91
94
|
- lib/rails/metro/packs/good_job_pack.rb
|
|
92
95
|
- lib/rails/metro/packs/google_analytics_pack.rb
|
|
@@ -97,6 +100,7 @@ files:
|
|
|
97
100
|
- lib/rails/metro/packs/honeybadger_pack.rb
|
|
98
101
|
- lib/rails/metro/packs/hotwire_livereload_pack.rb
|
|
99
102
|
- lib/rails/metro/packs/icons_pack.rb
|
|
103
|
+
- lib/rails/metro/packs/image_processing_pack.rb
|
|
100
104
|
- lib/rails/metro/packs/invisible_captcha_pack.rb
|
|
101
105
|
- lib/rails/metro/packs/kredis_pack.rb
|
|
102
106
|
- lib/rails/metro/packs/lemon_squeezy_pack.rb
|
|
@@ -151,6 +155,7 @@ files:
|
|
|
151
155
|
- lib/rails/metro/packs/sent_dm_pack.rb
|
|
152
156
|
- lib/rails/metro/packs/seo_pack.rb
|
|
153
157
|
- lib/rails/metro/packs/shoulda_matchers_pack.rb
|
|
158
|
+
- lib/rails/metro/packs/shrine_pack.rb
|
|
154
159
|
- lib/rails/metro/packs/sidekiq_pack.rb
|
|
155
160
|
- lib/rails/metro/packs/simple_calendar_pack.rb
|
|
156
161
|
- lib/rails/metro/packs/simple_form_pack.rb
|