trilogy 2.12.0 → 2.12.2
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 +4 -4
- data/ext/trilogy-ruby/cast.c +14 -16
- data/lib/trilogy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 858e7f5a3e8f897d422ea5a4bd2d92f38a0e53e2e99de1bce3260d6b725e82a6
|
|
4
|
+
data.tar.gz: 365050e53fa2c8edb3127cc366005c6127a9070000c707d3b66b1429d9c7c908
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a346b0a98843ed598dc30b9c8a81650424ffaddaa632405c3955942ad7cf74b9f0eba274721ec7270e637fe097915ef066e4300bd49fcb486e1062b389862b50
|
|
7
|
+
data.tar.gz: 20c92cb9d43ad8eb6d9cec81a0213ac5ec9d08285aa7e5e9e81850086c2412b980111c5ab7f884a9246200e3d88d2919160cd97c5fc3342f2275445bc72dfcbc
|
data/ext/trilogy-ruby/cast.c
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
#define CAST_STACK_SIZE 64
|
|
9
9
|
|
|
10
|
-
static ID id_BigDecimal, id_Integer, id_new;
|
|
10
|
+
static ID id_BigDecimal, id_Integer, id_new, id_local;
|
|
11
11
|
|
|
12
12
|
static const char *ruby_encoding_name_map[] = {
|
|
13
13
|
[TRILOGY_ENCODING_ARMSCII8] = NULL,
|
|
@@ -99,23 +99,20 @@ static time_t civil_to_epoch_utc(int year, int month, int day, int hour, int min
|
|
|
99
99
|
static VALUE trilogy_make_time(int year, int month, int day, int hour, int min, int sec,
|
|
100
100
|
int usec, int local)
|
|
101
101
|
{
|
|
102
|
-
struct timespec ts;
|
|
103
102
|
if (local) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
.tm_sec = sec,
|
|
111
|
-
.tm_isdst = -1,
|
|
112
|
-
};
|
|
113
|
-
ts.tv_sec = mktime(&tm);
|
|
114
|
-
} else {
|
|
115
|
-
ts.tv_sec = civil_to_epoch_utc(year, month, day, hour, min, sec);
|
|
103
|
+
return rb_funcall(
|
|
104
|
+
rb_cTime, id_local, 7,
|
|
105
|
+
INT2NUM(year), INT2NUM(month), INT2NUM(day),
|
|
106
|
+
INT2NUM(hour), INT2NUM(min), INT2NUM(sec),
|
|
107
|
+
INT2NUM(usec)
|
|
108
|
+
);
|
|
116
109
|
}
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
|
|
111
|
+
struct timespec ts = {
|
|
112
|
+
.tv_sec = civil_to_epoch_utc(year, month, day, hour, min, sec),
|
|
113
|
+
.tv_nsec = (long)usec * 1000,
|
|
114
|
+
};
|
|
115
|
+
return rb_time_timespec_new(&ts, INT_MAX - 1);
|
|
119
116
|
}
|
|
120
117
|
|
|
121
118
|
// Byte-arithmetic datetime parsing helpers (inspired by Go's go-sql-driver/mysql)
|
|
@@ -398,4 +395,5 @@ void rb_trilogy_cast_init(void)
|
|
|
398
395
|
id_BigDecimal = rb_intern("BigDecimal");
|
|
399
396
|
id_Integer = rb_intern("Integer");
|
|
400
397
|
id_new = rb_intern("new");
|
|
398
|
+
id_local = rb_intern("local");
|
|
401
399
|
}
|
data/lib/trilogy/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trilogy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.12.
|
|
4
|
+
version: 2.12.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GitHub Engineering
|
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
88
|
version: '0'
|
|
89
89
|
requirements: []
|
|
90
|
-
rubygems_version:
|
|
90
|
+
rubygems_version: 4.0.6
|
|
91
91
|
specification_version: 4
|
|
92
92
|
summary: A friendly MySQL-compatible library for Ruby, binding to libtrilogy
|
|
93
93
|
test_files: []
|