mullvadrb 0.0.2 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 145854caf697386a84c9ff1ced322dc11ca656c2ee50b252e5359528b807055a
4
- data.tar.gz: 601af470d15636674e8b8be60cb2d1205ab2ca17ff77e5826fea208cf9afe96a
3
+ metadata.gz: 15b1705d449260a54db9087125b5e4a9e0a6db3d548eb5d21dbeac3fb0031a83
4
+ data.tar.gz: ef45c9ffec12967471be56c4ca096e4af2bd1e4fde8011744bab1333bf17ea7b
5
5
  SHA512:
6
- metadata.gz: e781d530cb8ae5d9ca922cd4add693f3e72b2308bb929e65a743aaa01f58f0dc600333eb8979b302faa70dd03f9d4ccf968f3dda000e2d92cb175f67a9605b9f
7
- data.tar.gz: e4cbe9d04252f4ea84bc3cdf62fcd05ff728894c5c75d9df3dd20f7c71d541993af984de8f20ade77cd82b598756acb5e0a818946089e7ac90dcd0229edd0f63
6
+ metadata.gz: c78f22e514750210bab56f43fb18d06fa214c25832782ba6593ea915cdcc077235c25daf695ba6ea3aac10badc01e85b9a77d854073dcfaf35079ba6ddc33d85
7
+ data.tar.gz: 8234009792fa8e18dc7efef9a6e78e5441a5448086c0b7e5d42ab0f11fec3a618a1a8a305dfe0f8ac39cd3ba90d386cbc160ef32ea6204e5ae97e714a9f84447
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.3
2
+
3
+ Minor cleanup in the code and updates the way status is displayed.
4
+
1
5
  # 0.0.2
2
6
 
3
7
  I added back the support for WireGuard, in cases you don't want to or can't install the `mullvad` cli app, which was the initial reason I built this. The first time you run the app, it's going to ask you which one you want to use, and save your preference in `~/.local/share/mullvadrb/backend.conf`. You can switch backends from the Main Menu on the app at any time.
data/README.md CHANGED
@@ -13,7 +13,7 @@ Most of the basic functionality is available for either backend: Select a server
13
13
  You need to have a [Mullvad VPN](https://mullvad.net) account to use the app.
14
14
 
15
15
  > [!WARNING]
16
- > `mullvad` uses WireGuard, so if you change backends while connected to an OpenVPN server with `wg`, `mullvad` won't be able to disconnect from the OpenVPN.
16
+ > `mullvad` uses WireGuard, so if you change backends while connected to an OpenVPN server with `wg`, `mullvad` won't be able to disconnect from the OpenVPN connection.
17
17
  > In general, it's a good idea to stick to one backend, and disconnect from the VPN before switching backends.
18
18
  > This might potentially be fixed in the future.
19
19
 
@@ -26,7 +26,26 @@ module Mullvadrb
26
26
  end
27
27
 
28
28
  def status
29
- puts `mullvad status -v`
29
+ status = `mullvad status -v`
30
+ if status.start_with?('Disconnected')
31
+ status.gsub!('Disconnected', "\n⚠ 🚨 DISCONNECTED 🚨 c⚠")
32
+ .gsub!(/$/, "\n")
33
+ elsif status.start_with?('Connected')
34
+ status = status.split("\n")
35
+ .sort
36
+ .reject { |a| a == 'Connected' }
37
+ .prepend("šŸ“” Connected āœ… \n")
38
+ .push("\n")
39
+ .join("\n")
40
+ elsif status.start_with?('Connecting')
41
+ status = status.split("\n")
42
+ .sort
43
+ .reject { |a| a == 'Connecting' }
44
+ .prepend("šŸ“ž Connecting ā˜Ž \n")
45
+ .push("\n")
46
+ .join("\n")
47
+ end
48
+ status
30
49
  end
31
50
  end
32
51
  end
@@ -6,7 +6,7 @@ module Mullvadrb
6
6
  def update
7
7
  `mullvad relay update`
8
8
  data = `mullvad relay list`
9
- country, city, info, flag, value = nil
9
+ country, city, info, flag = nil
10
10
 
11
11
  # Each line is either a country, a city or a server
12
12
  servers = data.split("\n").compact.reject(&:empty?).map do |s|
@@ -86,8 +86,8 @@ module Mullvadrb
86
86
 
87
87
  def emoji_from_code(code)
88
88
  code.upcase
89
- .codepoints
90
- .map { |c| (c + 127397).chr('utf-8') }.join
89
+ .codepoints
90
+ .map { |c| (c + 127_397).chr('utf-8') }.join
91
91
  end
92
92
 
93
93
  def load_servers
data/lib/mullvadrb.rb CHANGED
@@ -96,8 +96,7 @@ module Mullvadrb
96
96
  Mullvadrb::Account.devices
97
97
  end
98
98
  rescue SystemExit, Interrupt
99
- puts
100
- exit
99
+ abort("\n\nTioraidh!\n")
101
100
  end
102
101
  end
103
102
  end
data/mullvadrb.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'mullvadrb'
3
- s.version = '0.0.2'
3
+ s.version = '0.0.3'
4
4
  s.summary = 'A TUI to use with Mullvad VPN'
5
5
  s.description = 'A Terminal User Interface to use with Mullvad VPN'
6
6
  s.authors = ['Fernando Briano']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mullvadrb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Briano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-23 00:00:00.000000000 Z
11
+ date: 2024-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: countries