pais_legacy 0.9.5 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -11
- data/lib/pais_legacy/version.rb +1 -1
- data/lib/pais_legacy.rb +65 -7
- 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: fe5c2411a94218ccf9e040a208c283f65ac2107d898a767cbd3fa79d82da6d2e
|
4
|
+
data.tar.gz: 921a988d1433036f5af96a2340fdab9c3efbcc594aee4976cafb327398b87155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef45818e677fb259fd3690d9e2cf4217ec14e22db1376d33eb643268090628a27a2434ba331f3fef56b0d7623d51b13818fa8de5c483a6da9f57a1a000d831f7
|
7
|
+
data.tar.gz: 20be4e102da830503fc298ae0ba7e3aa367bd7eceb2e97f04f650d069c95884514307bc339243c6e82be9c0e2a5b36a47f04302f6c0697061f2cd665a8c64ffb
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pais_legacy (0.
|
4
|
+
pais_legacy (1.0.0)
|
5
5
|
byebug (~> 11.0)
|
6
6
|
minitest (~> 5.0)
|
7
7
|
mocha (~> 1.0)
|
@@ -14,30 +14,32 @@ GEM
|
|
14
14
|
ast (2.4.2)
|
15
15
|
byebug (11.1.3)
|
16
16
|
json (2.6.3)
|
17
|
-
minitest (5.
|
17
|
+
minitest (5.18.0)
|
18
18
|
mocha (1.16.1)
|
19
|
-
parallel (1.
|
20
|
-
parser (3.2.
|
19
|
+
parallel (1.23.0)
|
20
|
+
parser (3.2.2.3)
|
21
21
|
ast (~> 2.4.1)
|
22
|
+
racc
|
22
23
|
pastel (0.8.0)
|
23
24
|
tty-color (~> 0.5)
|
25
|
+
racc (1.7.0)
|
24
26
|
rainbow (3.1.1)
|
25
27
|
rake (13.0.6)
|
26
|
-
regexp_parser (2.
|
28
|
+
regexp_parser (2.8.1)
|
27
29
|
rexml (3.2.5)
|
28
|
-
rubocop (1.
|
30
|
+
rubocop (1.52.1)
|
29
31
|
json (~> 2.3)
|
30
32
|
parallel (~> 1.10)
|
31
|
-
parser (>= 3.2.
|
33
|
+
parser (>= 3.2.2.3)
|
32
34
|
rainbow (>= 2.2.2, < 4.0)
|
33
35
|
regexp_parser (>= 1.8, < 3.0)
|
34
36
|
rexml (>= 3.2.5, < 4.0)
|
35
|
-
rubocop-ast (>= 1.
|
37
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
36
38
|
ruby-progressbar (~> 1.7)
|
37
39
|
unicode-display_width (>= 2.4.0, < 3.0)
|
38
|
-
rubocop-ast (1.
|
39
|
-
parser (>= 3.
|
40
|
-
ruby-progressbar (1.
|
40
|
+
rubocop-ast (1.29.0)
|
41
|
+
parser (>= 3.2.1.0)
|
42
|
+
ruby-progressbar (1.13.0)
|
41
43
|
timecop (0.9.6)
|
42
44
|
tty-color (0.6.0)
|
43
45
|
unicode-display_width (2.4.2)
|
data/lib/pais_legacy/version.rb
CHANGED
data/lib/pais_legacy.rb
CHANGED
@@ -40,12 +40,12 @@ module PaisLegacy
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def self.glch_read(ledger)
|
43
|
-
out,_,_=Open3.capture2(glch_read_cmd(ledger.to_s))
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
# out,_,_=Open3.capture2(glch_read_cmd(ledger.to_s))
|
44
|
+
# out.
|
45
|
+
# split("\n").
|
46
|
+
# map{|line| line.split(",")}.
|
47
|
+
# map{|line| {value: line[0], text: "#{line[0]}-#{line[1]}"}}
|
48
|
+
glch_read_all(ledger)["accounts"].map {|h| {value: h["code"], text: "#{h['code']}-#{h['description']}"}}
|
49
49
|
end
|
50
50
|
|
51
51
|
def self.glch_read_all(ledger)
|
@@ -122,7 +122,7 @@ module PaisLegacy
|
|
122
122
|
# end
|
123
123
|
# end
|
124
124
|
|
125
|
-
|
125
|
+
out.split("\n")
|
126
126
|
end
|
127
127
|
|
128
128
|
# Get the accounts using the trial balance
|
@@ -268,6 +268,60 @@ module PaisLegacy
|
|
268
268
|
end
|
269
269
|
end
|
270
270
|
|
271
|
+
# --------------------------------------------------------------------------------
|
272
|
+
# DB related
|
273
|
+
# --------------------------------------------------------------------------------
|
274
|
+
def self.table_schema_cmd(table)
|
275
|
+
ssh + ' "bash -l -c \"' + fglgo("db") + ' schema {{table}}\""'
|
276
|
+
.gsub("{{table}}",table)
|
277
|
+
end
|
278
|
+
|
279
|
+
def self.table_schema_raw(table)
|
280
|
+
out,_,_=Open3.capture2(table_schema_cmd(table))
|
281
|
+
out.split("\n")
|
282
|
+
end
|
283
|
+
|
284
|
+
def self.table_schema(table)
|
285
|
+
table_schema_raw(table).map {|line|
|
286
|
+
array=line.split("|")
|
287
|
+
{name: array[0].strip, type_id: array[1].strip, type_name: array[2].strip}
|
288
|
+
}
|
289
|
+
end
|
290
|
+
|
291
|
+
def self.table_data_cmd(table)
|
292
|
+
ssh_with_tty + ' "bash -l -c \"' + fglgo("db") + ' data {{table}}\""'
|
293
|
+
.gsub("{{table}}",table)
|
294
|
+
end
|
295
|
+
|
296
|
+
def self.table_data_raw(table)
|
297
|
+
out,_,_=Open3.capture2(table_data_cmd(table))
|
298
|
+
out.split("\n")
|
299
|
+
end
|
300
|
+
|
301
|
+
def self.table_data(table)
|
302
|
+
columns=table_schema(table)
|
303
|
+
|
304
|
+
table_data_raw(table).map {|line|
|
305
|
+
array=line.split("|")
|
306
|
+
hash = Hash.new
|
307
|
+
|
308
|
+
columns.each_with_index do |col,i|
|
309
|
+
hash[col[:name].to_sym] = array[i].strip
|
310
|
+
end
|
311
|
+
hash
|
312
|
+
}
|
313
|
+
end
|
314
|
+
|
315
|
+
def self.table_unload_cmd(table)
|
316
|
+
ssh + ' "bash -l -c \"' + fglgo("db") + ' unload {{table}}\""'
|
317
|
+
.gsub("{{table}}",table)
|
318
|
+
end
|
319
|
+
|
320
|
+
def self.table_unload(table)
|
321
|
+
out,_,_=Open3.capture2(table_unload_cmd(table))
|
322
|
+
end
|
323
|
+
|
324
|
+
|
271
325
|
private
|
272
326
|
def self.accounts(account)
|
273
327
|
account = account.split("/")
|
@@ -294,6 +348,10 @@ module PaisLegacy
|
|
294
348
|
"ssh -oHostKeyAlgorithms=+ssh-dss #{PAISTRAM} -T"
|
295
349
|
end
|
296
350
|
|
351
|
+
def self.ssh_with_tty
|
352
|
+
"ssh -oHostKeyAlgorithms=+ssh-dss #{PAISTRAM} -tt"
|
353
|
+
end
|
354
|
+
|
297
355
|
def self.fglgo(file)
|
298
356
|
"fglgo /hd0a/u/pais/live/prod/#{file}"
|
299
357
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pais_legacy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Pope
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|