panko_serializer 0.4.0 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -0
- data/ext/panko_serializer/attributes_writer/type_cast/type_cast.c +20 -7
- data/lib/panko/version.rb +1 -1
- data/panko_serializer.gemspec +0 -5
- metadata +3 -59
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 392d44930b3cd861d45c08e3f8092b55c84550525ced57fcd59d0425827ab177
|
4
|
+
data.tar.gz: bd30319fd499a26b1a44943e443f2f145b1969632fb1aa51472ace7f2d7e21a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 811ed00b96b5a2dbc527b912c77f1f44576586b04de6366fd5c9a8d2a80f9f411a0ab22a5db87a9a3fa3129596cd94bfc6ac5fd2f7ac66725819612e97aa373f
|
7
|
+
data.tar.gz: dd894089a01e61a25da591725ac9cbb6be5e8de188a17a100f8d18bdedf787161d3c4e16263b91e5b1cbcd9eadb09f50576fe53aa3ffa0e544e5fa325c0ee565
|
data/Gemfile
CHANGED
@@ -239,17 +239,30 @@ VALUE cast_boolean_type(VALUE value) {
|
|
239
239
|
return value;
|
240
240
|
}
|
241
241
|
|
242
|
-
if (value == Qnil
|
242
|
+
if (value == Qnil) {
|
243
243
|
return Qnil;
|
244
244
|
}
|
245
245
|
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
246
|
+
if(RB_TYPE_P(value, T_STRING)) {
|
247
|
+
if(RSTRING_LEN(value) == 0) {
|
248
|
+
return Qnil;
|
249
|
+
}
|
250
|
+
|
251
|
+
const char* val = StringValuePtr(value);
|
252
|
+
|
253
|
+
bool isFalseValue =
|
254
|
+
(*val == '0' || (*val == 'f' || *val == 'F') ||
|
255
|
+
(strcmp(val, "false") == 0 || strcmp(val, "FALSE") == 0) ||
|
256
|
+
(strcmp(val, "off") == 0 || strcmp(val, "OFF") == 0));
|
251
257
|
|
252
|
-
|
258
|
+
return isFalseValue ? Qfalse : Qtrue;
|
259
|
+
}
|
260
|
+
|
261
|
+
if (RB_INTEGER_TYPE_P(value)) {
|
262
|
+
return value == INT2NUM(1) ? Qtrue : Qfalse;
|
263
|
+
}
|
264
|
+
|
265
|
+
return Qnil;
|
253
266
|
}
|
254
267
|
|
255
268
|
bool is_date_time_type(VALUE type_klass) {
|
data/lib/panko/version.rb
CHANGED
data/panko_serializer.gemspec
CHANGED
@@ -21,10 +21,5 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.extensions << "ext/panko_serializer/extconf.rb"
|
23
23
|
|
24
|
-
spec.add_development_dependency "bundler", "~> 1.14"
|
25
|
-
spec.add_development_dependency "rake", "~> 10.5"
|
26
|
-
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
-
spec.add_development_dependency "rake-compiler"
|
28
|
-
|
29
24
|
spec.add_dependency "oj", "~> 3.6.0"
|
30
25
|
end
|
metadata
CHANGED
@@ -1,71 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panko_serializer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yosi Attias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.14'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.14'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.5'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.5'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rspec
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '3.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '3.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rake-compiler
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
13
|
- !ruby/object:Gem::Dependency
|
70
14
|
name: oj
|
71
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -171,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
115
|
version: '0'
|
172
116
|
requirements: []
|
173
117
|
rubyforge_project:
|
174
|
-
rubygems_version: 2.7.
|
118
|
+
rubygems_version: 2.7.7
|
175
119
|
signing_key:
|
176
120
|
specification_version: 4
|
177
121
|
summary: Fast serialization for ActiveModel
|