fishplate 0.4.1 → 1.0.0

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: edb50eaa20c7bcef993ec59941bb23b336430f5579432076a4982b795d0c7c33
4
- data.tar.gz: 707d23af35bed9b77044d4dca216de063562d21023a573814ae4c4029daad828
3
+ metadata.gz: '049c9d10e45521ee6cb916304349d07c904152430d9300a5531e8a0a22e87f48'
4
+ data.tar.gz: '09e8808d1c9c7ed3d2a67dbdc5f44cfacd3850847ab072efbb15147997ec6c25'
5
5
  SHA512:
6
- metadata.gz: f5eaa0dc0401ac87b07adb4796ae2bc200d3c76f364e19a1b702a4d01545a124b3aeba9c4a98cb1332fc63a36af70ae2aa1b3bcf72b27ee6e976b96d79a30c57
7
- data.tar.gz: e31c55ebc356ab4df03a9d33e8be8bc9444804d99beb1bf08614027ccf851eb14749d605c680b089299193f9895cdce501feb01cacc6a4b72b7fd9fb4f1e317a
6
+ metadata.gz: 41fbf7a6cb46f3f5b4bef5abe884a8e01e3d945cd241552a2a6a8d75ed7b36628e8f36ddbc71513e51803a70a16b78e72124736b0d8b987e50548722ce751e7a
7
+ data.tar.gz: a977ad739f3d28217d9e693f7b520eebe908ad81e7a6e3c984a7597c725d3889731b88dd2359e68ba3b4bec4b229eaf05d9a87c061e0fc3b2e1d2316f1ca4cec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fishplate (0.4.1)
4
+ fishplate (1.0.0)
5
5
  a9n (~> 0.10)
6
6
  activemodel
7
7
  activerecord
@@ -1,3 +1,3 @@
1
1
  module Fishplate
2
- VERSION = "0.4.1".freeze
2
+ VERSION = "1.0.0".freeze
3
3
  end
data/lib/fishplate.rb CHANGED
@@ -42,13 +42,26 @@ module Fishplate
42
42
  def setup!
43
43
  A9n.root.join('config/initializers').glob('*.rb').each { |f| require f }
44
44
 
45
- # Check active_record/railtie for default config
45
+ configure_active_record
46
+
47
+ setup_database_tasks
48
+
49
+ setup_db_connection
50
+
51
+ add_sidekiq_middleware if defined?(Sidekiq)
52
+ end
53
+
54
+ private
55
+
56
+ def configure_active_record
46
57
  ActiveRecord::Base.logger = logger
47
58
  ActiveRecord::Base.time_zone_aware_attributes = true
48
59
  ActiveRecord::Base.default_timezone = :utc
49
60
  ActiveRecord::Base.connection_handlers = { ActiveRecord::Base.writing_role => ActiveRecord::Base.default_connection_handler }
50
61
  ActiveRecord::Base.configurations = database_configuration
62
+ end
51
63
 
64
+ def setup_database_tasks
52
65
  # Check active_record/tasks/database_tasks.rb for possible config values
53
66
  ActiveRecord::Tasks::DatabaseTasks.env = A9n.env
54
67
  ActiveRecord::Tasks::DatabaseTasks.database_configuration = database_configuration
@@ -57,17 +70,14 @@ module Fishplate
57
70
  ActiveRecord::Tasks::DatabaseTasks.migrations_paths = A9n.root.join('db/migrate')
58
71
  ActiveRecord::Tasks::DatabaseTasks.seed_loader = self
59
72
  ActiveRecord::Tasks::DatabaseTasks.root = A9n.root
73
+ end
60
74
 
75
+ def setup_db_connection
61
76
  ActiveRecord::Base.clear_active_connections!
62
77
  ActiveRecord::Base.flush_idle_connections!
63
-
64
78
  ActiveRecord::Base.establish_connection
65
-
66
- add_sidekiq_middleware if defined?(Sidekiq)
67
79
  end
68
80
 
69
- private
70
-
71
81
  def add_sidekiq_middleware
72
82
  Sidekiq.configure_server do |config|
73
83
  config.server_middleware do |chain|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fishplate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-19 00:00:00.000000000 Z
11
+ date: 2019-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: a9n
@@ -194,9 +194,6 @@ files:
194
194
  - README.md
195
195
  - Rakefile
196
196
  - fishplate.gemspec
197
- - fishplate/.gitignore
198
- - fishplate/.rspec
199
- - fishplate/.travis.yml
200
197
  - lib/fishplate.rb
201
198
  - lib/fishplate/rack.rb
202
199
  - lib/fishplate/sidekiq_middleware.rb
data/fishplate/.gitignore DELETED
@@ -1,11 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
data/fishplate/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.5
7
- before_install: gem install bundler -v 2.0.2