data_collector 0.14.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7d17ac7ab078aa43066b823b88804b6b60e4ced14ce24c8bd70b753a0fa398c3
4
- data.tar.gz: a0addc490c09e2c7b928c1e9495bcf5b85a5d9c6dcebf8645026d57e9f4c9e47
3
+ metadata.gz: 05eee6a12f06a0d94c8ad6b0e39746a169622bf51c0b4cd142bc8445ab8917eb
4
+ data.tar.gz: e0c9aa6d5b397b393ca4348b7b1b38f451c8e6dae79dd202ab695c8244e7974f
5
5
  SHA512:
6
- metadata.gz: 1e38738404baf8d95d9f8021015755cf5e5f98031c73cab1bb0e3415ceee145f5650defecf5b799fa5fd44eb72138d918da942323082598fdb8a36ca820925c2
7
- data.tar.gz: d0574054e5636e43460644c18aa5d1ccc753fa3c321a91fb7604472530f57b3dec69c2fa6ef2a86d1b0124c92ba865cd45fd7e2e553290c234c6a4f926986b6b
6
+ metadata.gz: 3dc5ea1eacbbd11c71e3e7139f59130a0e54318638928025553bbe6deed2b528df77360f55c7821baca208b3b84c55ac85df7db84a327157ff1e80f5b4ad0344
7
+ data.tar.gz: d9d6cf588e3c379e0a09c45dfe68ab339ad372c48c2602e1b71cf66c7f9523fb4457ec8d2deabc7c6bdb5d2ac8919ece131b5ef66df1616c7baddfff80298762
@@ -16,6 +16,7 @@ module DataCollector
16
16
  def input
17
17
  @input ||= DataCollector::Input.new
18
18
  end
19
+ module_function :input
19
20
 
20
21
  # Output is an object you can store data that needs to be written to an output stream
21
22
  # output[:name] = 'John'
@@ -48,6 +49,7 @@ module DataCollector
48
49
  def output
49
50
  @output ||= Output.new
50
51
  end
52
+ module_function :output
51
53
 
52
54
  #You can apply rules to input
53
55
  # A rule is made up of a Hash the key is the map key field its value is a Hash with a JSONPath filter and
@@ -79,11 +81,13 @@ module DataCollector
79
81
  def rules
80
82
  @rules ||= Rules.new
81
83
  end
84
+ module_function :rules
82
85
 
83
86
  # New rules runner
84
87
  def rules_ng
85
88
  @rules_ng ||= RulesNg.new
86
89
  end
90
+ module_function :rules_ng
87
91
 
88
92
  # evaluator http://jsonpath.com/
89
93
  # uitleg http://goessner.net/articles/JsonPath/index.html
@@ -104,15 +108,18 @@ module DataCollector
104
108
  @logger.error("#{filter_path} failed: #{e.message}")
105
109
  []
106
110
  end
111
+ module_function :filter
107
112
 
108
113
  def config
109
114
  @config ||= ConfigFile
110
115
  end
116
+ module_function :config
111
117
 
112
118
  def log(message)
113
119
  @logger ||= Logger.new(STDOUT)
114
120
  @logger.info(message)
115
121
  end
122
+ module_function :log
116
123
 
117
124
  end
118
125
 
@@ -55,7 +55,7 @@ module DataCollector
55
55
  record = [record]
56
56
  end
57
57
 
58
- data = DataCollector::Core::filter(record, filter_path)
58
+ data = Core::filter(record, filter_path)
59
59
 
60
60
  if data && rule_options
61
61
  if rule_options.key?('convert')
@@ -110,7 +110,7 @@ module DataCollector
110
110
  return data if input_data.nil? || input_data.empty?
111
111
  return input_data if input_data.is_a?(String)
112
112
 
113
- DataCollector::Core.filter(input_data, filter)
113
+ Core.filter(input_data, filter)
114
114
  end
115
115
  end
116
116
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module DataCollector
3
- VERSION = "0.14.0"
3
+ VERSION = "0.16.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Celik