xlo 0.0.0 → 0.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/xlo +7 -0
  3. data/lib/xlo.rb +8 -11
  4. metadata +6 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e52351d89689492655e87f6a477d9df91f9c545
4
- data.tar.gz: 8be829ab65292a868b19eb6026fd88753fa0f950
3
+ metadata.gz: 7377477ee407161473d28cc2c3f274ed78d87006
4
+ data.tar.gz: e39d15e5c2ff4a1e6c066199b234659a95b09235
5
5
  SHA512:
6
- metadata.gz: 603e7e7d121acf83e34f5b658482db37965ea950f59c68ed1ce927f9eeb85f5028fbae1494b4f0d46fdd45b8924d97bb3ed8efe9de4dec56143665d1a8fd1117
7
- data.tar.gz: 7eca0e9c62efd6a5eebb2798de5048778bfc50246c0c18cc83213327e27c3a1a16dbb6520c336df86865257afcba3ec0fc107fb0305afa57cf4e5ed8eb82e8d2
6
+ metadata.gz: 6be9c0aada7cbbc277a528fb695c10e88b55e52c18a99a48f66b1be633d0cdeccc234460f6de870e20e31bd78492e0c432b8288c97df68aea812fa51021e06e2
7
+ data.tar.gz: c102d394a735d47f866752c85d00bb12085530d73f9de1833dc9283cb46b5573b7cfafd7f954c641cfca5612b2e21102642cec88ff80fc3031fd09c259fdcb72
data/bin/xlo ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'xlo'
4
+ rnv_arg = ARGV.shift
5
+ xmllint_arg = ARGV.shift
6
+ raise "missing argument(s) !" unless rnv_arg
7
+ Xlo.main(rnv_arg,xmllint_arg)
data/lib/xlo.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  class Xlo
2
2
 
3
- def fill_list (_dir)
3
+ def self.fill_list (_dir)
4
4
  list = []
5
5
  Dir[_dir + "/" + "*.log"].each do |file|
6
6
  p file
@@ -15,7 +15,7 @@ class Xlo
15
15
  return list
16
16
  end
17
17
 
18
- def create_error_dict (_list)
18
+ def self.create_error_dict (_list)
19
19
  error = {}
20
20
  _list.each do |el|
21
21
  type = el.split("error")[1].split(" ")[1]
@@ -31,7 +31,7 @@ class Xlo
31
31
  return error
32
32
  end
33
33
 
34
- def xmllint_error (_file,_error_dict)
34
+ def self.xmllint_error (_file,_error_dict)
35
35
  list = []
36
36
  File.open(_file).each do |line|
37
37
  if (!line.include?("^\n"))
@@ -53,20 +53,17 @@ class Xlo
53
53
  end
54
54
  end
55
55
 
56
- def self.main
57
- rnv_arg = ARGV.shift
58
- xmllint_arg = ARGV.shift
59
- raise "missing argument" unless rnv_arg
56
+ def self.main(_rnv_arg,_xmllint_arg)
60
57
 
61
58
  f = File.new("error.csv", "w+")
62
59
  f.write("type; error; freq; files \n")
63
- error = create_error_dict(fill_list(rnv_arg))
60
+ error = self.create_error_dict(self.fill_list(_rnv_arg))
64
61
 
65
- if (xmllint_arg != nil)
66
- xmllint_error(xmllint_arg, error)
62
+ if (_xmllint_arg != nil)
63
+ xmllint_error(_xmllint_arg, error)
67
64
  end
68
65
  error.each do |entry|
69
- freq = entry[1].split("||").length.to_s
66
+ freq = entry[1].split(" ").length.to_s
70
67
  f.write(entry.insert(1, freq).join("; ")[0..-2] + "\n" )
71
68
  end
72
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Meoni
@@ -10,12 +10,14 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: A simple hello world gem
13
+ description: An aggregator of xml log for rnv and xmllint error
14
14
  email: simonmeoni@aol.com
15
- executables: []
15
+ executables:
16
+ - xlo
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
20
+ - bin/xlo
19
21
  - lib/xlo.rb
20
22
  homepage: http://rubygems.org/gems/xlo
21
23
  licenses:
@@ -40,5 +42,5 @@ rubyforge_project:
40
42
  rubygems_version: 2.2.2
41
43
  signing_key:
42
44
  specification_version: 4
43
- summary: an aggregator of xml log for rnv and xmllint error
45
+ summary: xml log overview
44
46
  test_files: []