ruby_protobuf 0.4.9 → 0.4.10
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.
- data/History.txt +5 -1
- data/VERSION +1 -1
- data/lib/protobuf/compiler/visitors.rb +1 -1
- data/lib/protobuf/message/field.rb +2 -2
- data/test/test_types.rb +1 -0
- metadata +4 -4
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.10
|
@@ -102,7 +102,7 @@ module Protobuf
|
|
102
102
|
unless File.exist?(File.join(@out_dir, File.basename(proto_file, '.proto') + '.pb.rb'))
|
103
103
|
Compiler.compile(proto_file, @proto_dir, @out_dir)
|
104
104
|
end
|
105
|
-
proto_file.sub(/\.proto\z/, '')
|
105
|
+
proto_file.sub(/\.proto\z/, '.pb')
|
106
106
|
end
|
107
107
|
|
108
108
|
def create_files(filename, out_dir, file_create)
|
@@ -309,7 +309,7 @@ module Protobuf
|
|
309
309
|
end
|
310
310
|
|
311
311
|
def acceptable?(val)
|
312
|
-
raise TypeError unless val.
|
312
|
+
raise TypeError unless val.is_a?(String)
|
313
313
|
true
|
314
314
|
end
|
315
315
|
|
@@ -582,7 +582,7 @@ module Protobuf
|
|
582
582
|
end
|
583
583
|
|
584
584
|
def acceptable?(val)
|
585
|
-
raise TypeError unless val.
|
585
|
+
raise TypeError unless val.is_a?(type) || val.is_a?(Hash)
|
586
586
|
true
|
587
587
|
end
|
588
588
|
|
data/test/test_types.rb
CHANGED
@@ -206,6 +206,7 @@ class TypesTest < Test::Unit::TestCase
|
|
206
206
|
assert_nothing_raised { types.type12 = '' }
|
207
207
|
assert_nothing_raised { types.type12 = 'hello' }
|
208
208
|
assert_nothing_raised { types.type12 = nil }
|
209
|
+
assert_nothing_raised { types.type12 = Class.new(String).new('test') }
|
209
210
|
assert_raise(TypeError) { types.type12 = 0 }
|
210
211
|
assert_raise(TypeError) { types.type12 = true }
|
211
212
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_protobuf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 10
|
10
|
+
version: 0.4.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- MATSUYAMA Kengo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-02-22 00:00:00 +09:00
|
19
19
|
default_executable: rprotoc
|
20
20
|
dependencies: []
|
21
21
|
|