nwsdk 1.1.7 → 1.2.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
  SHA1:
3
- metadata.gz: ab6d501e3c2d21103c29d5ec0d83a220d6b0bff1
4
- data.tar.gz: 6f760ff695f64d1bd9466bf386b9d7290edcc045
3
+ metadata.gz: 7a304d45264e341381c2a0e8e10886f45045dec5
4
+ data.tar.gz: f7c452be1f9efb7df249355694cc7da26408add2
5
5
  SHA512:
6
- metadata.gz: c3d0ac06f3e10df9ac2cd337e25b03be6d72809295feeaa3cf41498686370c2bc5dd17bf1c91cfee6c6837ac7a9a6880a2ff8708c6df7ef16b99c88b2f7a1977
7
- data.tar.gz: 1d65cf8349dbf1eaa4484401fe987bf7d216826aabe34b6eaf8571783c1e285292cadd24e3fb9a13bbecc1af131145701deb0da5a6aaabb5f70094a479f2feff
6
+ metadata.gz: 2b95203d079251c59578bda68750abb3e6601623790301900f2cd70e220f6f03f1772817fa096ee0e0fbb31331abdf7e571909197c5b65c3af03481ae1caa592
7
+ data.tar.gz: 7538b8b208417ee47e9ad589bfa789a42dd1dfca3d7e083d4203a54eba7aa1de8910a9285cae3f4b4b830478ad19e9144f7e29148651f4c597c8013c37a60da0
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ /.idea/
1
2
  *.gem
2
3
  *.rbc
3
4
  /.config
@@ -8,6 +9,7 @@
8
9
  /test/tmp/
9
10
  /test/version_tmp/
10
11
  /tmp/
12
+ /vendor/bundle/
11
13
 
12
14
  ## Specific to RubyMotion:
13
15
  .dat*
data/bin/nw CHANGED
@@ -1,4 +1,4 @@
1
- #!/bin/env ruby
1
+ #!/usr/bin/env ruby
2
2
  $LOAD_PATH.push(File.join(File.dirname(__FILE__), "..", "lib"))
3
3
  require 'nwsdk'
4
4
  require 'nwsdk/cli'
@@ -2,7 +2,6 @@ require 'rest-client'
2
2
  require 'openssl'
3
3
  require 'json'
4
4
  require 'ipaddr'
5
- require 'pry'
6
5
  require 'nwsdk/version'
7
6
  require 'nwsdk/constants'
8
7
  require 'nwsdk/helpers'
@@ -161,23 +161,21 @@ module Nwsdk
161
161
 
162
162
  mapping = nwq.endpoint.config['cef_mapping']
163
163
 
164
- sender = case nwq.endpoint.loghost
165
- when nil
166
- CEF::UDPSender.new(options[:loghost],options[:logport])
167
- else
168
- CEF::UDPSender.new(*nwq.endpoint.loghost)
169
- end
164
+ sender = CEF.logger( config: {
165
+ receiver: options[:loghost],
166
+ port: options[:logport]
167
+ })
170
168
 
171
169
  result.each do |res|
172
- event=CEF::Event.new
170
+ event=CEF.event
173
171
  event_fields=mapping.keys & res.keys
174
172
  event_fields.each do |field|
175
173
  event.send('%s=' % mapping[field],res[field].to_s)
176
174
  end
177
175
  nwq.endpoint.config['cef_static_fields'].each {|k,v| event.send('%s='%k,v)}
178
176
  event.name=options[:name]
179
- event.endTime=(res['time'].to_i * 1000).to_s
180
- puts event.to_s
177
+ event.endTime=res['time']
178
+ puts event.to_cef
181
179
  sender.emit(event)
182
180
  end
183
181
  end
@@ -12,8 +12,8 @@ module Nwsdk
12
12
  when 10,11
13
13
  field['value'].to_f
14
14
  when 32
15
- t=Time.at(field['value'].to_i)
16
- t + t.gmtoff
15
+ Time.at(field['value'].to_i).utc
16
+ #t + t.gmtoff
17
17
  when 33
18
18
  Nwsdk::Constants::NW_VARIANT_DAYS[field['value'].to_i]
19
19
  when 128,129
@@ -1,3 +1,3 @@
1
1
  module Nwsdk
2
- VERSION = '1.1.7'
2
+ VERSION = '1.2.0'
3
3
  end
@@ -19,16 +19,16 @@ Gem::Specification.new do |spec|
19
19
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_dependency 'cef', '~> 1.0'
23
- spec.add_dependency 'chronic', '0.10.2'
24
- spec.add_dependency 'rest-client', '~> 1.8'
25
- spec.add_dependency 'thor', '~> 0.19'
22
+ spec.add_dependency 'cef', '2.1.1pre'
23
+ spec.add_dependency 'chronic'
24
+ spec.add_dependency 'rest-client'
25
+ spec.add_dependency 'thor'
26
26
 
27
- spec.add_development_dependency 'pry', '~> 0.10'
28
- spec.add_development_dependency 'bundler', '~> 1.10'
29
- spec.add_development_dependency 'rake', '~> 10.0'
30
- spec.add_development_dependency 'rspec', '~> 3.3'
31
- spec.add_development_dependency 'guard', '~> 2.13'
32
- spec.add_development_dependency 'guard-rspec', '~> 4.6'
33
- spec.add_development_dependency 'simplecov', '~> 0.10'
27
+ spec.add_development_dependency 'pry'
28
+ spec.add_development_dependency 'bundler'
29
+ spec.add_development_dependency 'rake'
30
+ spec.add_development_dependency 'rspec'
31
+ spec.add_development_dependency 'guard'
32
+ spec.add_development_dependency 'guard-rspec'
33
+ spec.add_development_dependency 'simplecov'
34
34
  end
metadata CHANGED
@@ -1,169 +1,169 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nwsdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Breed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-05 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cef
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: 2.1.1pre
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: 2.1.1pre
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: chronic
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.10.2
33
+ version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.10.2
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rest-client
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.8'
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.8'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: thor
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.19'
61
+ version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0.19'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '0.10'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '0.10'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '1.10'
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '1.10'
96
+ version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: '10.0'
103
+ version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: '10.0'
110
+ version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: '3.3'
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: '3.3'
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: guard
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '2.13'
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '2.13'
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: guard-rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - "~>"
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
- version: '4.6'
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - "~>"
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
- version: '4.6'
152
+ version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: simplecov
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - "~>"
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
- version: '0.10'
159
+ version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - "~>"
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: '0.10'
166
+ version: '0'
167
167
  description: " allows users to run queries, extracts, and generate cef alerts "
168
168
  email:
169
169
  - ryan.breed@ercot.com
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
213
213
  version: '0'
214
214
  requirements: []
215
215
  rubyforge_project:
216
- rubygems_version: 2.4.5.1
216
+ rubygems_version: 2.5.1
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: small wrapper around netwitness REST API