mozconfig 0.2 → 0.3
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/VERSION +1 -1
- data/lib/mozconfig.rb +20 -3
- 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: 24147f654a6c6ec892172f776f4fe85537ea5445ae3a98a7927b3b1d55702eb9
|
4
|
+
data.tar.gz: 6319b356919375d7c551367596f57c8cfa76e558720a240912f1c8cc8c75cbc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceb39d03314fef55f23d7837da1c8ccd3ff1d166a7970374ad57eabdb62e7c6ff6d5eb350fd63de7e17ee24b83f7fb76480f5036b9e455de79809f072e267e1f
|
7
|
+
data.tar.gz: f34d7a0491425d79d908fd23980fd32295e23febd2c3b27db09b6e0735537015419d964cc9f5f36234541dfe99e68e4a9dc5b3cf5ac6f1276339920d0e2eebed
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3
|
data/lib/mozconfig.rb
CHANGED
@@ -33,14 +33,31 @@ module MozConfig
|
|
33
33
|
@globals.map!(&:join)
|
34
34
|
|
35
35
|
# Find the active config
|
36
|
-
@active = @configs.find { |_, options| !options.first.commented? }
|
36
|
+
@active = @configs.find { |_, options| !options.first.commented? }&.first
|
37
|
+
|
38
|
+
@prompt = TTY::Prompt.new
|
39
|
+
@prompt.on(:keypress) do |event|
|
40
|
+
case event.value
|
41
|
+
when "j"
|
42
|
+
@prompt.trigger(:keydown)
|
43
|
+
when "k"
|
44
|
+
@prompt.trigger(:keyup)
|
45
|
+
when "\e"
|
46
|
+
# Escape
|
47
|
+
$stderr.puts "\nExiting. Configuration was not changed."
|
48
|
+
exit 0
|
49
|
+
end
|
50
|
+
end
|
37
51
|
end
|
38
52
|
|
39
53
|
def run
|
40
54
|
selection = begin
|
41
|
-
|
55
|
+
@prompt.select(
|
56
|
+
"Pick a configuration", @configs,
|
57
|
+
default: @active, cycle: true
|
58
|
+
)
|
42
59
|
rescue TTY::Reader::InputInterrupt
|
43
|
-
$stderr.puts "\nProcess interrupted. Closing"
|
60
|
+
$stderr.puts "\nProcess interrupted. Closing."
|
44
61
|
exit 130
|
45
62
|
end
|
46
63
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mozconfig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vinny Diehl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: optimist
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.4.
|
94
|
+
rubygems_version: 3.4.10
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: TUI mozconfig switcher
|