arql 0.3.1 → 0.3.5
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 +4 -4
- data/.solargraph.yml +10 -0
- data/Gemfile.lock +17 -17
- data/arql.gemspec +1 -1
- data/lib/arql/app.rb +2 -0
- data/lib/arql/commands/sandbox.rb +33 -0
- data/lib/arql/commands.rb +1 -0
- data/lib/arql/multi_io.rb +8 -1
- data/lib/arql/repl.rb +6 -1
- data/lib/arql/version.rb +1 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 754f0123178d350470df65a3b627f3ae3890a3de7668d8422429d661e1d271cf
|
4
|
+
data.tar.gz: 5d8241b6d7ba7fca92cd3a645138276fc2c3b0c8fb7658ba514f16794f63e26a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e3b47d182b593b9a34055141192073844d257d96fbd2319e83eb3b0444c3f747fcc460819a1f8d7b51110487f00afa27c61f8ef280d49724390123c8d759f1
|
7
|
+
data.tar.gz: a5c8898c8384a7ed8685fe0ce758f797cbb530c627e116ad58610b854496d388063dfb0278a5c53586bd17a38740925d39ff9cc9942bda200436da597abaf644
|
data/.solargraph.yml
ADDED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
arql (0.3.
|
4
|
+
arql (0.3.5)
|
5
5
|
activerecord (>= 6.0.3, < 6.2.0)
|
6
6
|
activesupport (~> 6.0.3)
|
7
7
|
caxlsx (~> 3.0.2)
|
@@ -10,7 +10,7 @@ PATH
|
|
10
10
|
net-ssh-gateway (~> 2.0.0)
|
11
11
|
pry (~> 0.13.1)
|
12
12
|
pry-byebug (~> 3.9.0)
|
13
|
-
pry-doc (
|
13
|
+
pry-doc (>= 1.0.0)
|
14
14
|
rainbow (~> 3.0.0)
|
15
15
|
roo (~> 2.8.3)
|
16
16
|
sqlite3 (~> 1.4)
|
@@ -20,12 +20,12 @@ PATH
|
|
20
20
|
GEM
|
21
21
|
remote: https://rubygems.org/
|
22
22
|
specs:
|
23
|
-
activemodel (6.0.4.
|
24
|
-
activesupport (= 6.0.4.
|
25
|
-
activerecord (6.0.4.
|
26
|
-
activemodel (= 6.0.4.
|
27
|
-
activesupport (= 6.0.4.
|
28
|
-
activesupport (6.0.4.
|
23
|
+
activemodel (6.0.4.4)
|
24
|
+
activesupport (= 6.0.4.4)
|
25
|
+
activerecord (6.0.4.4)
|
26
|
+
activemodel (= 6.0.4.4)
|
27
|
+
activesupport (= 6.0.4.4)
|
28
|
+
activesupport (6.0.4.4)
|
29
29
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
30
30
|
i18n (>= 0.7, < 2)
|
31
31
|
minitest (~> 5.1)
|
@@ -40,22 +40,20 @@ GEM
|
|
40
40
|
coderay (1.1.3)
|
41
41
|
composite_primary_keys (12.0.10)
|
42
42
|
activerecord (~> 6.0.0)
|
43
|
-
concurrent-ruby (1.1.
|
43
|
+
concurrent-ruby (1.1.10)
|
44
44
|
htmlentities (4.3.4)
|
45
|
-
i18n (1.8.
|
45
|
+
i18n (1.8.11)
|
46
46
|
concurrent-ruby (~> 1.0)
|
47
47
|
method_source (1.0.0)
|
48
48
|
mimemagic (0.4.3)
|
49
49
|
nokogiri (~> 1)
|
50
50
|
rake
|
51
|
-
|
52
|
-
minitest (5.14.4)
|
51
|
+
minitest (5.15.0)
|
53
52
|
mysql2 (0.5.3)
|
54
53
|
net-ssh (6.1.0)
|
55
54
|
net-ssh-gateway (2.0.0)
|
56
55
|
net-ssh (>= 4.0.0)
|
57
|
-
nokogiri (1.
|
58
|
-
mini_portile2 (~> 2.6.1)
|
56
|
+
nokogiri (1.13.0-x86_64-darwin)
|
59
57
|
racc (~> 1.4)
|
60
58
|
pry (0.13.1)
|
61
59
|
coderay (~> 1.1)
|
@@ -63,7 +61,7 @@ GEM
|
|
63
61
|
pry-byebug (3.9.0)
|
64
62
|
byebug (~> 11.0)
|
65
63
|
pry (~> 0.13.0)
|
66
|
-
pry-doc (1.
|
64
|
+
pry-doc (1.3.0)
|
67
65
|
pry (~> 0.11)
|
68
66
|
yard (~> 0.9.11)
|
69
67
|
racc (1.6.0)
|
@@ -81,8 +79,10 @@ GEM
|
|
81
79
|
tzinfo (1.2.9)
|
82
80
|
thread_safe (~> 0.1)
|
83
81
|
unicode-display_width (1.8.0)
|
84
|
-
|
85
|
-
|
82
|
+
webrick (1.7.0)
|
83
|
+
yard (0.9.27)
|
84
|
+
webrick (~> 1.7.0)
|
85
|
+
zeitwerk (2.5.3)
|
86
86
|
|
87
87
|
PLATFORMS
|
88
88
|
ruby
|
data/arql.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
spec.add_dependency 'net-ssh-gateway', '~> 2.0.0'
|
35
35
|
spec.add_dependency 'pry', '~> 0.13.1'
|
36
36
|
spec.add_dependency 'pry-byebug', '~> 3.9.0'
|
37
|
-
spec.add_dependency 'pry-doc', '
|
37
|
+
spec.add_dependency 'pry-doc', '>= 1.0.0'
|
38
38
|
spec.add_dependency 'rainbow', '~> 3.0.0'
|
39
39
|
spec.add_dependency 'terminal-table', '~> 1.8.0'
|
40
40
|
spec.add_dependency 'table_print', '~> 1.5.6'
|
data/lib/arql/app.rb
CHANGED
@@ -68,6 +68,8 @@ module Arql
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def config
|
71
|
+
@config ||= YAML.load(IO.read(File.expand_path(@options.config_file)), aliases: true).with_indifferent_access
|
72
|
+
rescue ArgumentError
|
71
73
|
@config ||= YAML.load(IO.read(File.expand_path(@options.config_file))).with_indifferent_access
|
72
74
|
end
|
73
75
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Arql::Commands
|
2
|
+
module Sandbox
|
3
|
+
class << self
|
4
|
+
attr_accessor :enabled
|
5
|
+
|
6
|
+
@sandbox_callback = proc do
|
7
|
+
begin_transaction(joinable: false)
|
8
|
+
end
|
9
|
+
|
10
|
+
def enter
|
11
|
+
ActiveRecord::ConnectionAdapters::AbstractAdapter.set_callback(:checkout, :after, &@sandbox_callback)
|
12
|
+
ActiveRecord::Base.connection.begin_transaction(joinable: false)
|
13
|
+
@enabled = true
|
14
|
+
end
|
15
|
+
|
16
|
+
def quit
|
17
|
+
ActiveRecord::ConnectionAdapters::AbstractAdapter.skip_callback(:checkout, :after, &@sandbox_callback)
|
18
|
+
@enabled = false
|
19
|
+
|
20
|
+
puts "begin_transaction callbacks removed."
|
21
|
+
puts "You still have open %d transactions open, don't forget commit or rollback them." % ActiveRecord::Base.connection.open_transactions if ActiveRecord::Base.connection.open_transactions > 0
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
Pry.commands.block_command 'sandbox-enter' do
|
26
|
+
Sandbox.enter
|
27
|
+
end
|
28
|
+
|
29
|
+
Pry.commands.block_command 'sandbox-quit' do
|
30
|
+
Sandbox.quit
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/arql/commands.rb
CHANGED
data/lib/arql/multi_io.rb
CHANGED
data/lib/arql/repl.rb
CHANGED
@@ -35,7 +35,12 @@ module Arql
|
|
35
35
|
"(#{obj}:#{nest_level})"
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
38
|
+
if Arql::Commands::Sandbox.enabled
|
39
|
+
sandbox_indicator = ' [%s] ' % Rainbow('sandbox').green.bright
|
40
|
+
else
|
41
|
+
sandbox_indicator = ''
|
42
|
+
end
|
43
|
+
"%s#{Rainbow('@').green}%s%s#{nest_level_prompt} [%d] %s " % [Rainbow('ARQL').red, Rainbow(App.prompt).yellow, sandbox_indicator, pry_instance.input_ring.count, Rainbow('❯').green]
|
39
44
|
end]
|
40
45
|
end
|
41
46
|
end
|
data/lib/arql/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|
@@ -132,16 +132,16 @@ dependencies:
|
|
132
132
|
name: pry-doc
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
|
-
- - "
|
135
|
+
- - ">="
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: 1.
|
137
|
+
version: 1.0.0
|
138
138
|
type: :runtime
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
|
-
- - "
|
142
|
+
- - ">="
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version: 1.
|
144
|
+
version: 1.0.0
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: rainbow
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,6 +222,7 @@ extensions: []
|
|
222
222
|
extra_rdoc_files: []
|
223
223
|
files:
|
224
224
|
- ".gitignore"
|
225
|
+
- ".solargraph.yml"
|
225
226
|
- CODE_OF_CONDUCT.md
|
226
227
|
- Gemfile
|
227
228
|
- Gemfile.lock
|
@@ -241,6 +242,7 @@ files:
|
|
241
242
|
- lib/arql/commands/models.rb
|
242
243
|
- lib/arql/commands/reconnect.rb
|
243
244
|
- lib/arql/commands/redefine.rb
|
245
|
+
- lib/arql/commands/sandbox.rb
|
244
246
|
- lib/arql/commands/show_sql.rb
|
245
247
|
- lib/arql/commands/table.rb
|
246
248
|
- lib/arql/concerns.rb
|
@@ -281,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
283
|
- !ruby/object:Gem::Version
|
282
284
|
version: '0'
|
283
285
|
requirements: []
|
284
|
-
rubygems_version: 3.
|
286
|
+
rubygems_version: 3.3.3
|
285
287
|
signing_key:
|
286
288
|
specification_version: 4
|
287
289
|
summary: Rails ActiveRecord + Pry is the best SQL query editor
|