arql 0.3.22 → 0.3.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/arql/ext/kernel.rb +4 -0
- data/lib/arql/ext/string.rb +49 -0
- data/lib/arql/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: 7b5e4c176d948c9783bcd4262ff3382205543ad436e53f99c4f9dd0a03261871
|
4
|
+
data.tar.gz: f77eb6ab9e0aacfe0dbd421838d9f27df836200d31d4d66373f485c59fb8e9ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f98696871ee66329b1545698b9b4583c43e84bbe35b52441905ee8d10bc969c2490e5f56ed47d119a3dce6189cff7abc9a9faeef18dc98549011d7efc1c0d56c
|
7
|
+
data.tar.gz: 33e9dc381d6e6f06319f20d9c8a804fcf644c3467b13ec3f2f4a306ba75be2af4987bd6a638920876f4ee507cb97fcd14800f6fdda00d1c427c504019c750a40
|
data/Gemfile.lock
CHANGED
data/lib/arql/ext/kernel.rb
CHANGED
data/lib/arql/ext/string.rb
CHANGED
@@ -10,4 +10,53 @@ class String
|
|
10
10
|
def f
|
11
11
|
expa
|
12
12
|
end
|
13
|
+
|
14
|
+
def parse_excel
|
15
|
+
if File.file?(File.expand_path(self))
|
16
|
+
Kernel.parse_excel(File.expand_path(self))
|
17
|
+
else
|
18
|
+
raise "File not found: #{self}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def parse_csv
|
23
|
+
if File.file?(File.expand_path(self))
|
24
|
+
Kernel.parse_csv(File.expand_path(self))
|
25
|
+
else
|
26
|
+
raise "File not found: #{self}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def parse_json
|
31
|
+
if File.file?(File.expand_path(self))
|
32
|
+
Kernel.parse_json(File.expand_path(self))
|
33
|
+
else
|
34
|
+
raise "File not found: #{self}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def parse
|
39
|
+
if File.file?(File.expand_path(self))
|
40
|
+
if self =~ /\.xlsx?$/i
|
41
|
+
parse_excel
|
42
|
+
elsif self =~ /\.csv$/i
|
43
|
+
parse_csv
|
44
|
+
elsif self =~ /\.json$/i
|
45
|
+
parse_json
|
46
|
+
else
|
47
|
+
raise "File type not supported: #{self}"
|
48
|
+
end
|
49
|
+
else
|
50
|
+
raise "File not found: #{self}"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def vd
|
55
|
+
if File.file?(File.expand_path(self))
|
56
|
+
system "vd '#{File.expand_path(self)}'"
|
57
|
+
print "\033[5 q"
|
58
|
+
else
|
59
|
+
raise "File not found: #{self}"
|
60
|
+
end
|
61
|
+
end
|
13
62
|
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.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liu Xiang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mysql2
|