fixx 0.1.1 → 0.1.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 +4 -4
- data/bin/fixx +11 -11
- data/lib/fixx/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8e0899db70b41f4b44b2d69686364bd5f468e82
|
|
4
|
+
data.tar.gz: 8589abda9b4dc53b9cacabe6070ea7e94a71fa38
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b38567d5c80eae6270a11ab652694827e9cb8cce0aeda4f62658cd00e05c40fe0fbe408215072d3714bd0b1e8909a6a8696203b99ba161a2e2546685e1cdc8d4
|
|
7
|
+
data.tar.gz: 34dfa3a1b9334b8242ab509c1051d31d8090873072e3022d297727164c322d66d39845ccec20c7c4f4957a4ebd9056a7467d3d2c45f634ce40c2600e082d9e07
|
data/bin/fixx
CHANGED
|
@@ -4,9 +4,9 @@ require 'optparse'
|
|
|
4
4
|
|
|
5
5
|
fix_delim = "^A"
|
|
6
6
|
human_delim = " : "
|
|
7
|
-
|
|
7
|
+
extract_fields = "all"
|
|
8
8
|
heartbeats = false
|
|
9
|
-
|
|
9
|
+
message_types = "all"
|
|
10
10
|
contains_field = "all"
|
|
11
11
|
output_raw = false
|
|
12
12
|
|
|
@@ -27,16 +27,16 @@ OptionParser.new do |options|
|
|
|
27
27
|
output_raw = flag
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
options.on("-m", "--message-
|
|
31
|
-
|
|
30
|
+
options.on("-m", "--message-types t1,t2,t3", String, "Filter for specific message types (comma delimited list).") do |value|
|
|
31
|
+
message_types = value.split(",").map(&:strip)
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
options.on("-c", "--contains-field NUM", Integer, "Filter for messages that contain a particular field.") do |value|
|
|
35
35
|
contains_field = value
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
options.on("-e", "--extract-
|
|
39
|
-
|
|
38
|
+
options.on("-e", "--extract-fields f1,f2,f3", String, "Extract specific fields (comma delimited list).") do |value|
|
|
39
|
+
extract_fields = value.split(",").map{|x| x.strip.to_i}
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
options.on_tail("-h", "--help", "You're looking at it!") do
|
|
@@ -53,16 +53,16 @@ while input = ARGF.gets
|
|
|
53
53
|
|
|
54
54
|
skip = false
|
|
55
55
|
skip = true if !heartbeats && printable.include?(" 35=0 ")
|
|
56
|
-
skip = true
|
|
56
|
+
skip = true unless message_types == "all" || message_types.any?{|mt| printable.include?(" 35=#{mt} ")}
|
|
57
57
|
skip = true if contains_field != "all" && !printable.include?(" #{contains_field}=")
|
|
58
58
|
|
|
59
59
|
unless skip
|
|
60
|
-
if
|
|
61
|
-
|
|
62
|
-
if
|
|
60
|
+
if extract_fields != "all"
|
|
61
|
+
matches = extract_fields.collect{|ef| printable.match(/#{ef.to_s}=[^ ]*/)}.select{|m| !m.nil?}
|
|
62
|
+
if matches.empty?
|
|
63
63
|
skip = true
|
|
64
64
|
else
|
|
65
|
-
output_line =
|
|
65
|
+
output_line = matches.collect{|m| m[0]}.join(human_delim)
|
|
66
66
|
end
|
|
67
67
|
else
|
|
68
68
|
output_line = printable
|
data/lib/fixx/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fixx
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Corbin Fox
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-
|
|
11
|
+
date: 2017-10-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|