ruby-clash-systray 1.0.9 → 2.0.0

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: f64f16572be39b6f942ec2d3768dc87c82195ad6ad441f68407fe0522b8ddd05
4
- data.tar.gz: 335eee3f11045313e898e4f6823301be1a3915fc10b51b38edbdadffa1bd240f
3
+ metadata.gz: cc7c16ff0e0524a3cf3fab3dd0d673f09f7c79fbf8f4787e5e79e941670e650b
4
+ data.tar.gz: 38a76bd7b9fb6a87e087d5f72f1d3a7e72bdb1626d7a18991206db5cb4e4ba5e
5
5
  SHA512:
6
- metadata.gz: f5ea36784c687db31faabbd1df6efe3ad870086107d79a32f62ec620440601689b1e28a3d2a3ac70eeb16fbf9877232533ac2a62c56db0d8cdea2d5961ad1986
7
- data.tar.gz: 0e853ef08f58ced7f3d1ce5a722a4ced5c63640cbee240f6c5521fc4174aa27a97fc43dd800fc27187994deb92571c9bd0d020b5e8a2eec7de48677c7989caa6
6
+ metadata.gz: ddd065ccadc4facd6a4eba05b49b6451522975ab05ee8f7145df2fff51727c307da35dbeb6d9368b18db813a6f95d517c6ab7cdaa9e2efd8aa0ba4520ca0c9a5
7
+ data.tar.gz: 9d4e5c1f660fe30986d367c584c74ca2bd4db296901572111ee88b872e8f8908afd24c4a41175eeaae2988bd08a0d73f85abe6ca774d35d396eae3865bd2def6
@@ -1,11 +1,11 @@
1
1
  class Systray < RubyQt6::Bando::QWidget
2
- module Helpers
3
- def self.extract_proxy_name(str)
4
- str.to_s.split(" | ")[0].strip
5
- end
2
+ private
6
3
 
7
- def self.inject_proxy_name(*arr)
8
- arr.join(" | ")
9
- end
4
+ def hlpr_extract_proxy_name(str)
5
+ str.to_s.split(" | ")[0].strip
6
+ end
7
+
8
+ def hlpr_inject_proxy_name(*arr)
9
+ arr.join(" | ")
10
10
  end
11
11
  end
@@ -67,18 +67,18 @@ class Systray < RubyQt6::Bando::QWidget
67
67
 
68
68
  def update_proxies_actions_delayinfo
69
69
  @proxies_actions.each do |proxy_action|
70
- proxy_name = Helpers.extract_proxy_name(proxy_action.text)
70
+ proxy_name = hlpr_extract_proxy_name(proxy_action.text)
71
71
  proxy_action.set_text(proxy_name)
72
72
  end
73
73
 
74
74
  @selectors_actions.each do |action|
75
75
  Clash.api.GET_group_delay(action.text, on_success: ->(data) {
76
76
  @proxies_actions.each do |proxy_action|
77
- proxy_name = Helpers.extract_proxy_name(proxy_action.text)
77
+ proxy_name = hlpr_extract_proxy_name(proxy_action.text)
78
78
  proxy_delay = data[proxy_name]
79
79
  next unless proxy_delay
80
80
 
81
- text = Helpers.inject_proxy_name(proxy_name, "#{proxy_delay} ms")
81
+ text = hlpr_inject_proxy_name(proxy_name, "#{proxy_delay} ms")
82
82
  proxy_action.set_text(text)
83
83
  end
84
84
  })
@@ -11,6 +11,7 @@ class Systray < RubyQt6::Bando::QWidget
11
11
 
12
12
  def initialize
13
13
  super
14
+
14
15
  initialize_ui
15
16
  end
16
17
 
@@ -38,7 +39,7 @@ class Systray < RubyQt6::Bando::QWidget
38
39
  return unless checked
39
40
 
40
41
  group = sender.parent.menu_action.text
41
- proxy = Helpers.extract_proxy_name(sender.text)
42
+ proxy = hlpr_extract_proxy_name(sender.text)
42
43
  Clash.api.PUT_proxies(group, proxy, on_success: ->(_) {})
43
44
  end
44
45
  end
@@ -1,3 +1,3 @@
1
1
  module ClashSystray
2
- VERSION = "1.0.9"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-clash-systray
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Doe