stepper_motor 0.1.1 → 0.1.2

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: 32c95c99e435864073c9cb8a66c29e0f2fd5f5c223f226325f712822f3620426
4
- data.tar.gz: bce7cf452476572d4d3d707303d8968e7a82927f04f70658223a101ae12ea488
3
+ metadata.gz: 375de8ed8ab1ea1229ad1a8a99a2b0aeb3a0a0fd9b4397abcc2ba9c73968dac5
4
+ data.tar.gz: acae28d6c2f058991f0a1a50b5b22a73fb54954309a74d8f8de73a6ce6da9597
5
5
  SHA512:
6
- metadata.gz: 5e482631024b0125f4ec060f4e94229e624cb77bd9439fabcaa84dee0940f5150a608ebe9c12993a59b357cc2a6f2048866809cc15b1c254b984cde07d3fc96b
7
- data.tar.gz: e090fe1af24537907d3a5ce5bd36b7789bc38dd2774cfed91d24b30df7bfd0fb9efa012b752106978d4269c17bb77a556829a390625c76089856045d50a6f819
6
+ metadata.gz: ecb52e4b5b8160aefa6764a7b1f7275410f5337a4d09672c9a1ea9b729a2b0f2fc1f667c3a253187e8ac96b535a00cf3d9b7e83f7fbc4b6220e9ddfee7dbdb1a
7
+ data.tar.gz: c6a28cdcd8935c4369c79ca34b0cdcf0b59066a818bd8da7c08e5f5b0435cfd462fb0de27030963abd484db8ef3897bd3cdf078058f6559f24151cba1c04fb99
@@ -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.1"
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stepper_motor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julik Tarkhanov