effective_developer 0.9.2 → 0.9.3
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 004b48f79d04b511d14dfe03b19a675a399629b14433e2c7e85d772f91fdc464
|
|
4
|
+
data.tar.gz: 1e7becc558ed0a5b3c5bfcc55ed133507608d6a44f8a46bb2efbb837a5a519d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 51b231a9ef4ca1166f285b9f26ae10c07c5d864ccb10aeb5633d51e7b56a462b5d22a49bbd0f1a63b2696508634524176648240214c8fb6157f86ae7dbafaff5
|
|
7
|
+
data.tar.gz: af878c455e88abf90be8adf45aec00acb3ba1e2a743e79c5f555b4039add59c646275ce4964e93fb3ad5b83802b61f5d1fa1d0d3171267ce39b89a1f7ca7d3ab
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# rails generate run_once NAME
|
|
2
|
+
#
|
|
3
|
+
# Generates a timestamped run_once rake task, just like a db migration:
|
|
4
|
+
#
|
|
5
|
+
# rails generate run_once upgrade_to_effective_cpd_seven
|
|
6
|
+
# => db/run_once/20260227230301_upgrade_to_effective_cpd_seven.rake
|
|
7
|
+
|
|
8
|
+
class RunOnceGenerator < Rails::Generators::NamedBase
|
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
|
10
|
+
|
|
11
|
+
desc 'Creates a timestamped run_once rake task in db/run_once/'
|
|
12
|
+
|
|
13
|
+
def create_run_once_task
|
|
14
|
+
timestamp = Time.now.utc.strftime('%Y%m%d%H%M%S')
|
|
15
|
+
template 'run_once_task.rake.tt', File.join('db', 'run_once', "#{timestamp}_#{file_name}.rake")
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# rake run_once:<%= file_name %>
|
|
2
|
+
#
|
|
3
|
+
# <%= Time.now.utc.strftime('%Y-%m-%d') %>
|
|
4
|
+
# TODO: describe what this task does and why it doesn't fit into a db migration.
|
|
5
|
+
#
|
|
6
|
+
# This task is run exactly once on production, after db:migrate, by
|
|
7
|
+
# `rake upside:perform_run_once_tasks`. There are no rollbacks and failure aborts
|
|
8
|
+
# the whole run, so it must be defensive and idempotent.
|
|
9
|
+
#
|
|
10
|
+
# - Guard the tenant and wrap work in a Tenant.as block.
|
|
11
|
+
# - Never use a bang finder on an assumed id — use a non-raising lookup and `next`.
|
|
12
|
+
# - Re-running must be a safe no-op (scope to the records still needing the change).
|
|
13
|
+
# - `puts` found/fixed/skipped counts so the production run log shows what happened.
|
|
14
|
+
#
|
|
15
|
+
# See .claude/rules/run-once-tasks.md for the full pattern.
|
|
16
|
+
|
|
17
|
+
namespace :run_once do
|
|
18
|
+
task <%= file_name %>: :environment do
|
|
19
|
+
next unless Tenant.engine_present?(:tenant)
|
|
20
|
+
|
|
21
|
+
Tenant.as(:tenant) do
|
|
22
|
+
# ... idempotent, scoped, validated mutation ...
|
|
23
|
+
|
|
24
|
+
puts "Done: <%= file_name %>"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: effective_developer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Code and Effect
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-06-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -73,6 +73,8 @@ files:
|
|
|
73
73
|
- lib/generators/effective/scaffold_generator.rb
|
|
74
74
|
- lib/generators/effective/views_generator.rb
|
|
75
75
|
- lib/generators/effective_developer/install_generator.rb
|
|
76
|
+
- lib/generators/run_once/run_once_generator.rb
|
|
77
|
+
- lib/generators/run_once/templates/run_once_task.rake.tt
|
|
76
78
|
- lib/scaffolds/admin_effective/controllers/controller.rb
|
|
77
79
|
- lib/scaffolds/admin_effective/datatables/datatable.rb
|
|
78
80
|
- lib/scaffolds/admin_effective/models/model.rb
|
|
@@ -143,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
143
145
|
- !ruby/object:Gem::Version
|
|
144
146
|
version: '0'
|
|
145
147
|
requirements: []
|
|
146
|
-
rubygems_version: 3.5.
|
|
148
|
+
rubygems_version: 3.5.9
|
|
147
149
|
signing_key:
|
|
148
150
|
specification_version: 4
|
|
149
151
|
summary: Provides some quality of life developer tools.
|