protobuffy 3.2.0 → 3.3.0

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
- ---
2
- SHA1:
3
- metadata.gz: cc8e8aa7b3ed82b4a15558414ef537ada9e5f84a
4
- data.tar.gz: d13a9ec3b735bea4184385b36ff0b7e53f9b8f6d
5
- SHA512:
6
- metadata.gz: 63d3029e746e4b9cf5c294f8eb172519170266b0a2c161fc24a92d1fd76e47fcd668f5040b70e24cba5e7abd99848a2c04b334afb19fc5bfa72f2c3ac4653cb2
7
- data.tar.gz: e94dcd1103b54ad56b5a56d1272f3a408e3c305f0083387a98018ce9858efd5b380df6b59acfda296f535a6ac48d847a721da5ffb0540beb085e16387501762f
1
+ ---
2
+ SHA1:
3
+ metadata.gz: fded4f8c03d73d4dc626afa2bc083857a917275f
4
+ data.tar.gz: 17335b69a9f993d886be9939123d668eb78d4c25
5
+ SHA512:
6
+ metadata.gz: a798e6c752344c67ceb29e94f6d8b8609c769f9a4796570c7b2c41f00e5acca47a99c516e4ec75d5c3a197161745bab7eca3e2293619340dfb392187ae016342
7
+ data.tar.gz: 94480d96f1fccd3b1e6bc990ba83da398efaae13f9fbe74af69d794bc417f6dc1b98765c327b1f644e91f8402c6861baabcba6a8cab044f81c88f1a442711cbf
@@ -14,8 +14,15 @@ module Protobuf
14
14
  end
15
15
  end
16
16
 
17
- # One-line file/level configuration
17
+ # One-line file/level/logger configuration. If logger is
18
+ # specified, file and level are ignored.
19
+ #
20
+ # @param options [Hash] Hash of options for the logger
21
+ # @option :logger [::Logger] Logger instance to use underneath.
22
+ # @option :file [String] File name to log to. Ignored if :logger is specified
23
+ # @option :level [Logger::Severity] Level to log at. Ignored if :logger is specified
18
24
  def self.configure(options)
25
+ @__instance = options.fetch(:logger, nil)
19
26
  self.file = options.fetch(:file, false)
20
27
  self.level = options.fetch(:level, false)
21
28
  end
@@ -27,7 +27,7 @@ module Protobuf
27
27
  end
28
28
 
29
29
  def log_signature
30
- env.signature || super
30
+ env.log_signature || super
31
31
  end
32
32
 
33
33
  private
@@ -19,7 +19,7 @@ module Protobuf
19
19
  end
20
20
 
21
21
  def log_signature
22
- env.signature || super
22
+ env.log_signature || super
23
23
  end
24
24
 
25
25
  private
@@ -1,3 +1,3 @@
1
1
  module Protobuf
2
- VERSION = '3.2.0'
2
+ VERSION = '3.3.0'
3
3
  end
data/protobuffy.gemspec CHANGED
@@ -33,5 +33,6 @@ require "protobuf/version"
33
33
  s.add_development_dependency 'simplecov'
34
34
  s.add_development_dependency 'yard'
35
35
  s.add_development_dependency 'timecop'
36
- s.add_development_dependency 'perftools.rb'
36
+
37
+ s.add_development_dependency 'ruby-prof' if RUBY_ENGINE.to_sym == :ruby
37
38
  end
@@ -3,11 +3,13 @@ require 'protobuf/socket'
3
3
  require 'support/all'
4
4
  require 'support/test/resource_service'
5
5
 
6
- begin
7
- require 'perftools'
8
- rescue LoadError
9
- $stderr.puts 'perftools must be uncommented in the gemspec before you can run this benchmark task'
10
- exit(1)
6
+ case RUBY_ENGINE.to_sym
7
+ when :ruby
8
+ require 'ruby-prof'
9
+ when :rbx
10
+ require 'rubinius/profiler'
11
+ when :jruby
12
+ require 'jruby/profiler'
11
13
  end
12
14
 
13
15
  # Including a way to turn on debug logger for spec runs
@@ -66,7 +68,7 @@ namespace :benchmark do
66
68
  desc "benchmark ZMQ client with ZMQ server and profile"
67
69
  task :zmq_profile, [:number, :length, :profile_output] do |t, args|
68
70
  args.with_defaults(:number => 1000, :length => 100, :profile_output => "/tmp/zmq_profiler_#{Time.now.to_i}")
69
- ::PerfTools::CpuProfiler.start(args[:profile_output]) do
71
+ profile_code(args[:profile_output]) do
70
72
  zmq_client_zmq_server(args[:number], args[:length])
71
73
  end
72
74
 
@@ -77,7 +79,7 @@ namespace :benchmark do
77
79
  task :profile_protobuf_new, [:number, :profile_output] do |t, args|
78
80
  args.with_defaults(:number => 1000, :profile_output => "/tmp/profiler_new_#{Time.now.to_i}")
79
81
  create_params = { :name => "The name that we set", :date_created => Time.now.to_i, :status => 2 }
80
- ::PerfTools::CpuProfiler.start(args[:profile_output]) do
82
+ profile_code(args[:profile_output]) do
81
83
  args[:number].to_i.times { Test::Resource.new(create_params) }
82
84
  end
83
85
 
@@ -88,13 +90,32 @@ namespace :benchmark do
88
90
  task :profile_protobuf_serialize, [:number, :profile_output] do |t, args|
89
91
  args.with_defaults(:number => 1000, :profile_output => "/tmp/profiler_new_#{Time.now.to_i}")
90
92
  create_params = { :name => "The name that we set", :date_created => Time.now.to_i, :status => 2 }
91
- ::PerfTools::CpuProfiler.start(args[:profile_output]) do
93
+ profile_code(args[:profile_output]) do
92
94
  args[:number].to_i.times { Test::Resource.new(create_params).serialize }
93
95
  end
94
96
 
95
97
  puts args[:profile_output]
96
98
  end
97
99
 
100
+ def profile_code(output, &block)
101
+ case RUBY_ENGINE.to_sym
102
+ when :ruby
103
+ profile_data = RubyProf.profile(&block)
104
+ RubyProf::FlatPrinter.new(profile_data).print(:path => output)
105
+ when :rbx
106
+ profiler = Rubinius::Profiler::Instrumenter.new
107
+ profiler.profile(false, &block)
108
+ File.open(output, 'w') do |f|
109
+ profiler.show(f)
110
+ end
111
+ when :jruby
112
+ profile_data = JRuby::Profiler.profile(&block)
113
+ File.open(output, 'w') do |f|
114
+ JRuby::Profiler::FlatProfilePrinter.new(profile_data).printProfile(f)
115
+ end
116
+ end
117
+ end
118
+
98
119
  desc "benchmark Socket client with Socket server"
99
120
  task :sock_client_sock_server, [:number, :length] do |t, args|
100
121
  args.with_defaults(:number => 1000, :length => 100)
@@ -52,6 +52,15 @@ describe Protobuf::Logger do
52
52
  subject.instance.level.should == ::Logger::WARN
53
53
  end
54
54
 
55
+ context 'specifying logger' do
56
+ let(:logger) { double('Logger') }
57
+
58
+ it 'sets the logger instance' do
59
+ subject.instance.should_not be
60
+ subject.configure :logger => logger
61
+ subject.instance.should == logger
62
+ end
63
+ end
55
64
  end
56
65
 
57
66
  describe '.reset_device!' do
metadata CHANGED
@@ -1,154 +1,214 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: protobuffy
3
- version: !ruby/object:Gem::Version
4
- version: 3.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.3.0
5
5
  platform: ruby
6
- authors:
6
+ authors:
7
7
  - BJ Neilsen
8
8
  - Brandon Dewitt
9
9
  - Devin Christensen
10
10
  - Adam Hutchison
11
11
  - R. Tyler Croy
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
-
16
- date: 2014-10-16 00:00:00 Z
17
- dependencies:
18
- - !ruby/object:Gem::Dependency
15
+ date: 2015-02-19 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
18
+ requirement: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '3.2'
19
23
  name: activesupport
20
- requirement: &id001 !ruby/object:Gem::Requirement
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "3.2"
25
- type: :runtime
26
24
  prerelease: false
27
- version_requirements: *id001
28
- - !ruby/object:Gem::Dependency
29
- name: middleware
30
- requirement: &id002 !ruby/object:Gem::Requirement
31
- requirements:
32
- - &id003
33
- - ">="
34
- - !ruby/object:Gem::Version
35
- version: "0"
36
25
  type: :runtime
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - '>='
29
+ - !ruby/object:Gem::Version
30
+ version: '3.2'
31
+ - !ruby/object:Gem::Dependency
32
+ requirement: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ name: middleware
37
38
  prerelease: false
38
- version_requirements: *id002
39
- - !ruby/object:Gem::Dependency
40
- name: multi_json
41
- requirement: &id004 !ruby/object:Gem::Requirement
42
- requirements:
43
- - *id003
44
39
  type: :runtime
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ - !ruby/object:Gem::Dependency
46
+ requirement: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ name: multi_json
45
52
  prerelease: false
46
- version_requirements: *id004
47
- - !ruby/object:Gem::Dependency
48
- name: thor
49
- requirement: &id005 !ruby/object:Gem::Requirement
50
- requirements:
51
- - *id003
52
53
  type: :runtime
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ - !ruby/object:Gem::Dependency
60
+ requirement: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ name: thor
53
66
  prerelease: false
54
- version_requirements: *id005
55
- - !ruby/object:Gem::Dependency
67
+ type: :runtime
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ - !ruby/object:Gem::Dependency
74
+ requirement: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
56
79
  name: rack
57
- requirement: &id006 !ruby/object:Gem::Requirement
58
- requirements:
59
- - *id003
60
- type: :development
61
80
  prerelease: false
62
- version_requirements: *id006
63
- - !ruby/object:Gem::Dependency
64
- name: faraday
65
- requirement: &id007 !ruby/object:Gem::Requirement
66
- requirements:
67
- - *id003
68
81
  type: :development
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ - !ruby/object:Gem::Dependency
88
+ requirement: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ name: faraday
69
94
  prerelease: false
70
- version_requirements: *id007
71
- - !ruby/object:Gem::Dependency
72
- name: ffi-rzmq
73
- requirement: &id008 !ruby/object:Gem::Requirement
74
- requirements:
75
- - *id003
76
95
  type: :development
96
+ version_requirements: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ - !ruby/object:Gem::Dependency
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ name: ffi-rzmq
77
108
  prerelease: false
78
- version_requirements: *id008
79
- - !ruby/object:Gem::Dependency
80
- name: pry-nav
81
- requirement: &id009 !ruby/object:Gem::Requirement
82
- requirements:
83
- - *id003
84
109
  type: :development
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - '>='
113
+ - !ruby/object:Gem::Version
114
+ version: '0'
115
+ - !ruby/object:Gem::Dependency
116
+ requirement: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - '>='
119
+ - !ruby/object:Gem::Version
120
+ version: '0'
121
+ name: pry-nav
85
122
  prerelease: false
86
- version_requirements: *id009
87
- - !ruby/object:Gem::Dependency
88
- name: rake
89
- requirement: &id010 !ruby/object:Gem::Requirement
90
- requirements:
91
- - *id003
92
123
  type: :development
124
+ version_requirements: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - '>='
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ - !ruby/object:Gem::Dependency
130
+ requirement: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - '>='
133
+ - !ruby/object:Gem::Version
134
+ version: '0'
135
+ name: rake
93
136
  prerelease: false
94
- version_requirements: *id010
95
- - !ruby/object:Gem::Dependency
96
- name: rspec
97
- requirement: &id011 !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "="
100
- - !ruby/object:Gem::Version
101
- version: 2.99.0
102
137
  type: :development
138
+ version_requirements: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - '>='
141
+ - !ruby/object:Gem::Version
142
+ version: '0'
143
+ - !ruby/object:Gem::Dependency
144
+ requirement: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - '='
147
+ - !ruby/object:Gem::Version
148
+ version: 2.99.0
149
+ name: rspec
103
150
  prerelease: false
104
- version_requirements: *id011
105
- - !ruby/object:Gem::Dependency
106
- name: simplecov
107
- requirement: &id012 !ruby/object:Gem::Requirement
108
- requirements:
109
- - *id003
110
151
  type: :development
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ requirements:
154
+ - - '='
155
+ - !ruby/object:Gem::Version
156
+ version: 2.99.0
157
+ - !ruby/object:Gem::Dependency
158
+ requirement: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - '>='
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ name: simplecov
111
164
  prerelease: false
112
- version_requirements: *id012
113
- - !ruby/object:Gem::Dependency
114
- name: yard
115
- requirement: &id013 !ruby/object:Gem::Requirement
116
- requirements:
117
- - *id003
118
165
  type: :development
166
+ version_requirements: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - '>='
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ - !ruby/object:Gem::Dependency
172
+ requirement: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - '>='
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ name: yard
119
178
  prerelease: false
120
- version_requirements: *id013
121
- - !ruby/object:Gem::Dependency
122
- name: timecop
123
- requirement: &id014 !ruby/object:Gem::Requirement
124
- requirements:
125
- - *id003
126
179
  type: :development
180
+ version_requirements: !ruby/object:Gem::Requirement
181
+ requirements:
182
+ - - '>='
183
+ - !ruby/object:Gem::Version
184
+ version: '0'
185
+ - !ruby/object:Gem::Dependency
186
+ requirement: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - '>='
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
191
+ name: timecop
127
192
  prerelease: false
128
- version_requirements: *id014
129
- - !ruby/object:Gem::Dependency
130
- name: perftools.rb
131
- requirement: &id015 !ruby/object:Gem::Requirement
132
- requirements:
133
- - *id003
134
193
  type: :development
135
- prerelease: false
136
- version_requirements: *id015
194
+ version_requirements: !ruby/object:Gem::Requirement
195
+ requirements:
196
+ - - '>='
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
137
199
  description: Google Protocol Buffers serialization and RPC implementation for Ruby.
138
- email:
200
+ email:
139
201
  - bj.neilsen+protobuf@gmail.com
140
202
  - brandonsdewitt+protobuf@gmail.com
141
203
  - quixoten@gmail.com
142
204
  - liveh2o@gmail.com
143
205
  - tyler@monkeypox.org
144
- executables:
206
+ executables:
145
207
  - protoc-gen-ruby
146
208
  - rpc_server
147
209
  extensions: []
148
-
149
210
  extra_rdoc_files: []
150
-
151
- files:
211
+ files:
152
212
  - .gitignore
153
213
  - .travis.yml
154
214
  - .yardopts
@@ -343,28 +403,28 @@ files:
343
403
  - spec/support/test_app_file.rb
344
404
  - spec/support/tolerance_matcher.rb
345
405
  homepage: https://github.com/lookout/protobuffy
346
- licenses:
406
+ licenses:
347
407
  - WTFPL
348
408
  metadata: {}
349
-
350
- post_install_message:
409
+ post_install_message:
351
410
  rdoc_options: []
352
-
353
- require_paths:
411
+ require_paths:
354
412
  - lib
355
- required_ruby_version: !ruby/object:Gem::Requirement
356
- requirements:
357
- - *id003
358
- required_rubygems_version: !ruby/object:Gem::Requirement
359
- requirements:
360
- - *id003
413
+ required_ruby_version: !ruby/object:Gem::Requirement
414
+ requirements:
415
+ - - '>='
416
+ - !ruby/object:Gem::Version
417
+ version: '0'
418
+ required_rubygems_version: !ruby/object:Gem::Requirement
419
+ requirements:
420
+ - - '>='
421
+ - !ruby/object:Gem::Version
422
+ version: '0'
361
423
  requirements: []
362
-
363
- rubyforge_project:
364
- rubygems_version: 2.4.1
365
- signing_key:
424
+ rubyforge_project:
425
+ rubygems_version: 2.4.5
426
+ signing_key:
366
427
  specification_version: 4
367
428
  summary: Google Protocol Buffers serialization and RPC implementation for Ruby.
368
429
  test_files: []
369
-
370
- has_rdoc:
430
+ has_rdoc: