evrone-ci-message 0.0.4 → 0.2.0.pre0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7d81d29bc5c462f047767d8bb63970aa18aa1a9b
4
- data.tar.gz: 52557b06f73bbd5955f1789a111315c00a6a25b9
3
+ metadata.gz: 60eef0c25c034d6716080e56c3192b5b34c5fc39
4
+ data.tar.gz: d8cdb657b4fe838c25015a53b583d870a579267f
5
5
  SHA512:
6
- metadata.gz: 892a623fd87785a0ab03e0e604c2e0cf834105eed61e98b4dbcbbc2f95cebdcd29bb8da08c40608322f19e8538984130df2e8e2e819b4186458d358d93fbce63
7
- data.tar.gz: 06a1c5d3c5dc901786b044d4188841a64cf37a55255ba4338cf8933aed588477268b5d19324808226bf90d554bb8fad6bd665917a426cc7b8e5729bfd37ec53f
6
+ metadata.gz: b6fd495099b219fbac1f82a8e3f5a61dc1ce20a91129ca99766e32e4ca6f0ea8cdf00b621ffe2fdc2094c440d7d4a5ad4445eaa6fac0d45cbc8b286af1e0e731
7
+ data.tar.gz: 22c9c67b11da735af8a624894cba9d471523dffad14398ab953bd877f53f3584b08a117d7e5afd7cde22e1fe268830b6a875fa4722897924b90b6f232c024fe4
data/Rakefile CHANGED
@@ -1 +1,14 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ Bundler.require
1
4
  require "bundler/gem_tasks"
5
+ require 'rspec/core/rake_task'
6
+
7
+ RSpec::Core::RakeTask.new(:spec)
8
+
9
+ task :gen do
10
+ system %{ env BEEFCAKE_NAMESPACE="Evrone::CI::Message" protoc proto/messages.proto --beefcake_out lib/evrone/ci/message/ }
11
+ end
12
+
13
+ task :default => [:gen, :spec]
14
+ task :travis => :default
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_runtime_dependency 'ruby-protocol-buffers', '~> 1.4'
21
+ spec.add_runtime_dependency 'beefcake', '= 0.3.7'
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
@@ -1,122 +1,10 @@
1
1
  require File.expand_path("../message/version", __FILE__)
2
- require 'protocol_buffers'
3
- require 'stringio'
2
+ require File.expand_path("../message/messages.pb.rb", __FILE__)
4
3
 
5
4
  module Evrone
6
5
  module CI
7
6
  module Message
8
7
 
9
- module Serializable
10
- def to_serialized_string
11
- StringIO.open do |io|
12
- serialize(io)
13
- io.rewind
14
- io.read
15
- end
16
- end
17
- end
18
-
19
- class PerformBuild < ProtocolBuffers::Message
20
-
21
- include Serializable
22
-
23
- required :uint64, :id, 1
24
- required :string, :name, 2
25
- required :string, :src, 3
26
- required :string, :sha, 4
27
- optional :uint64, :pull_request_id, 5
28
- optional :string, :deploy_key, 6
29
-
30
- end
31
-
32
- class PerformJob < ProtocolBuffers::Message
33
-
34
- include Serializable
35
-
36
- required :uint64, :id, 1
37
- required :string, :name, 2
38
- required :string, :src, 3
39
- required :string, :sha, 4
40
- optional :uint64, :pull_request_id, 5
41
- optional :string, :deploy_key, 6
42
-
43
- required :uint64, :job_id, 7
44
-
45
- required :string, :before_script, 8
46
- required :string, :script, 9
47
-
48
- repeated :string, :matrix_keys, 10
49
- end
50
-
51
- class BuildLog < ProtocolBuffers::Message
52
-
53
- include Serializable
54
-
55
- required :uint64, :build_id, 1
56
- required :string, :log, 2
57
- required :uint64, :tm, 3
58
- required :uint32, :tm_usec, 4
59
-
60
- end
61
-
62
- class JobLog < ProtocolBuffers::Message
63
-
64
- include Serializable
65
-
66
- required :uint64, :build_id, 1
67
- required :string, :log, 2
68
- required :uint64, :tm, 3
69
- required :uint32, :tm_usec, 4
70
- required :uint64, :job_id, 5
71
-
72
- end
73
-
74
- module Status
75
-
76
- include ProtocolBuffers::Enum
77
-
78
- Pending = 0
79
- Prepared = 1
80
- Started = 2
81
- Finished = 3
82
- Broken = 4
83
- Failed = 5
84
-
85
- end
86
-
87
- class BuildStatus < ProtocolBuffers::Message
88
-
89
- include Serializable
90
-
91
- required :uint64, :build_id, 1
92
- required Status, :status, 2
93
- required :uint64, :tm, 3
94
- required :uint32, :tm_usec, 4
95
-
96
- required :uint32, :jobs_count, 5
97
- repeated :string, :matrix, 6
98
-
99
- optional :string, :commit_author, 7
100
- optional :string, :commit_author_email, 8
101
- optional :string, :commit_sha, 9
102
- optional :string, :commit_message, 10
103
-
104
- end
105
-
106
- class JobStatus < BuildStatus
107
-
108
- include Serializable
109
-
110
- required :uint64, :build_id, 1
111
- required :uint64, :job_id, 2
112
- required Status, :status, 3
113
- required :uint64, :tm, 4
114
- required :uint32, :tm_usec, 5
115
-
116
- repeated :string, :matrix, 6
117
-
118
- end
119
-
120
8
  end
121
9
  end
122
10
  end
@@ -0,0 +1,106 @@
1
+ ## Generated from proto/messages.proto for evrone.ci.message
2
+ require "beefcake"
3
+
4
+ module Evrone
5
+ module CI
6
+ module Message
7
+
8
+ class PerformBuild
9
+ include Beefcake::Message
10
+
11
+
12
+ required :id, :uint64, 1
13
+ required :name, :string, 2
14
+ required :src, :string, 3
15
+ required :sha, :string, 4
16
+ optional :pull_request_id, :uint64, 5
17
+ optional :deploy_key, :string, 6
18
+
19
+ end
20
+
21
+ class PerformJob
22
+ include Beefcake::Message
23
+
24
+
25
+ required :id, :uint64, 1
26
+ required :name, :string, 2
27
+ required :src, :string, 3
28
+ required :sha, :string, 4
29
+ optional :pull_request_id, :uint64, 5
30
+ optional :deploy_key, :string, 6
31
+ required :job_id, :uint64, 7
32
+ required :before_script, :string, 8
33
+ required :script, :string, 9
34
+ repeated :matrix_keys, :string, 10
35
+
36
+ end
37
+
38
+ class BuildLog
39
+ include Beefcake::Message
40
+
41
+
42
+ required :build_id, :uint64, 1
43
+ required :log, :string, 2
44
+ required :tm, :uint64, 3
45
+ required :tm_usec, :uint32, 4
46
+
47
+ end
48
+
49
+ class JobLog
50
+ include Beefcake::Message
51
+
52
+
53
+ required :build_id, :uint64, 1
54
+ required :log, :string, 2
55
+ required :tm, :uint64, 3
56
+ required :tm_usec, :uint32, 4
57
+ required :job_id, :uint64, 5
58
+
59
+ end
60
+
61
+ class BuildStatus
62
+ include Beefcake::Message
63
+
64
+ module Status
65
+ PENDING = 0
66
+ STARTED = 2
67
+ FINISHED = 3
68
+ BROKEN = 4
69
+ FAILED = 5
70
+ end
71
+
72
+ required :build_id, :uint64, 1
73
+ required :status, BuildStatus::Status, 2
74
+ required :tm, :uint64, 3
75
+ required :tm_usec, :uint32, 4
76
+ required :jobs_count, :uint32, 5
77
+ repeated :matrix, :string, 6
78
+ optional :commit_author, :string, 7
79
+ optional :commit_author_email, :string, 8
80
+ optional :commit_sha, :string, 9
81
+ optional :commit_message, :string, 10
82
+
83
+ end
84
+
85
+ class JobStatus
86
+ include Beefcake::Message
87
+
88
+ module Status
89
+ PENDING = 0
90
+ STARTED = 2
91
+ FINISHED = 3
92
+ BROKEN = 4
93
+ FAILED = 5
94
+ end
95
+
96
+ required :build_id, :uint64, 1
97
+ required :job_id, :uint64, 2
98
+ required :status, JobStatus::Status, 3
99
+ required :tm, :uint64, 4
100
+ required :tm_usec, :uint32, 5
101
+ repeated :matrix, :string, 6
102
+
103
+ end
104
+ end
105
+ end
106
+ end
@@ -1,7 +1,7 @@
1
1
  module Evrone
2
2
  module CI
3
3
  module Message
4
- VERSION = "0.0.4"
4
+ VERSION = "0.2.0.pre0"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,77 @@
1
+ package evrone.ci.message;
2
+
3
+ message PerformBuild {
4
+ required uint64 id = 1;
5
+ required string name = 2;
6
+ required string src = 3;
7
+ required string sha = 4;
8
+ optional uint64 pull_request_id = 5;
9
+ optional string deploy_key = 6;
10
+ }
11
+
12
+ message PerformJob {
13
+ required uint64 id = 1;
14
+ required string name = 2;
15
+ required string src = 3;
16
+ required string sha = 4;
17
+ optional uint64 pull_request_id = 5;
18
+ optional string deploy_key = 6;
19
+ required uint64 job_id = 7;
20
+ required string before_script = 8;
21
+ required string script = 9;
22
+ repeated string matrix_keys = 10;
23
+ }
24
+
25
+ message BuildLog {
26
+ required uint64 build_id = 1;
27
+ required string log = 2;
28
+ required uint64 tm = 3;
29
+ required uint32 tm_usec = 4;
30
+ }
31
+
32
+ message JobLog {
33
+ required uint64 build_id = 1;
34
+ required string log = 2;
35
+ required uint64 tm = 3;
36
+ required uint32 tm_usec = 4;
37
+ required uint64 job_id = 5;
38
+ }
39
+
40
+ message BuildStatus {
41
+ enum Status {
42
+ PENDING = 0;
43
+ STARTED = 2;
44
+ FINISHED = 3;
45
+ BROKEN = 4;
46
+ FAILED = 5;
47
+ }
48
+
49
+ required uint64 build_id = 1;
50
+ required Status status = 2;
51
+ required uint64 tm = 3;
52
+ required uint32 tm_usec = 4;
53
+ required uint32 jobs_count = 5;
54
+ repeated string matrix = 6;
55
+
56
+ optional string commit_author = 7;
57
+ optional string commit_author_email = 8;
58
+ optional string commit_sha = 9;
59
+ optional string commit_message = 10;
60
+ }
61
+
62
+ message JobStatus {
63
+ enum Status {
64
+ PENDING = 0;
65
+ STARTED = 2;
66
+ FINISHED = 3;
67
+ BROKEN = 4;
68
+ FAILED = 5;
69
+ }
70
+ required uint64 build_id = 1;
71
+ required uint64 job_id = 2;
72
+ required Status status = 3;
73
+ required uint64 tm = 4;
74
+ required uint32 tm_usec = 5;
75
+ repeated string matrix = 6;
76
+ }
77
+
@@ -15,19 +15,10 @@ describe Evrone::CI::Message do
15
15
  end
16
16
 
17
17
  it "should be successfuly serialized/deserialized" do
18
- io = StringIO.new
19
- subject.serialize(io)
20
- io.rewind
21
- obj = described_class.const_get(klass).parse(io)
18
+ bytes = subject.encode
19
+ obj = described_class.const_get(klass).decode(bytes)
22
20
  expect(obj.validate!).to be_true
23
- end
24
-
25
- it "should serialize via to_serialized_string" do
26
- io = StringIO.new
27
- subject.serialize(io)
28
- io.rewind
29
-
30
- expect(subject.to_serialized_string).to eq io.read
21
+ expect(obj).to eq subject
31
22
  end
32
23
 
33
24
  if %w{ PerformBuild PerformJob }.include?(klass)
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evrone-ci-message
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.2.0.pre0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitry Galinsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-05 00:00:00.000000000 Z
11
+ date: 2013-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: ruby-protocol-buffers
14
+ name: beefcake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.4'
19
+ version: 0.3.7
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
- version: '1.4'
26
+ version: 0.3.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -83,8 +83,10 @@ files:
83
83
  - fixtures/insecure_private_key
84
84
  - fixtures/travis.yml
85
85
  - lib/evrone/ci/message.rb
86
+ - lib/evrone/ci/message/messages.pb.rb
86
87
  - lib/evrone/ci/message/testing.rb
87
88
  - lib/evrone/ci/message/version.rb
89
+ - proto/messages.proto
88
90
  - spec/lib/message_spec.rb
89
91
  - spec/spec_helper.rb
90
92
  homepage: ''
@@ -102,9 +104,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
104
  version: '0'
103
105
  required_rubygems_version: !ruby/object:Gem::Requirement
104
106
  requirements:
105
- - - '>='
107
+ - - '>'
106
108
  - !ruby/object:Gem::Version
107
- version: '0'
109
+ version: 1.3.1
108
110
  requirements: []
109
111
  rubyforge_project:
110
112
  rubygems_version: 2.0.2