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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 41c3a8328216ce3f26dd0f543ca39c367cb70915
4
- data.tar.gz: bec3182f813bddc58d8d6b24e7dadbd1c54221ef
2
+ SHA256:
3
+ metadata.gz: c4893a14a5e951127278dc97ceae12d4393ffc38093aa1286cd60d461c359019
4
+ data.tar.gz: 9f00eb2d50069f359e0cda648d56275c4193328642329181242730542406dcb8
5
5
  SHA512:
6
- metadata.gz: c3098007272e22beed00654108d0016bb6dd1012362a39d6b48777c9432ec8fa058034c214fa67355b5f69bb0115fbed1249f02c54d60dacf721087c04b87cb8
7
- data.tar.gz: 64fccc074a26a01fc26987a3e53f92f2c76a1b9a86371584804faa4baa37b3b14b724dbeb2bcd0d12c215caf566fce3dc22d876bd0ba41485e39202e4d73c7e4
6
+ metadata.gz: ead382824f30028f1e10ba9def8c85ecb1a53c99fbca875f4692d16b45773bb639d4ac6842eb22040b0f2de8652748147394e7e6a183fb7953f98a98314382c2
7
+ data.tar.gz: 4263bf12e586db1511bffe8ddf1c4533fd592bbe5cf68fbbd52c778c39378be1eebc45551ff4955a472090ec695a3135544272eadecbd89d6b0ebc1920766522
@@ -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, opts.merge(app_name: @token)) }
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
@@ -1,3 +1,3 @@
1
1
  module Logplex
2
- VERSION = "0.0.3".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
@@ -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
- publisher.publish(messages)
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.3
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: 2016-12-08 00:00:00.000000000 Z
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
- rubyforge_project:
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