logplex 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/logplex/publisher.rb +1 -1
- data/lib/logplex/version.rb +1 -1
- data/spec/logplex/publisher_spec.rb +14 -3
- metadata +14 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c4893a14a5e951127278dc97ceae12d4393ffc38093aa1286cd60d461c359019
|
4
|
+
data.tar.gz: 9f00eb2d50069f359e0cda648d56275c4193328642329181242730542406dcb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ead382824f30028f1e10ba9def8c85ecb1a53c99fbca875f4692d16b45773bb639d4ac6842eb22040b0f2de8652748147394e7e6a183fb7953f98a98314382c2
|
7
|
+
data.tar.gz: 4263bf12e586db1511bffe8ddf1c4533fd592bbe5cf68fbbd52c778c39378be1eebc45551ff4955a472090ec695a3135544272eadecbd89d6b0ebc1920766522
|
data/lib/logplex/publisher.rb
CHANGED
@@ -19,7 +19,7 @@ module Logplex
|
|
19
19
|
unless messages.is_a? Array
|
20
20
|
message_list = [message_list]
|
21
21
|
end
|
22
|
-
message_list.map! { |m| Message.new(m,
|
22
|
+
message_list.map! { |m| Message.new(m, { app_name: @token }.merge(opts)) }
|
23
23
|
message_list.each(&:validate)
|
24
24
|
if message_list.inject(true) { |accum, m| m.valid? }
|
25
25
|
begin
|
data/lib/logplex/version.rb
CHANGED
@@ -29,13 +29,24 @@ describe Logplex::Publisher do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'sends many messages in one request when passed an array' do
|
32
|
-
Excon.stub({ method: :post, password: "t.some-token", body: /here is another/ }, status: 204)
|
33
|
-
expect(Excon).to receive(:post).once
|
32
|
+
Excon.stub({ method: :post, password: "t.some-token", body: /message for you.+here is another.+some final thoughts/ }, status: 204)
|
34
33
|
messages = ['I have a message for you', 'here is another', 'some final thoughts']
|
34
|
+
publisher = Logplex::Publisher.new('https://token:t.some-token@logplex.example.com')
|
35
|
+
publisher.publish(messages)
|
36
|
+
end
|
35
37
|
|
38
|
+
it 'uses the token if app_name is not given' do
|
39
|
+
Excon.stub({ method: :post, password: "t.some-token", body: /t.some-token/ }, status: 204)
|
40
|
+
message = 'I have a message for you'
|
36
41
|
publisher = Logplex::Publisher.new('https://token:t.some-token@logplex.example.com')
|
42
|
+
publisher.publish(message)
|
43
|
+
end
|
37
44
|
|
38
|
-
|
45
|
+
it 'uses the given app_name' do
|
46
|
+
Excon.stub({ method: :post, password: "t.some-token", body: /foo/ }, status: 204)
|
47
|
+
message = 'I have a message for you'
|
48
|
+
publisher = Logplex::Publisher.new('https://token:t.some-token@logplex.example.com')
|
49
|
+
publisher.publish(message, app_name: 'foo')
|
39
50
|
end
|
40
51
|
|
41
52
|
it 'does the thing' do
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logplex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Harold Giménez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: valcro
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
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
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: excon
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
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
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Publish and Consume Logplex messages
|
@@ -59,9 +59,9 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- .gitignore
|
63
|
-
- .rspec
|
64
|
-
- .travis.yml
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
65
|
- Gemfile
|
66
66
|
- LICENSE
|
67
67
|
- LICENSE.txt
|
@@ -86,17 +86,16 @@ require_paths:
|
|
86
86
|
- lib
|
87
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
|
-
|
99
|
-
rubygems_version: 2.0.14.1
|
98
|
+
rubygems_version: 3.0.3
|
100
99
|
signing_key:
|
101
100
|
specification_version: 4
|
102
101
|
summary: Publish and Consume Logplex messages
|