stepper_motor 0.1.0 → 0.1.2

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: 503c1ad7d876deba41afff2e576d2b981271bdc52ec1d801c6f9be7fd2040108
4
- data.tar.gz: b3a59f3dd38663fcaa7c09e0ce13860d9f243c2009233e7389d90fcd236b9b51
3
+ metadata.gz: 375de8ed8ab1ea1229ad1a8a99a2b0aeb3a0a0fd9b4397abcc2ba9c73968dac5
4
+ data.tar.gz: acae28d6c2f058991f0a1a50b5b22a73fb54954309a74d8f8de73a6ce6da9597
5
5
  SHA512:
6
- metadata.gz: da032fcdb7b4d4dd0baeb0efb37c536e8b496d197007dd8d578a50abf606fb3cf75b7ab2e2a79ce8ba5bd3a3ba257f1a329eea66ef6384f7f5b2de51e6016e15
7
- data.tar.gz: 7588f66ed4eb021b45657a98aea2273a7e2b996a68b6d997980b9d69c93f69e49909a5c9c7a871f4ef39409eebb7fc13650f3cf924fa09ed1278fad922908401
6
+ metadata.gz: ecb52e4b5b8160aefa6764a7b1f7275410f5337a4d09672c9a1ea9b729a2b0f2fc1f667c3a253187e8ac96b535a00cf3d9b7e83f7fbc4b6220e9ddfee7dbdb1a
7
+ data.tar.gz: c6a28cdcd8935c4369c79ca34b0cdcf0b59066a818bd8da7c08e5f5b0435cfd462fb0de27030963abd484db8ef3897bd3cdf078058f6559f24151cba1c04fb99
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.7
1
+ 3.1.1
data/.standard.yml CHANGED
@@ -1,4 +1,4 @@
1
- ruby_version: 2.7
1
+ ruby_version: 3.1
2
2
  ignore:
3
3
  - 'spec/**/*':
4
4
  - Lint/ConstantDefinitionInBlock
data/CHANGELOG.md CHANGED
@@ -1,3 +1,3 @@
1
- ## [0.1.0] - 2025-01-01
1
+ ## [0.1.1] - 2025-01-01
2
2
 
3
3
  - Initial release. Expect bugs of mysterious kinds.
@@ -10,7 +10,7 @@ module StepperMotor
10
10
  class InstallGenerator < Rails::Generators::Base
11
11
  include ActiveRecord::Generators::Migration
12
12
 
13
- source_paths << File.join(File.dirname(File.dirname(__FILE__)))
13
+ source_paths << File.join(File.dirname(__FILE__, 2))
14
14
  class_option :uuid, type: :boolean, desc: "The foreign key type to use for hero_id. Can be either bigint or uuid"
15
15
 
16
16
  # Generates monolithic migration file that contains all database changes.
@@ -25,6 +25,12 @@ module StepperMotor
25
25
  end
26
26
  end
27
27
 
28
+ def create_initializer
29
+ create_file "config/initializers/stepper_motor.rb", <<~RUBY
30
+ StepperMotor.scheduler = StepperMotor::ForwardScheduler.new
31
+ RUBY
32
+ end
33
+
28
34
  private
29
35
 
30
36
  def uuid_fk?
@@ -1,22 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StepperMotor
4
- UNINITIALISED_DATABASE_EXCEPTIONS = [
5
- ActiveRecord::NoDatabaseError,
6
- ActiveRecord::StatementInvalid,
7
- ActiveRecord::ConnectionNotEstablished
8
- ]
9
-
10
- class Railtie < Rails::Railtie
4
+ class Railtie < ::Rails::Railtie
11
5
  rake_tasks do
12
- task preload: :setup do
13
- if defined?(Rails) && Rails.respond_to?(:application)
14
- if Rails.application.config.eager_load
15
- ActiveSupport.run_load_hooks(:before_eager_load, Rails.application)
16
- Rails.application.config.eager_load_namespaces.each(&:eager_load!)
17
- end
18
- end
19
- end
6
+ # none for now
20
7
  end
21
8
 
22
9
  generators do
@@ -26,24 +13,7 @@ module StepperMotor
26
13
  # The `to_prepare` block which is executed once in production
27
14
  # and before each request in development.
28
15
  config.to_prepare do
29
- if defined?(Rails) && Rails.respond_to?(:application)
30
- _config_from_rails = Rails.application.config.try(:gouda)
31
- # if config_from_rails
32
- # StepperMotor.config.scheduling_mode = config_from_rails[:scheduling_mode]
33
- # end
34
- else
35
- # Set default configuration
36
- end
37
-
38
- begin
39
- # Perform any tasks which touch the database here
40
- rescue *StepperMotor::UNINITIALISED_DATABASE_EXCEPTIONS
41
- # Do nothing. On a freshly checked-out Rails app, running even unrelated Rails tasks
42
- # (such as asset compilation) - or, more importantly, initial db:create -
43
- # will cause a NoDatabaseError, as this is a chicken-and-egg problem. That error
44
- # is safe to ignore in this instance - we should let the outer task proceed,
45
- # because if there is no database we should allow it to get created.
46
- end
16
+ # none for now
47
17
  end
48
18
  end
49
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StepperMotor
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/stepper_motor.rb CHANGED
@@ -18,5 +18,7 @@ module StepperMotor
18
18
  autoload :CyclicScheduler, File.dirname(__FILE__) + "/stepper_motor/cyclic_scheduler.rb"
19
19
  autoload :TestHelper, File.dirname(__FILE__) + "/stepper_motor/test_helper.rb"
20
20
 
21
+ require_relative "stepper_motor/railtie" if defined?(Rails::Railtie)
22
+
21
23
  mattr_accessor :scheduler, default: ForwardScheduler.new
22
24
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stepper_motor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2025-01-01 00:00:00.000000000 Z
@@ -14,14 +14,14 @@ dependencies:
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '6'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '6'
27
27
  - !ruby/object:Gem::Dependency
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: sqlite3
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '1.4'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '1.4'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -181,7 +181,7 @@ metadata:
181
181
  homepage_uri: https://github.com/stepper_motor/stepper_motor
182
182
  source_code_uri: https://github.com/stepper_motor/stepper_motor
183
183
  changelog_uri: https://github.com/stepper_motor/stepper_motor/CHANGELOG.md
184
- post_install_message:
184
+ post_install_message:
185
185
  rdoc_options: []
186
186
  require_paths:
187
187
  - lib
@@ -196,8 +196,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  - !ruby/object:Gem::Version
197
197
  version: '0'
198
198
  requirements: []
199
- rubygems_version: 3.1.6
200
- signing_key:
199
+ rubygems_version: 3.3.7
200
+ signing_key:
201
201
  specification_version: 4
202
202
  summary: Effortless step workflows that embed nicely inside Rails
203
203
  test_files: []