arql 0.1.28 → 0.1.29

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: a60cf3e7b24cf3967d9e566fbb89011ce12b727bd6ef9f4e6e7b83aa2ef58bfc
4
- data.tar.gz: 06152be12dff3594db513cbca09e8f53d0250d634d05b4a4bf1e1532c593097a
3
+ metadata.gz: 823a5527aa1dfc5e12de5284dc43d7afcba4978608a00f31bcf53e8058e4ad67
4
+ data.tar.gz: ed6026bf27d00fc953400a4776081d7f17de730dc70e96143cd448b42e21d779
5
5
  SHA512:
6
- metadata.gz: b2a3f77a0119b6188437187fb23bc8da4d0129f038d325b2112dcc67eb4621484bed0c3cef28bcad6f7d2eb35957c3977ad923cdef667108b2ecfc15a4030296
7
- data.tar.gz: 309d4f09b2b475625e006a66faea1cef2473368bab41933188de5f47cc75bd2b6a9ee47a6c86fa3096f84e118c1cce402be18b65605bf76564dee123c092364f
6
+ metadata.gz: a47d663c5b8a2297e16f895b1d74add187da511b3abeec29e142d03a2ec6ae9fe577e942c8a471590f6312c8f937945912ea12db1e620fcf29973dbac5f4297f
7
+ data.tar.gz: f700d21883edbddef9c82f748dbc01c99ba984cd52048a5e9e93fc29d701036ada9fe07441746020b400a8ed632343dae3a6cdd3d04848fc0a2781b2875c9006
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arql (0.1.28)
4
+ arql (0.1.29)
5
5
  activerecord (~> 6.0.3)
6
6
  activesupport (~> 6.0.3)
7
7
  mysql2 (~> 0.5.3)
@@ -36,11 +36,12 @@ module Arql
36
36
 
37
37
  def load_initializer!
38
38
  return unless effective_config[:initializer]
39
- unless File.exists?(effective_config[:initializer])
39
+ initializer_file = File.expand_path(effective_config[:initializer])
40
+ unless File.exists?(initializer_file)
40
41
  STDERR.puts "Specified initializer file not found, #{effective_config[:initializer]}"
41
42
  exit(1)
42
43
  end
43
- load(effective_config[:initializer])
44
+ load(initializer_file)
44
45
  end
45
46
 
46
47
  def start_ssh_proxy!
@@ -56,14 +57,16 @@ module Arql
56
57
  end
57
58
 
58
59
  def config
59
- @config ||= YAML.load(IO.read(@options.config_file)).with_indifferent_access
60
+ @config ||= YAML.load(IO.read(File.expand_path(@options.config_file))).with_indifferent_access
60
61
  end
61
62
 
62
63
  def selected_config
63
64
  if @options.env.present? && !config[@options.env].present?
64
65
  STDERR.puts "Specified ENV `#{@options.env}' not exists"
65
66
  end
66
- config[@options.env]
67
+ sc = config[@options.env]
68
+ sc[:database] = File.expand_path(sc[:database]) if sc[:adapter] == 'sqlite3'
69
+ sc
67
70
  end
68
71
 
69
72
  def effective_config
@@ -10,10 +10,7 @@ module Arql
10
10
  end
11
11
 
12
12
  def parse_options!
13
- @options = OpenStruct.new(adapter: 'mysql2',
14
- encoding: 'utf8',
15
- pool: 5,
16
- config_file: default_config_file,
13
+ @options = OpenStruct.new(config_file: default_config_file,
17
14
  initializer: default_initializer,
18
15
  ssh: {})
19
16
 
@@ -1,3 +1,3 @@
1
1
  module Arql
2
- VERSION = "0.1.28"
2
+ VERSION = "0.1.29"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.28
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-06 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2