hachi 0.2.1 → 0.2.2

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: a319c1c79696358c41de7fa1df683d09162eb41b9c19b28fb5ffa56bd9da89b7
4
- data.tar.gz: 0fe4dc40cd59d0b794009d2ba91e7c1330f84bc689f2236963b618c2ec511fb1
3
+ metadata.gz: efe04e36b93c8278ea1c128e7aa38135d33468c904ad3434dbcc6c7dc7707478
4
+ data.tar.gz: caaa81f78a086e6dba10e54f977018fbc19f5485559a59d15047a152d1780d9b
5
5
  SHA512:
6
- metadata.gz: 4dc84dd512c59811549ecf92e35d78eee5a843d4ec0cf45798b01b4573bd4d819fb32be67a0a7560a57b1b86e75d56d4a804e2e639f52d759bb2f3ed6c185fb0
7
- data.tar.gz: 05b182a298cce9505a70fc5654c87990b8fe377255816fa83422a7a09ce0e36033606f602effc09ddf6ff68d1266550d7dd3239e50daceb5d16cc79c65752e63
6
+ metadata.gz: 75a96eb5ad3cea0bf65ec999ab14e27bbc081bc5e1315e231a9e1aac27c0db69caf1cc7820d1f782ba8cdcd25cc37606b6be0ea52abe8aa53b357781c1294217
7
+ data.tar.gz: 87d6925a83d4faf2d544648d47b6c0caa82641fa25fcf0a138d35c0061a5a421aba6491c7391e9211101ded22f7308b18f49da5d73adf86143068450107bcad7
@@ -36,7 +36,7 @@ module Hachi
36
36
  post("/api/alert", alert.payload) { |json| json }
37
37
  end
38
38
 
39
- def search(attributes:, range: "all")
39
+ def search(attributes, range: "all")
40
40
  _search("/api/alert/_search", attributes: attributes, range: range) { |json| json }
41
41
  end
42
42
  end
@@ -66,8 +66,7 @@ module Hachi
66
66
 
67
67
  code = response.code
68
68
  unless code.start_with? "20"
69
- message = json.dig("message")
70
- raise Error, "Unsupported response code returned: #{code} (#{message})"
69
+ raise Error, "Unsupported response code returned: #{code} (#{json})"
71
70
  end
72
71
 
73
72
  yield json
@@ -62,7 +62,7 @@ module Hachi
62
62
  def validate_date
63
63
  DateTime.parse(date)
64
64
  true
65
- rescue ArgumentError => _
65
+ rescue ArgumentError => _e
66
66
  raise ArgumentError, "date should be Date format"
67
67
  end
68
68
 
@@ -23,7 +23,6 @@ module Hachi
23
23
  raise ArgumentError, "status should be New, Updated, Ignored or Imported"
24
24
  end
25
25
 
26
-
27
26
  def validate_tags
28
27
  raise ArgumentError, "tags should be an array" unless tags.is_a?(Array)
29
28
  end
@@ -47,7 +47,7 @@ module Hachi
47
47
  def validate_start_date
48
48
  DateTime.parse(start_date)
49
49
  true
50
- rescue ArgumentError => _
50
+ rescue ArgumentError => _e
51
51
  raise ArgumentError, "date should be Date format"
52
52
  end
53
53
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hachi
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hachi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-08 00:00:00.000000000 Z
11
+ date: 2019-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.0.2
147
+ rubygems_version: 3.0.4
148
148
  signing_key:
149
149
  specification_version: 4
150
150
  summary: A dead simple TheHive API wrapper.