mdq 1.5.1 → 1.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e82ce9d717037c9e6cb77fb68ebc07fbef2d3d1863b9bd9a0e5acde1b4f1ed65
4
- data.tar.gz: b88aadd8b8a20ae0a3dc75e0902a29eed5b2c2b79ac00eef4d33161be6203519
3
+ metadata.gz: eec98441746fbb4662ed354d93d0f228e07b71bb51e1c6e377ad999e13b6b97e
4
+ data.tar.gz: f08772d007547d4b559d29de26fd15197c69f845eff048fe4343cb23f9ce5148
5
5
  SHA512:
6
- metadata.gz: 410d82e49b9464a9da80fe3be11090e4433135565defeedd7f7ba6b3a3a58067188960fed97116945a30e982cfa80252c82cf6e6c97b65797eab0d0d607d61cf
7
- data.tar.gz: 3ceffaccda4efa440a2f1a50ea1d91608a4be64b357eb2928c78a45d7fb782241463a61841e7674b160ed1186f5bac3f5d18285467b86904f7629e49a0eb1267
6
+ metadata.gz: f8224cf564bad8c026f5f7ea9f5615ce582a014a7c0659dd4f467503acc31c2a1cb411017f5933218fdb679ed0673c52ac0c8e8ef8477a8a64721ec458b94b28
7
+ data.tar.gz: f3b50616a7cad1eb9179ad5dd30c65f888c2339dcb197ad5612b365026c526e3945af0af75d387343ea30cb3c480d0e8be4223249e04f04a7e1c56b68d779e97
data/lib/mdq/discovery.rb CHANGED
@@ -92,17 +92,16 @@ module Mdq
92
92
  mac_address = nil
93
93
  ip_address = nil
94
94
  ipv6_address = []
95
- wifi_network = nil
96
95
 
97
96
  # バッテリー
98
- lines1, = adb_command('shell dumpsys battery', udid)
99
- if (match = lines1.match(/level: (\d*)/))
97
+ battery_lines, = adb_command('shell dumpsys battery', udid)
98
+ if (match = battery_lines.match(/level: (\d*)/))
100
99
  battery_level = match[1].to_i
101
100
  end
102
101
 
103
102
  # ストレージ
104
- lines2, = adb_command('shell df', udid)
105
- lines2.split("\n").each_with_index do |line, index|
103
+ df_lines, = adb_command('shell df', udid)
104
+ df_lines.split("\n").each_with_index do |line, index|
106
105
  next if index.zero?
107
106
 
108
107
  columns = line.split
@@ -114,8 +113,8 @@ module Mdq
114
113
  end
115
114
 
116
115
  # MACアドレスとIPアドレス
117
- lines3, = adb_command('shell ip addr show wlan0', udid)
118
- lines3.split("\n").each do |line|
116
+ ip_lines, = adb_command('shell ip addr show wlan0', udid)
117
+ ip_lines.split("\n").each do |line|
119
118
  match = line.match('link/ether (.*?) ')
120
119
  mac_address = match[1] unless match.nil?
121
120
 
@@ -127,13 +126,15 @@ module Mdq
127
126
  end
128
127
 
129
128
  # Wi-Fi
130
- lines4, = adb_command("shell dumpsys netstats | grep -E 'iface=wlan0'", udid)
131
- lines4.split("\n").each do |line|
132
- match = line.match(' wifiNetworkKey="(.*?)"')
133
- next if match[1].nil?
134
-
135
- wifi_network = match[1]
136
- break
129
+ wifi_network = nil
130
+ wifi_lines, = adb_command("shell dumpsys netstats | grep -E 'iface=wlan0'", udid)
131
+ wifi_lines.split("\n").each do |line|
132
+ if line.include?('wifiNetworkKey=') && (match = line.match(/(wifiNetworkKey="(.*?)")/))
133
+ wifi_network = match[2]
134
+ end
135
+ if line.include?('networkId=') && (match = line.match(/(networkId="(.*?)")/))
136
+ wifi_network = match[2]
137
+ end
137
138
  end
138
139
 
139
140
  Device.create({
data/lib/mdq/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mdq
4
- VERSION = '1.5.1'
4
+ VERSION = '1.5.2'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mdq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - arthur87
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-06-20 00:00:00.000000000 Z
10
+ date: 2026-09-28 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rubocop