spring_onion 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +1 -1
- data/lib/spring_onion.rb +9 -1
- data/lib/spring_onion/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6ebac8b79b898f06004cbaf58cb639d348d37a4936719b8e33854289708aa8a
|
4
|
+
data.tar.gz: 5bae8b0d8500ed2ce454194f21ac82833be665c37d338c962ab6152f01572b7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 565ddc62b8def422ec437ce23310ffb86068b41eb17b4225a1a4697865cef384fa9ae991f86fb0abd3ee52d9db139ba0f1114dd12f5abce1aec30fb0ea4e20f3
|
7
|
+
data.tar.gz: 6a3258876b6fb9eb7963c4dd937ff909535917f642c956b1f46ac0954a916da202fc406cf4e023506c45bb4bf7821343285a8f5675bf716eb5a9ceb1e1740cee
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
spring_onion (1.0.
|
4
|
+
spring_onion (1.0.2)
|
5
5
|
activerecord
|
6
6
|
coderay
|
7
7
|
mysql2
|
@@ -28,7 +28,7 @@ GEM
|
|
28
28
|
coderay (1.1.3)
|
29
29
|
concurrent-ruby (1.1.6)
|
30
30
|
diff-lcs (1.4.4)
|
31
|
-
i18n (1.8.
|
31
|
+
i18n (1.8.4)
|
32
32
|
concurrent-ruby (~> 1.0)
|
33
33
|
minitest (5.14.1)
|
34
34
|
mysql2 (0.5.3)
|
data/README.md
CHANGED
@@ -36,7 +36,7 @@ ActiveRecord::Base.establish_connection(
|
|
36
36
|
)
|
37
37
|
|
38
38
|
SpringOnion.enabled = true # or `SPRING_ONION_ENABLED=1`
|
39
|
-
SpringOnion.connection = ActiveRecord::Base.connection.raw_connection
|
39
|
+
SpringOnion.connection = ActiveRecord::Base.connection.raw_connection # or `SPRING_ONION_DATABASE_URL=mysql2://...`
|
40
40
|
SpringOnion.source_filter_re = //
|
41
41
|
|
42
42
|
class Employee < ActiveRecord::Base; end
|
data/lib/spring_onion.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'logger'
|
4
|
-
|
4
|
+
|
5
5
|
require 'active_support'
|
6
|
+
require 'coderay'
|
7
|
+
require 'mysql2'
|
6
8
|
|
7
9
|
require 'spring_onion/config'
|
8
10
|
require 'spring_onion/error'
|
@@ -11,6 +13,12 @@ require 'spring_onion/json_logger'
|
|
11
13
|
require 'spring_onion/version'
|
12
14
|
|
13
15
|
ActiveSupport.on_load :active_record do
|
16
|
+
if ENV['SPRING_ONION_DATABASE_URL'] && !SpringOnion.connection
|
17
|
+
SpringOnion.connection = Mysql2::Client.new(
|
18
|
+
ActiveRecord::ConnectionAdapters::ConnectionSpecification::ConnectionUrlResolver.new(url).to_hash
|
19
|
+
)
|
20
|
+
end
|
21
|
+
|
14
22
|
require 'active_record/connection_adapters/abstract_mysql_adapter'
|
15
23
|
ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter.prepend SpringOnion::Explainer
|
16
24
|
end
|
data/lib/spring_onion/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spring_onion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- winebarrel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|