omnievent-api 0.1.0.pre2 → 0.1.0.pre4

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: 5f03909646c8909dcac894d052609ec5b0a337b7ade88df690029f30866b1710
4
- data.tar.gz: 2ad4e2d181f5bfd005f67515a123d276ed4852382d988844c836694decf0d010
3
+ metadata.gz: 8963380908fabe9937b9697704f1cab2702358f6e08756a4d4ccb2d3b4e86a04
4
+ data.tar.gz: 0fef4a1687c6775e8aeb4b3984bdcbc63a7b738f30fc18b6cb6e6df607af5497
5
5
  SHA512:
6
- metadata.gz: b7d06f35d21485b9a80e006dadff5cf3e3ee78966e501d12a1c2e50a20bd39ea5f25638f1488b030930a4ce883302c8d35d484974ff07e368b1fe4b94dd67fcc
7
- data.tar.gz: 8fc5203c01d016483125eef12a3264d7cd5e15fec5b0fd97b7a36f8c88c23919e48228f0085ef28145fcc53db179429757e086fff494c36725a230ca6397f41d
6
+ metadata.gz: 523d360dbb70c9569c6d1bc36682444356ec017967e860092f45ffb46b20fd2ee998bc924227bba517946173dd2d1c015387881af3dfc23282f3622739457adb
7
+ data.tar.gz: f9c6b83093296d760d0d2d53037cc1ff45d0896f2d823843d7e8d82d1ae4354d62aeaa82e7af60555e2b0da59985ce5e482d2069541368726a1886aa2f8bc56b
data/.rubocop.yml CHANGED
@@ -15,7 +15,7 @@ Metrics/BlockLength:
15
15
 
16
16
  Metrics/MethodLength:
17
17
  CountComments: false
18
- Max: 25
18
+ Max: 30
19
19
 
20
20
  Metrics/ClassLength:
21
21
  Max: 150
data/Gemfile.lock CHANGED
@@ -1,74 +1,81 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- omnievent-api (0.1.0.pre2)
4
+ omnievent-api (0.1.0.pre3)
5
5
  excon
6
6
  omnievent
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.8.1)
12
- public_suffix (>= 2.0.2, < 6.0)
11
+ addressable (2.8.7)
12
+ public_suffix (>= 2.0.2, < 7.0)
13
13
  ast (2.4.2)
14
+ bigdecimal (3.1.8)
14
15
  byebug (11.1.3)
15
- concurrent-ruby (1.1.10)
16
- crack (0.4.5)
16
+ concurrent-ruby (1.3.4)
17
+ crack (1.0.0)
18
+ bigdecimal
17
19
  rexml
18
- diff-lcs (1.5.0)
19
- excon (0.93.0)
20
- hashdiff (1.0.1)
20
+ diff-lcs (1.5.1)
21
+ excon (0.111.0)
22
+ hashdiff (1.1.1)
21
23
  hashie (5.0.0)
22
- iso-639 (0.3.5)
23
- json (2.6.2)
24
- omnievent (0.1.0.pre1)
24
+ iso-639 (0.3.6)
25
+ json (2.7.2)
26
+ language_server-protocol (3.17.0.3)
27
+ omnievent (0.1.0.pre5)
25
28
  hashie (>= 3.4.6)
26
29
  iso-639 (~> 0.3.5)
27
30
  tzinfo (~> 2.0)
28
- parallel (1.22.1)
29
- parser (3.1.2.1)
31
+ parallel (1.26.3)
32
+ parser (3.3.4.2)
30
33
  ast (~> 2.4.1)
31
- public_suffix (5.0.0)
34
+ racc
35
+ public_suffix (6.0.1)
36
+ racc (1.8.1)
32
37
  rainbow (3.1.1)
33
- rake (13.0.6)
34
- regexp_parser (2.6.0)
35
- rexml (3.2.5)
36
- rspec (3.11.0)
37
- rspec-core (~> 3.11.0)
38
- rspec-expectations (~> 3.11.0)
39
- rspec-mocks (~> 3.11.0)
40
- rspec-core (3.11.0)
41
- rspec-support (~> 3.11.0)
42
- rspec-expectations (3.11.1)
38
+ rake (13.2.1)
39
+ regexp_parser (2.9.2)
40
+ rexml (3.3.6)
41
+ strscan
42
+ rspec (3.13.0)
43
+ rspec-core (~> 3.13.0)
44
+ rspec-expectations (~> 3.13.0)
45
+ rspec-mocks (~> 3.13.0)
46
+ rspec-core (3.13.1)
47
+ rspec-support (~> 3.13.0)
48
+ rspec-expectations (3.13.2)
43
49
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.11.0)
45
- rspec-mocks (3.11.1)
50
+ rspec-support (~> 3.13.0)
51
+ rspec-mocks (3.13.1)
46
52
  diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.11.0)
48
- rspec-support (3.11.1)
49
- rubocop (1.36.0)
53
+ rspec-support (~> 3.13.0)
54
+ rspec-support (3.13.1)
55
+ rubocop (1.66.0)
50
56
  json (~> 2.3)
57
+ language_server-protocol (>= 3.17.0)
51
58
  parallel (~> 1.10)
52
- parser (>= 3.1.2.1)
59
+ parser (>= 3.3.0.2)
53
60
  rainbow (>= 2.2.2, < 4.0)
54
- regexp_parser (>= 1.8, < 3.0)
55
- rexml (>= 3.2.5, < 4.0)
56
- rubocop-ast (>= 1.20.1, < 2.0)
61
+ regexp_parser (>= 2.4, < 3.0)
62
+ rubocop-ast (>= 1.32.1, < 2.0)
57
63
  ruby-progressbar (~> 1.7)
58
- unicode-display_width (>= 1.4.0, < 3.0)
59
- rubocop-ast (1.21.0)
60
- parser (>= 3.1.1.0)
61
- ruby-progressbar (1.11.0)
62
- tzinfo (2.0.5)
64
+ unicode-display_width (>= 2.4.0, < 3.0)
65
+ rubocop-ast (1.32.2)
66
+ parser (>= 3.3.1.0)
67
+ ruby-progressbar (1.13.0)
68
+ strscan (3.1.0)
69
+ tzinfo (2.0.6)
63
70
  concurrent-ruby (~> 1.0)
64
- unicode-display_width (2.3.0)
65
- webmock (3.18.1)
71
+ unicode-display_width (2.5.0)
72
+ webmock (3.23.1)
66
73
  addressable (>= 2.8.0)
67
74
  crack (>= 0.3.2)
68
75
  hashdiff (>= 0.4.0, < 2.0.0)
69
76
 
70
77
  PLATFORMS
71
- ruby
78
+ arm64-darwin-23
72
79
 
73
80
  DEPENDENCIES
74
81
  byebug
@@ -79,4 +86,4 @@ DEPENDENCIES
79
86
  webmock
80
87
 
81
88
  BUNDLED WITH
82
- 2.3.14
89
+ 2.3.26
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniEvent
4
4
  module API
5
- VERSION = "0.1.0.pre2"
5
+ VERSION = "0.1.0.pre4"
6
6
  end
7
7
  end
@@ -54,7 +54,8 @@ module OmniEvent
54
54
  request_response = request_connection.get(request_opts)
55
55
  end
56
56
 
57
- unless request_response.status == 200
57
+ request_succeeded = [200, 201, 202, 204].include?(request_response.status)
58
+ unless request_succeeded
58
59
  message = "Failed to retrieve events from #{options.name}"
59
60
  message += ": #{request_response.body[0...300]}" if request_response.body
60
61
  log(:error, message)
@@ -62,7 +63,7 @@ module OmniEvent
62
63
 
63
64
  if opts[:raw_response]
64
65
  request_response
65
- else
66
+ elsif !request_response.body.to_s.empty?
66
67
  begin
67
68
  parsed_request_body = JSON.parse(request_response.body)
68
69
  rescue JSON::ParserError
@@ -71,6 +72,8 @@ module OmniEvent
71
72
  end
72
73
 
73
74
  parsed_request_body
75
+ else
76
+ request_succeeded
74
77
  end
75
78
  end
76
79
 
@@ -81,6 +84,13 @@ module OmniEvent
81
84
  debug: options.debug
82
85
  )
83
86
  end
87
+
88
+ def path_with_params(path, params = {})
89
+ uri = URI.parse(path)
90
+ params.reject! { |_k, v| v.to_s.strip.empty? }
91
+ uri.query = URI.encode_www_form(params) unless params.empty?
92
+ uri.to_s
93
+ end
84
94
  end
85
95
  end
86
96
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnievent-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre2
4
+ version: 0.1.0.pre4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angus McLeod
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-04 00:00:00.000000000 Z
11
+ date: 2024-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  - !ruby/object:Gem::Version
111
111
  version: 1.3.1
112
112
  requirements: []
113
- rubygems_version: 3.1.4
113
+ rubygems_version: 3.3.26
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: OmniEvent API strategy