le 2.2.6 → 2.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/LE.gemspec +1 -1
  2. data/lib/le/host/http.rb +15 -1
  3. metadata +12 -9
  4. checksums.yaml +0 -7
data/LE.gemspec CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.join(dir, 'lib', 'le'))
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "le"
6
- s.version = "2.2.6"
6
+ s.version = "2.2.8"
7
7
  s.date = Time.now
8
8
  s.summary = "Logentries plugin"
9
9
  s.description =<<EOD
data/lib/le/host/http.rb CHANGED
@@ -6,6 +6,7 @@ require 'uri'
6
6
  module Le
7
7
  module Host
8
8
  class HTTP
9
+ LIBRARY_IDENTIFIER = '###R01### - Library initialised'
9
10
  API_SERVER = 'api.logentries.com'
10
11
  API_PORT = 10000
11
12
  API_SSL_PORT = 20000
@@ -58,6 +59,8 @@ S5ol3bQmY1mv78XKkOk=
58
59
  @debug = debug
59
60
  @ssl = ssl
60
61
  @queue = Queue.new
62
+ # Add identifer msg to queue to be sent first
63
+ @queue << "#{@token}#{LIBRARY_IDENTIFIER}\n"
61
64
  @started = false
62
65
  @thread = nil
63
66
 
@@ -85,7 +88,12 @@ S5ol3bQmY1mv78XKkOk=
85
88
  @logger_console.add(Logger::Severity::UNKNOWN, message)
86
89
  end
87
90
 
88
- @queue << "#{ @token }#{ message }\n"
91
+ if message.scan(/\n/).empty?
92
+ @queue << "#{ @token } #{ message }\n"
93
+ else
94
+ @queue << "#{ message.gsub(/^/, "\1#{ @token } [#{ random_message_id }] ") }\n"
95
+ end
96
+
89
97
 
90
98
  if @started
91
99
  check_async_thread
@@ -190,6 +198,12 @@ S5ol3bQmY1mv78XKkOk=
190
198
 
191
199
  closeConnection
192
200
  end
201
+
202
+ private
203
+ def random_message_id
204
+ @random_message_id_sample_space ||= ('0'..'9').to_a + ('A'..'Z').to_a
205
+ (0..5).map{ @random_message_id_sample_space.sample }.join
206
+ end
193
207
  end
194
208
  end
195
209
  end
metadata CHANGED
@@ -1,47 +1,50 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: le
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.8
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Mark Lacomber
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-05-01 00:00:00.000000000 Z
12
+ date: 2014-05-23 00:00:00.000000000 Z
12
13
  dependencies: []
13
- description: |2+
14
+ description: ! '
14
15
 
16
+ '
15
17
  email: mark.lacomber@logentries.com
16
18
  executables: []
17
19
  extensions: []
18
20
  extra_rdoc_files: []
19
21
  files:
20
22
  - LE.gemspec
21
- - ./lib/le/host.rb
22
23
  - ./lib/le/host/http.rb
24
+ - ./lib/le/host.rb
23
25
  - ./lib/le.rb
24
26
  homepage: https://github.com/logentries/le_ruby
25
27
  licenses: []
26
- metadata: {}
27
28
  post_install_message:
28
29
  rdoc_options: []
29
30
  require_paths:
30
31
  - lib
31
32
  required_ruby_version: !ruby/object:Gem::Requirement
33
+ none: false
32
34
  requirements:
33
- - - '>='
35
+ - - ! '>='
34
36
  - !ruby/object:Gem::Version
35
37
  version: '0'
36
38
  required_rubygems_version: !ruby/object:Gem::Requirement
39
+ none: false
37
40
  requirements:
38
- - - '>='
41
+ - - ! '>='
39
42
  - !ruby/object:Gem::Version
40
43
  version: '0'
41
44
  requirements: []
42
45
  rubyforge_project:
43
- rubygems_version: 2.1.8
46
+ rubygems_version: 1.8.11
44
47
  signing_key:
45
- specification_version: 4
48
+ specification_version: 3
46
49
  summary: Logentries plugin
47
50
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 95e33aa12863a40a88637ef6f7214b555f42aba2
4
- data.tar.gz: 091913be55b8bba88a4a02659d10b0d31ba88ef2
5
- SHA512:
6
- metadata.gz: eea6c335451371687836899fa3690b9dade229d0452ee92e966c2afd7b9da99bc75c556cd4f0eb70f36f7c5c1d608ea217ad0836e2d436bb1fc7beba17595315
7
- data.tar.gz: a6f39422d50728f71fa975fbc2c640325266f468f3b7fea5d2b731c071d27740a55354efa8e84dbce4a6726eef1e2952d2cdec9de3cecdef8a68f2bb025d8ad0