elib_mgmt-cli 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.release_history.yml +4 -0
- data/Gemfile.lock +1 -1
- data/exe/elm_auto_sort +0 -1
- data/exe/elm_config_auto_sort +0 -1
- data/exe/elm_find_duplicated +0 -1
- data/exe/elm_search +51 -23
- data/lib/elib_mgmt/cli/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55575da4503a2372784eda72a138b8beaf4a017bbcc614179081eed23c1d748a
|
4
|
+
data.tar.gz: 4813d83beb78f348fdab910c720bbb15581cc8cfe8788e5965bd0365f977e367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee2f09dc1448b14481926e64bee6346c5984c60339d2986d39e71761cd34db31f0c8c07f9129d3d805e757d65cd20fec3e3516d2134beb6f5f2ae1eb3d287ca6
|
7
|
+
data.tar.gz: ce004b8b05e24547922a58c757cdad89ebf602d0b306f00717de2769c92cd74f03fda3f5ce4b6261a3016b546dccf56d9c153d2108c1df3d4d6cd6a1cdce97e4
|
data/.release_history.yml
CHANGED
data/Gemfile.lock
CHANGED
data/exe/elm_auto_sort
CHANGED
data/exe/elm_config_auto_sort
CHANGED
data/exe/elm_find_duplicated
CHANGED
data/exe/elm_search
CHANGED
@@ -4,7 +4,6 @@ require 'elib_mgmt/cli'
|
|
4
4
|
require 'tty/prompt'
|
5
5
|
require 'colorize'
|
6
6
|
|
7
|
-
require 'string/similarity'
|
8
7
|
require 'openssl'
|
9
8
|
|
10
9
|
if ARGV.length < 2
|
@@ -45,31 +44,60 @@ else
|
|
45
44
|
pmt.puts " Found #{ttl} file(s) \n\n".light_blue
|
46
45
|
if TR::RTUtils.on_linux? or TR::RTUtils.on_mac?
|
47
46
|
begin
|
48
|
-
sel = pmt.select(" Open the files? ".yellow, per_page: 10) do |m|
|
49
|
-
found.values.flatten.each do |f|
|
50
|
-
m.choice " * #{f}", f
|
51
|
-
end
|
52
|
-
m.choice " + New keyword", :new
|
53
|
-
m.choice " + I've done", :abort
|
54
|
-
end
|
55
47
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
break
|
63
|
-
else
|
64
|
-
if TR::RTUtils.on_linux?
|
65
|
-
`xdg-open #{sel}`
|
66
|
-
elsif TR::RTUtils.on_mac?
|
67
|
-
`open #{sel}`
|
48
|
+
opened = []
|
49
|
+
loopWithNewKw = false
|
50
|
+
loop do
|
51
|
+
|
52
|
+
if TR::RTUtils.on_linux? or TR::RTUtils.on_mac?
|
53
|
+
system("clear")
|
68
54
|
else
|
69
|
-
|
55
|
+
system("cls")
|
70
56
|
end
|
71
|
-
|
72
|
-
|
57
|
+
|
58
|
+
if not opened.empty?
|
59
|
+
pmt.puts("\n\n You've opened: ".light_blue)
|
60
|
+
opened.each do |o|
|
61
|
+
pmt.puts(" - #{o}".light_blue)
|
62
|
+
end
|
63
|
+
pmt.puts
|
64
|
+
end
|
65
|
+
|
66
|
+
sel = pmt.select("\n\n Please select one of the following to open : ".yellow, per_page: 10) do |m|
|
67
|
+
m.choice " + I've done".yellow, :abort
|
68
|
+
found.values.flatten.each do |f|
|
69
|
+
m.choice " * #{f}", f
|
70
|
+
end
|
71
|
+
m.choice " + New keyword", :new
|
72
|
+
m.choice " + I've done".yellow, :abort
|
73
|
+
end
|
74
|
+
|
75
|
+
case sel
|
76
|
+
when :new
|
77
|
+
newKw = pmt.ask(" Please provide a new keywords (separated by ',') : ", required: true)
|
78
|
+
kw = newKw.split(",").map { |v| v.strip }.reject { |v| v.empty? }
|
79
|
+
loopWithNewKw = true
|
80
|
+
when :abort
|
81
|
+
pmt.puts "\n\n Have a nice day\n\n".yellow
|
82
|
+
loopWithNewKw = false
|
83
|
+
break
|
84
|
+
else
|
85
|
+
if TR::RTUtils.on_linux?
|
86
|
+
`xdg-open #{sel}`
|
87
|
+
elsif TR::RTUtils.on_mac?
|
88
|
+
`open #{sel}`
|
89
|
+
else
|
90
|
+
pmt.puts "\n\nNot sure how to open from this platform. Please nagivate to the file location at '#{sel}' and open from there\n\n".red
|
91
|
+
end
|
92
|
+
|
93
|
+
opened << sel
|
94
|
+
|
95
|
+
end # pmt.select
|
96
|
+
|
97
|
+
end # loop
|
98
|
+
|
99
|
+
break if not loopWithNewKw
|
100
|
+
|
73
101
|
rescue TTY::Reader::InputInterrupt
|
74
102
|
pmt.puts "\n\n Have a nice day\n\n".yellow
|
75
103
|
break
|