loggregator_messages 0.0.1.pre → 0.0.2.pre

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1 +1,2 @@
1
+ .idea
1
2
  pkg/
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- loggregator_messages (0.0.1.pre)
4
+ loggregator_messages (0.0.2.pre)
5
5
  beefcake (~> 0.3.7)
6
6
 
7
7
  GEM
@@ -2,4 +2,12 @@ class LogMessage
2
2
  def message_type_name
3
3
  {MessageType::OUT => 'STDOUT', MessageType::ERR => 'STDERR'}[message_type]
4
4
  end
5
- end
5
+
6
+ def source_type_name
7
+ {SourceType::CLOUD_CONTROLLER => 'CloudController',
8
+ SourceType::ROUTER => 'Router',
9
+ SourceType::UAA => 'UAA',
10
+ SourceType::DEA => 'DEA',
11
+ SourceType::WARDEN_CONTAINER => 'WardenContainer',}[source_type]
12
+ end
13
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "loggregator_messages"
5
- spec.version = '0.0.1.pre'
5
+ spec.version = '0.0.2.pre'
6
6
  spec.authors = ["Pivotal"]
7
7
  spec.email = ["cf-eng@pivotallabs.com"]
8
8
  spec.description = "Library for all of the protocol buffer messages."
@@ -27,4 +27,63 @@ describe LogMessage do
27
27
  expect(msg.message_type_name).to eq("STDERR")
28
28
  end
29
29
  end
30
- end
30
+
31
+ describe "#source_type_name" do
32
+ it "returns CloudController for type == 1" do
33
+ msg = LogMessage.new(
34
+ {
35
+ :message => "thesearebytes",
36
+ :message_type => 1,
37
+ :timestamp => 3,
38
+ :source_type => 1
39
+ })
40
+
41
+ expect(msg.source_type_name).to eq("CloudController")
42
+ end
43
+
44
+ it "returns Router for type == 2" do
45
+ msg = LogMessage.new(
46
+ {
47
+ :message => "thesearebytes",
48
+ :message_type => 2,
49
+ :timestamp => 3,
50
+ :source_type => 2
51
+ })
52
+
53
+ expect(msg.source_type_name).to eq("Router")
54
+ end
55
+ it "returns UAA for type == 3" do
56
+ msg = LogMessage.new(
57
+ {
58
+ :message => "thesearebytes",
59
+ :message_type => 2,
60
+ :timestamp => 3,
61
+ :source_type => 3
62
+ })
63
+
64
+ expect(msg.source_type_name).to eq("UAA")
65
+ end
66
+ it "returns DEA for type == 4" do
67
+ msg = LogMessage.new(
68
+ {
69
+ :message => "thesearebytes",
70
+ :message_type => 2,
71
+ :timestamp => 3,
72
+ :source_type => 4
73
+ })
74
+
75
+ expect(msg.source_type_name).to eq("DEA")
76
+ end
77
+ it "returns WardenContainer for type == 5" do
78
+ msg = LogMessage.new(
79
+ {
80
+ :message => "thesearebytes",
81
+ :message_type => 2,
82
+ :timestamp => 3,
83
+ :source_type => 5
84
+ })
85
+
86
+ expect(msg.source_type_name).to eq("WardenContainer")
87
+ end
88
+ end
89
+ end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loggregator_messages
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre
4
+ version: 0.0.2.pre
5
+ prerelease: 6
5
6
  platform: ruby
6
7
  authors:
7
8
  - Pivotal
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-08-20 00:00:00.000000000 Z
12
+ date: 2013-08-29 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: beefcake
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: bundler
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -60,26 +65,27 @@ files:
60
65
  homepage: http://github.com/cloudfoundry/loggregator_messages
61
66
  licenses:
62
67
  - Apache 2.0
63
- metadata: {}
64
68
  post_install_message:
65
69
  rdoc_options: []
66
70
  require_paths:
67
71
  - lib
68
72
  required_ruby_version: !ruby/object:Gem::Requirement
73
+ none: false
69
74
  requirements:
70
75
  - - ! '>='
71
76
  - !ruby/object:Gem::Version
72
77
  version: 1.9.3
73
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
+ none: false
74
80
  requirements:
75
81
  - - ! '>'
76
82
  - !ruby/object:Gem::Version
77
83
  version: 1.3.1
78
84
  requirements: []
79
85
  rubyforge_project:
80
- rubygems_version: 2.0.4
86
+ rubygems_version: 1.8.25
81
87
  signing_key:
82
- specification_version: 4
88
+ specification_version: 3
83
89
  summary: Library for all of the protocol buffer messages.
84
90
  test_files:
85
91
  - spec/log_message_extender_spec.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzAwYmFmNWQ0ZWQ4NmYyNjRmMGNkMTllMWYxMmYyZTA2NmVhMjEwMA==
5
- data.tar.gz: !binary |-
6
- M2Y2N2ZlNTY1MjdkZjkzNGMyOGNkZWEyYTVkNDg3OTg0NGE1Zjc5Yw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ZWZmODNjYmI3NmNjNzhhNDUwMmY2ZDliMTZjMDBjOTk5ZDIxNmU3ODA3MjY0
10
- Y2YzNzgzNjU5MWU0MzFiMmRiNTNiZTc0MWFjMTVlNmFjY2RlMzliZTY3ODk5
11
- OTkzYTcwM2ZjZTYyYzIxYTg0OWI1YWZmZTZmZmJjYzYwMWUyYmQ=
12
- data.tar.gz: !binary |-
13
- ODVlM2U1NWU5NzM3MDkwZWU2NmI3ZjM0NDAwZTYzYmRjMjQxZDUzN2FmMmE3
14
- Y2JjNzIwMDdkMWE3ZTYyODdkOTk3MGI1YWJiZjBhMWE0YWI2YzZlYjAzMThl
15
- OTk4NDBhMmQ5YjM2MjI0ZDczMDViM2YyN2E3YmE0MzExOGU5OGM=