loggregator_emitter 0.0.3.pre → 0.0.4.pre

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- loggregator_emitter (0.0.3.pre)
4
+ loggregator_emitter (0.0.4.pre)
5
5
  loggregator_messages (~> 0.0.1.pre)
6
6
 
7
7
  GEM
@@ -1,6 +1,5 @@
1
1
  require "loggregator_messages"
2
2
  require 'socket'
3
- require "steno"
4
3
 
5
4
  module LoggregatorEmitter
6
5
  class Emitter
@@ -13,13 +12,13 @@ module LoggregatorEmitter
13
12
  @source_type = source_type
14
13
  end
15
14
 
16
- def emit(target, message)
15
+ def emit(app_id, message)
17
16
  s = UDPSocket.new
18
17
  s.do_not_reverse_lookup = true
19
18
  lm = LogMessage.new()
20
19
  lm.timestamp = Time.now.to_i
21
20
  lm.message = message
22
- lm.app_id = target.app_id
21
+ lm.app_id = app_id
23
22
  lm.source_type = @source_type
24
23
  lm.message_type = LogMessage::MessageType::OUT
25
24
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "loggregator_emitter"
5
- spec.version = '0.0.3.pre'
5
+ spec.version = '0.0.4.pre'
6
6
  spec.authors = ["Pivotal"]
7
7
  spec.email = ["cf-eng@pivotallabs.com"]
8
8
  spec.description = "Library to emit data to Loggregator"
@@ -1,11 +1,8 @@
1
1
  require 'support/fake_loggregator_server'
2
2
  require 'loggregator_emitter/emit'
3
- require 'loggregator_emitter/target'
4
3
 
5
4
  describe LoggregatorEmitter do
6
5
 
7
- let(:target) { LoggregatorEmitter::Target.new('appId') }
8
-
9
6
  describe 'configuring emitter' do
10
7
 
11
8
  it 'can be configured' do
@@ -34,8 +31,8 @@ describe LoggregatorEmitter do
34
31
  server = FakeLoggregatorServer.new(12345)
35
32
  server.start
36
33
 
37
- @emitter.emit(target, 'Hello there!')
38
- @emitter.emit(target, 'Hello again!')
34
+ @emitter.emit("my_app_id", 'Hello there!')
35
+ @emitter.emit("my_app_id", 'Hello again!')
39
36
 
40
37
  server.stop(2)
41
38
 
@@ -44,7 +41,7 @@ describe LoggregatorEmitter do
44
41
  expect(messages.length).to eq 2
45
42
  message = messages[0]
46
43
  expect(message.message).to eq 'Hello there!'
47
- expect(message.app_id).to eq target.app_id
44
+ expect(message.app_id).to eq "my_app_id"
48
45
  expect(message.source_type).to eq LogMessage::SourceType::CLOUD_CONTROLLER
49
46
 
50
47
  message = messages[1]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loggregator_emitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3.pre
4
+ version: 0.0.4.pre
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -91,7 +91,6 @@ files:
91
91
  - Rakefile
92
92
  - lib/loggregator_emitter.rb
93
93
  - lib/loggregator_emitter/emit.rb
94
- - lib/loggregator_emitter/target.rb
95
94
  - loggregator_emitter.gemspec
96
95
  - spec/loggregator_emitter/emit_spec.rb
97
96
  - spec/support/fake_loggregator_server.rb
@@ -1,9 +0,0 @@
1
- module LoggregatorEmitter
2
- class Target
3
- attr_reader :app_id
4
-
5
- def initialize(app_id)
6
- @app_id = app_id
7
- end
8
- end
9
- end