envo 0.1.1 → 0.1.2
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/README.md +2 -0
- data/lib/envo/cli/envo.bat +1 -1
- data/lib/envo/host.rb +5 -0
- data/lib/envo/val/list_val.rb +1 -4
- data/lib/envo/val/path_list_val.rb +32 -4
- data/lib/envo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fa260370764e3c4a2572f56b6c35e2dcf67ae4b0f472ff68b73ede8379baa59
|
4
|
+
data.tar.gz: f544d7f23a506033845e274b09edd0a64b5d75e659ef6e665c0523ecb0e886b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ff4f904d7a4f2301c50dbd8064f7b1205e166c7de23b353f55184c2f3385fa33173f4cfba67874803c0a16aeb1a395cda51c7208370a7c98a5d215440b867cd
|
7
|
+
data.tar.gz: bcaeb1403f08292a407cc7ceaae314e76dc07fd3c63d2db93129a56851acbd2e2fb3ff70b441f27f8a251065f1e6635dbcf656aa317e533895e90a9274008f70
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Envo
|
2
2
|
|
3
|
+
[](https://badge.fury.io/rb/envo)
|
4
|
+
|
3
5
|
A command-line environment variable manager for the current shell session. It works with bash and Windows cmd.
|
4
6
|
|
5
7
|
Envo offers several commands to view and change environment variables and also to execute simple scripts composed of those commands, thus allowing the same script for a particular env-var configuration on all supported platforms.
|
data/lib/envo/cli/envo.bat
CHANGED
data/lib/envo/host.rb
CHANGED
data/lib/envo/val/list_val.rb
CHANGED
@@ -67,13 +67,10 @@ module Envo
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
-
def pp_attribs(elem)
|
71
|
-
@ar.count(elem) > 1 ? 'D' : ' '
|
72
|
-
end
|
73
70
|
def pretty_print(ctx)
|
74
71
|
ctx.puts "["
|
75
72
|
@ar.each_with_index do |v, i|
|
76
|
-
str =
|
73
|
+
str = @ar.count(v) > 1 ? 'D ' : ' '
|
77
74
|
str += "#{i}:".ljust(4)
|
78
75
|
str += v
|
79
76
|
ctx.puts str
|
@@ -13,12 +13,40 @@ module Envo
|
|
13
13
|
def accept_item?(item)
|
14
14
|
item.type == :path
|
15
15
|
end
|
16
|
-
|
17
|
-
|
16
|
+
|
17
|
+
def make_helper_map
|
18
|
+
@ar.map { |p|
|
19
|
+
id = @host.path_id(p)
|
20
|
+
{ str: p, id: id }
|
21
|
+
}
|
18
22
|
end
|
23
|
+
|
24
|
+
def pretty_print(ctx)
|
25
|
+
helper = make_helper_map
|
26
|
+
|
27
|
+
ctx.puts "["
|
28
|
+
helper.each_with_index do |v, i|
|
29
|
+
dupes = helper.count { |e|
|
30
|
+
if e[:str] == v[:str] then true
|
31
|
+
elsif e[:id] == -1 then false
|
32
|
+
else e[:id] == v[:id]
|
33
|
+
end
|
34
|
+
}
|
35
|
+
str = dupes > 1 ? 'D' : ' '
|
36
|
+
str += v[:id] != -1 ? ' ' : 'N'
|
37
|
+
str += ' '
|
38
|
+
str += "#{i}:".ljust(4)
|
39
|
+
str += v[:str]
|
40
|
+
ctx.puts str
|
41
|
+
end
|
42
|
+
ctx.puts ']'
|
43
|
+
end
|
44
|
+
|
19
45
|
def clean!
|
20
|
-
|
21
|
-
|
46
|
+
helper = make_helper_map
|
47
|
+
helper.select! { |e| e[:id] != -1 }
|
48
|
+
helper.uniq! { |e| e[:id] }
|
49
|
+
@ar = helper.map { |e| e[:str] }
|
22
50
|
end
|
23
51
|
end
|
24
52
|
end
|
data/lib/envo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Borislav Stanimirov
|
@@ -68,7 +68,7 @@ licenses:
|
|
68
68
|
- MIT
|
69
69
|
metadata: {}
|
70
70
|
post_install_message: |
|
71
|
-
Thanks for installing envo v0.1.
|
71
|
+
Thanks for installing envo v0.1.2 alpha!
|
72
72
|
For the tool to work you must also run the installation program:
|
73
73
|
$ envo-install
|
74
74
|
Running it will complete the setup and 'envo' should be available as a command.
|
@@ -91,5 +91,5 @@ requirements: []
|
|
91
91
|
rubygems_version: 3.1.4
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
|
-
summary:
|
94
|
+
summary: A CLI environment variable manager
|
95
95
|
test_files: []
|