1
0
mirror of https://github.com/cmur2/openvpn-status-web.git synced 2024-12-22 22:54:24 +01:00

gem: drop support for Rubies < 2.7

This commit is contained in:
cn 2022-05-08 16:30:19 +02:00
parent 057d243db8
commit 557a328336
5 changed files with 8 additions and 10 deletions

View File

@ -16,8 +16,6 @@ jobs:
strategy: strategy:
matrix: matrix:
ruby-version: ruby-version:
- '2.5'
- '2.6'
- '2.7' - '2.7'
- '3.0' - '3.0'
- '3.1' - '3.1'

View File

@ -3,7 +3,7 @@ require:
- rubocop-rspec - rubocop-rspec
AllCops: AllCops:
TargetRubyVersion: '2.5' TargetRubyVersion: '2.7'
NewCops: enable NewCops: enable
Gemspec/RequireMFA: Gemspec/RequireMFA:

View File

@ -13,10 +13,10 @@ module OpenVPNStatusWeb
text.lines.each do |line| text.lines.each do |line|
parts = line.strip.split(sep) parts = line.strip.split(sep)
status.client_list_headers = parts[2..-1] if parts[0] == 'HEADER' && parts[1] == 'CLIENT_LIST' status.client_list_headers = parts[2..] if parts[0] == 'HEADER' && parts[1] == 'CLIENT_LIST'
status.client_list << parse_client(parts[1..-1], status.client_list_headers) if parts[0] == 'CLIENT_LIST' status.client_list << parse_client(parts[1..], status.client_list_headers) if parts[0] == 'CLIENT_LIST'
status.routing_table_headers = parts[2..-1] if parts[0] == 'HEADER' && parts[1] == 'ROUTING_TABLE' status.routing_table_headers = parts[2..] if parts[0] == 'HEADER' && parts[1] == 'ROUTING_TABLE'
status.routing_table << parse_route(parts[1..-1], status.routing_table_headers) if parts[0] == 'ROUTING_TABLE' status.routing_table << parse_route(parts[1..], status.routing_table_headers) if parts[0] == 'ROUTING_TABLE'
status.global_stats << parse_global(parts[1..2]) if parts[0] == 'GLOBAL_STATS' status.global_stats << parse_global(parts[1..2]) if parts[0] == 'GLOBAL_STATS'
end end

View File

@ -27,9 +27,9 @@ module OpenVPNStatusWeb
status = Status.new status = Status.new
status.client_list_headers = ['Common Name', 'Real Address', 'Data Received', 'Data Sent', 'Connected Since'] status.client_list_headers = ['Common Name', 'Real Address', 'Data Received', 'Data Sent', 'Connected Since']
status.client_list = client_list[2..-1].map { |client| parse_client(client) } status.client_list = client_list[2..].map { |client| parse_client(client) }
status.routing_table_headers = ['Virtual Address', 'Common Name', 'Real Address', 'Last Ref'] status.routing_table_headers = ['Virtual Address', 'Common Name', 'Real Address', 'Last Ref']
status.routing_table = routing_table[1..-1].map { |route| parse_route(route) } status.routing_table = routing_table[1..].map { |route| parse_route(route) }
status.global_stats = global_stats.map { |global| parse_global(global) } status.global_stats = global_stats.map { |global| parse_global(global) }
status status
end end

View File

@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.executables = ['openvpn-status-web'] s.executables = ['openvpn-status-web']
s.extra_rdoc_files = Dir['README.md', 'LICENSE'] s.extra_rdoc_files = Dir['README.md', 'LICENSE']
s.required_ruby_version = '>= 2.5' s.required_ruby_version = '>= 2.7'
s.add_runtime_dependency 'metriks' s.add_runtime_dependency 'metriks'
s.add_runtime_dependency 'rack', '~> 2.0' s.add_runtime_dependency 'rack', '~> 2.0'