arql 0.1.29 → 0.1.30

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: 823a5527aa1dfc5e12de5284dc43d7afcba4978608a00f31bcf53e8058e4ad67
4
- data.tar.gz: ed6026bf27d00fc953400a4776081d7f17de730dc70e96143cd448b42e21d779
3
+ metadata.gz: d8fb2d02931fdd0af7a9eec6b20db222f6f2fff93e0c506186316157987a443f
4
+ data.tar.gz: ae61f43b49612c316a82aac8e0c63dfc70c34527026c62201397f267ace5c188
5
5
  SHA512:
6
- metadata.gz: a47d663c5b8a2297e16f895b1d74add187da511b3abeec29e142d03a2ec6ae9fe577e942c8a471590f6312c8f937945912ea12db1e620fcf29973dbac5f4297f
7
- data.tar.gz: f700d21883edbddef9c82f748dbc01c99ba984cd52048a5e9e93fc29d701036ada9fe07441746020b400a8ed632343dae3a6cdd3d04848fc0a2781b2875c9006
6
+ metadata.gz: 8deb0c597de52fe5d1dd24f7eaa60c07133d7c0d583eb93f746b416d660a5911f556820b1937cb5f0d2d9667de3a53a1b8057e7bc6ad36321eb96b0e93f454e2
7
+ data.tar.gz: 77ba16537c3fa67c65518db3e5fbca9fa012452c2135a0d26ffabbb47ec9c65f6a3de1c052a98553b65640d9c534467a77ef5993013cb9f3d265c830db70e613
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.1.29)
4
+ arql (0.1.30)
5
5
  activerecord (~> 6.0.3)
6
6
  activesupport (~> 6.0.3)
7
7
  mysql2 (~> 0.5.3)
@@ -64,13 +64,23 @@ module Arql
64
64
  if @options.env.present? && !config[@options.env].present?
65
65
  STDERR.puts "Specified ENV `#{@options.env}' not exists"
66
66
  end
67
- sc = config[@options.env]
68
- sc[:database] = File.expand_path(sc[:database]) if sc[:adapter] == 'sqlite3'
69
- sc
67
+ if env = @options.env
68
+ config[env]
69
+ else
70
+ {}
71
+ end
70
72
  end
71
73
 
72
74
  def effective_config
73
- @@effective_config ||= selected_config.deep_merge(@options.to_h)
75
+ @@effective_config ||= nil
76
+ unless @@effective_config
77
+ @@effective_config = selected_config.deep_merge(@options.to_h)
78
+ if @@effective_config[:adapter].blank?
79
+ @@effective_config[:adapter] = 'sqlite3'
80
+ end
81
+ @@effective_config[:database] = File.expand_path(@@effective_config[:database]) if @@effective_config[:adapter] == 'sqlite3'
82
+ end
83
+ @@effective_config
74
84
  end
75
85
 
76
86
  def run!
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.1.29"
2
+ VERSION = "0.1.30"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.29
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang