arql 0.1.17 → 0.1.18
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/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/arql/ext/array.rb +16 -0
- data/lib/arql/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cc32d5a5bb5ea53adc52952b2f8c36e07835a37b36b95561b92e109aead9a586
|
|
4
|
+
data.tar.gz: 8603d556ce8e587bcdcfcabe3ac36e43697f74b2a7e0695722848c6bba7a0efa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72434511025ec632cd35fc26d6d4d92225e70b133882561bae3a113aa0cb6c2c7b73947b31c2c8a7cac880f9ac61a043e569dcb0e67dea6fa66a100429cbfc85
|
|
7
|
+
data.tar.gz: 8ef7c8223381c4cc647c23ece0dabb2550a4b9e7270fb684fcaaddd24cd20fefb7f521629695cd955fa2169e2344497bbea5df7716dcd4cef1c5fdb4accfc5c0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -284,7 +284,7 @@ ARQL ❯ Person.all.to_a.to_insert_sql
|
|
|
284
284
|
|
|
285
285
|
#### to_create_sql
|
|
286
286
|
|
|
287
|
-
You can call `to_create_sql` on any ActiveRecord model
|
|
287
|
+
You can call `to_create_sql` on any ActiveRecord model class to get create table SQL of the model class / table.
|
|
288
288
|
|
|
289
289
|
#### t
|
|
290
290
|
|
data/lib/arql/ext/array.rb
CHANGED
|
@@ -13,6 +13,22 @@ class Array
|
|
|
13
13
|
end.join("\n")
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
def t(*attrs)
|
|
17
|
+
if attrs.present? && present? && first.is_a?(ActiveRecord::Base)
|
|
18
|
+
puts Terminal::Table.new { |t|
|
|
19
|
+
t << attrs
|
|
20
|
+
t << :separator
|
|
21
|
+
each do |e|
|
|
22
|
+
t << e.attributes.values_at(*attrs.map(&:to_s))
|
|
23
|
+
end
|
|
24
|
+
}
|
|
25
|
+
else
|
|
26
|
+
puts Terminal::Table.new { |t|
|
|
27
|
+
v.each { |row| t << (row || :separator)}
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
16
32
|
def v
|
|
17
33
|
return self unless present?
|
|
18
34
|
t = []
|
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.1.
|
|
4
|
+
version: 0.1.18
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Liu Xiang
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-06-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: mysql2
|
|
@@ -257,7 +257,7 @@ homepage: https://github.com/lululau/arql
|
|
|
257
257
|
licenses:
|
|
258
258
|
- MIT
|
|
259
259
|
metadata: {}
|
|
260
|
-
post_install_message:
|
|
260
|
+
post_install_message:
|
|
261
261
|
rdoc_options: []
|
|
262
262
|
require_paths:
|
|
263
263
|
- lib
|
|
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
273
273
|
version: '0'
|
|
274
274
|
requirements: []
|
|
275
275
|
rubygems_version: 3.1.2
|
|
276
|
-
signing_key:
|
|
276
|
+
signing_key:
|
|
277
277
|
specification_version: 4
|
|
278
278
|
summary: Rails ActiveRecord + Pry is the best SQL query editor
|
|
279
279
|
test_files: []
|