acidic_job 1.0.0.pre3 → 1.0.0.pre4

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: b7c1aec259fa05e5cd62425643534a6944b44df91e1077dfb2eb98fa0717c3e1
4
- data.tar.gz: 1e9759e91c7a10ea89f39626add3c60b5c3856d54a380958b9f4e6455c6cc937
3
+ metadata.gz: d549814b3b04592d10c716f8715e67d15eb7383c3235ecb5d74319ab568b5507
4
+ data.tar.gz: 5279750f02439d8fe453d6e5c430c3611513010bebbbdb18c2853d0d5b8d2764
5
5
  SHA512:
6
- metadata.gz: 53d61ee2cee38e5e4a136eb37386c2bb912933ba35f839949ac411c486dd14091478d5d23ae3bb2d4ebd3f4c2d9f051e77a64ef1113f8fec2e533f7209662cdd
7
- data.tar.gz: b8e4dcb13d2f4551d1cc37271003eff592bc03791c77edd3224d306d211c240b850ef258d184155511c29983af349ef9039b4b2dab99d298cc925a36217d7f11
6
+ metadata.gz: 7fa1a9fff8203a7a426738f8559d4f7afbcedc9e35832508a9550a113e348f158adc3c28ab58fb4f0ce6ca0fb3c9cc08c7f17d84cb2e574323e376d78188b18e
7
+ data.tar.gz: 001dd65449fdc56b3ca2bd9b74be00bb0646b3875986844392b31ec4536a7135c23da66fa7b32e20b7a893ecfc255caaefd423a72bfdaa8d3b39a68fe469329f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- acidic_job (1.0.0.pre3)
4
+ acidic_job (1.0.0.pre4)
5
5
  activerecord (>= 6.1.0)
6
6
  activesupport
7
7
 
data/README.md CHANGED
@@ -40,7 +40,7 @@ Or simply execute to install the gem yourself:
40
40
  Then, use the following command to copy over the `AcidicJob::Run` migration file.
41
41
 
42
42
  ```
43
- rails generate acidic_job
43
+ rails generate acidic_job:install
44
44
  ```
45
45
 
46
46
  ## Usage
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AcidicJob
4
- VERSION = "1.0.0.pre3"
4
+ VERSION = "1.0.0.pre4"
5
5
  end
@@ -1,30 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "rails/generators"
4
3
  require "rails/generators/active_record"
5
4
 
6
5
  module AcidicJob
7
6
  module Generators
8
- class DropTablesGenerator < ActiveRecord::Generators::Base
9
- source_root File.expand_path("../templates", __dir__)
7
+ class DropTablesGenerator < ::Rails::Generators::Base
8
+ include ActiveRecord::Generators::Migration
9
+ source_root File.expand_path("templates", __dir__)
10
10
 
11
- desc "Generates a class for a custom delivery method with the given NAME."
12
-
13
- # ActiveRecord::Generators::Base inherits from Rails::Generators::NamedBase
14
- # which requires a NAME parameter for the new table name.
15
- # Our generator always uses "acidic_job_runs", so we just set a random name here.
16
- argument :name, type: :string, default: "random_name"
11
+ desc "Drops the pre-1.0 tables for the AcidicJob::Key and AcidicJob::Staged models."
17
12
 
18
- # Copies the migration template to db/migrate.
19
- def copy_acidic_job_runs_migration_files
13
+ def copy_migration
20
14
  migration_template "drop_acidic_job_keys_migration.rb.erb",
21
- "db/migrate/drop_old_acidic_job_tables.rb"
15
+ "db/migrate/drop_old_acidic_job_tables.rb",
16
+ migration_version: migration_version
22
17
  end
23
18
 
24
19
  protected
25
20
 
26
- def migration_class
27
- ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"]
21
+ def migration_version
22
+ "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
28
23
  end
29
24
  end
30
25
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rails/generators/active_record"
4
+
5
+ module AcidicJob
6
+ module Generators
7
+ class InstallGenerator < ::Rails::Generators::Base
8
+ include ActiveRecord::Generators::Migration
9
+ source_root File.expand_path("templates", __dir__)
10
+
11
+ desc "Generates a migration for the AcidicJob::Run table."
12
+
13
+ # Copies the migration template to db/migrate.
14
+ def copy_acidic_job_runs_migration_files
15
+ migration_template "create_acidic_job_runs_migration.rb.erb",
16
+ "db/migrate/create_acidic_job_runs.rb",
17
+ migration_version: migration_version
18
+ end
19
+
20
+ protected
21
+
22
+ def migration_version
23
+ "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,4 +1,4 @@
1
- class CreateAcidicJobRuns < <%= migration_class %>
1
+ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :acidic_job_runs do |t|
4
4
  t.boolean :staged, null: false, default: -> { false }
@@ -1,4 +1,4 @@
1
- class DropOldAcidicJobTables < <%= migration_class %>
1
+ class <%= migration_class_name %> < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  drop_table :acidic_job_keys do |t|
4
4
  t.string :idempotency_key, null: false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acidic_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre3
4
+ version: 1.0.0.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - fractaledmind
@@ -90,9 +90,9 @@ files:
90
90
  - lib/acidic_job/upgrade_service.rb
91
91
  - lib/acidic_job/version.rb
92
92
  - lib/generators/acidic_job/drop_tables_generator.rb
93
- - lib/generators/acidic_job_generator.rb
94
- - lib/generators/templates/create_acidic_job_runs_migration.rb.erb
95
- - lib/generators/templates/drop_acidic_job_keys_migration.rb.erb
93
+ - lib/generators/acidic_job/install_generator.rb
94
+ - lib/generators/acidic_job/templates/create_acidic_job_runs_migration.rb.erb
95
+ - lib/generators/acidic_job/templates/drop_acidic_job_keys_migration.rb.erb
96
96
  homepage: https://github.com/fractaledmind/acidic_job
97
97
  licenses:
98
98
  - MIT
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rails/generators"
4
- require "rails/generators/active_record"
5
-
6
- class AcidicJobGenerator < ActiveRecord::Generators::Base
7
- # ActiveRecord::Generators::Base inherits from Rails::Generators::NamedBase
8
- # which requires a NAME parameter for the new table name.
9
- # Our generator always uses "acidic_job_runs", so we just set a random name here.
10
- argument :name, type: :string, default: "random_name"
11
-
12
- source_root File.expand_path("templates", __dir__)
13
-
14
- # Copies the migration template to db/migrate.
15
- def copy_acidic_job_runs_migration_files
16
- migration_template "create_acidic_job_runs_migration.rb.erb",
17
- "db/migrate/create_acidic_job_runs.rb"
18
- end
19
-
20
- protected
21
-
22
- def migration_class
23
- ActiveRecord::Migration["#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}"]
24
- end
25
- end