kanrisuru 0.19.0 → 0.19.4

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: 80ead7b757f8228b63f2908df9163f726e99ec27dcd2b88f7a5ff197e98f8008
4
- data.tar.gz: 8393af4b3e03f583981b06eaa384b47527882870289df125d4887f98abb293b2
3
+ metadata.gz: ef72387ee3392fab30d54254e7226e066d943757b686bd1e66fea0fc1bd58181
4
+ data.tar.gz: eb829fe3e5d90968c17cfa9922161505f4fbdce4a44da5524f35ad23967c7335
5
5
  SHA512:
6
- metadata.gz: 2268c08d84aa9cf09232900c7d2ccd489cb9de12aa77c3fdc9666eb8859d41b072a932d0afb0d6ed2818978e641dee1569ddeda30f417466f7bd1a8150206cb9
7
- data.tar.gz: e4ef880302b200deafb4c69e703cfb79fc4162d20d6b6269a635e0277f790c4c872299513cab53edeb395f20e15660fda09ba7d0c135b8ebf97d67b7464e1859
6
+ metadata.gz: 9e6b315320713f79f5693b6a21269dcadbf6327efae5ab8dc4287165ebfd6f0c05cc221cb351911f669f71b1812ac3a43884ed978ef64422f07a3beab835ec4a
7
+ data.tar.gz: 21e425b548076e932aa9770f4a0827e3252b6dba3869e90d219bbf3e70d983fadb87f14b7ed1747f3c4c569c109901e4da708211816573c963c96bd3977bee24
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## Kanrisuru 0.19.4 (February 19, 2022) ##
2
+ * Add additional family types to `ss` command.
3
+
4
+ ## Kanrisuru 0.19.3 (February 19, 2022) ##
5
+ * Fix bug in `ss` command with passing opts to parser.
6
+
7
+ ## Kanrisuru 0.19.2 (February 02, 2022) ##
8
+ * Add `to_h` to result class.
9
+
10
+ ## Kanrisuru 0.19.1 (February 02, 2022) ##
11
+ * Fix `load_env` command with parsing output, use `to_a` for cleaner newline parsing.
12
+
1
13
  ## Kanrisuru 0.19.0 (January 25, 2022) ##
2
14
  * Add readonly version of `sysctl` command with test cases.
3
15
 
@@ -36,7 +36,7 @@ module Kanrisuru
36
36
  execute_shell(command)
37
37
 
38
38
  Kanrisuru::Result.new(command) do |cmd|
39
- Parser::Ss.parse(cmd, state)
39
+ Parser::Ss.parse(cmd, state, opts)
40
40
  end
41
41
  end
42
42
  end
@@ -22,7 +22,7 @@ module Kanrisuru
22
22
  }.freeze
23
23
 
24
24
  NETWORK_FAMILIES = %w[
25
- unix inet inet6 link netlink
25
+ unix inet inet6 link netlink vsock xdp
26
26
  ].freeze
27
27
  end
28
28
  end
@@ -6,7 +6,7 @@ module Kanrisuru
6
6
  module Parser
7
7
  class Ss
8
8
  class << self
9
- def parse(command, state)
9
+ def parse(command, state, opts)
10
10
  rows = []
11
11
 
12
12
  ## New lines with tabs are from text overflow
@@ -6,12 +6,11 @@ module Kanrisuru
6
6
  module Parser
7
7
  class LoadEnv
8
8
  def self.parse(command)
9
- string = command.to_s
9
+ rows = command.to_a
10
10
  hash = {}
11
11
 
12
- rows = string.split("\n")
13
12
  rows.each do |row|
14
- key, value = row.split('=', 2)
13
+ key, value = row.split('=')
15
14
  hash[key] = value
16
15
  end
17
16
 
@@ -35,6 +35,10 @@ module Kanrisuru
35
35
  @data.to_s
36
36
  end
37
37
 
38
+ def to_h
39
+ @data.to_h
40
+ end
41
+
38
42
  def to_a
39
43
  @data.instance_of?(Array) ? @data : [@data]
40
44
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Kanrisuru
4
- VERSION = '0.19.0'
4
+ VERSION = '0.19.4'
5
5
  end
@@ -42,7 +42,7 @@ RSpec.describe Kanrisuru::Core::Socket do
42
42
  )
43
43
  expect(Kanrisuru::Core::Socket::NETWORK_FAMILIES).to eq(
44
44
  %w[
45
- unix inet inet6 link netlink
45
+ unix inet inet6 link netlink vsock xdp
46
46
  ]
47
47
  )
48
48
  expect(Kanrisuru::Core::Socket::OTHER_STATES).to eq(
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kanrisuru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0
4
+ version: 0.19.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mammina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-25 00:00:00.000000000 Z
11
+ date: 2022-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel_tests