supplement 2.21 → 2.22
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/README +1 -1
- data/lib/supplement/date.rb +0 -50
- data/lib/supplement.c +0 -4
- metadata +7 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfe383724f7aaa07dc2be7524d3ab6e11908ede513e133251b01989572343e59
|
4
|
+
data.tar.gz: 64121897e3f8388666664d0911b74ae18a4b8c378b6c38737edc0414e5262629
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0549d67c614aad498ad70160933d2122290b864013ff73b564a57b8f80a8cceaa86c9c57dd222641be738dbf6232e0dccb78b9b3610888055fdf5706bf678f8a'
|
7
|
+
data.tar.gz: eac0f15c6799f7e096abea90146351d33c905e85d78fe0e293a83a1ce611f96b10ba5bf6bc84c3f8271ac1822a8b702794066abe9c8210a5b3dddb0a88c94849
|
data/README
CHANGED
data/lib/supplement/date.rb
CHANGED
@@ -72,55 +72,5 @@ class Date
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
-
def months_forward n
|
76
|
-
res = self
|
77
|
-
n.times { res = res.next_month }
|
78
|
-
res
|
79
|
-
end
|
80
|
-
|
81
|
-
def months_backward n
|
82
|
-
res = self
|
83
|
-
n.times { res = res.prev_month }
|
84
|
-
res
|
85
|
-
end
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
|
90
|
-
unless DateTime.method_defined? :to_time then
|
91
|
-
|
92
|
-
class Time
|
93
|
-
def to_time ; self ; end
|
94
|
-
def to_date
|
95
|
-
jd = Date.civil_to_jd year, mon, mday, Date::ITALY
|
96
|
-
hd = Date.jd_to_ajd jd, 0, 0
|
97
|
-
Date.new! hd, 0, Date::ITALY
|
98
|
-
end
|
99
|
-
def to_datetime
|
100
|
-
jd = DateTime.civil_to_jd year, mon, mday, DateTime::ITALY
|
101
|
-
fr = DateTime.time_to_day_fraction hour, min, [sec, 59].min
|
102
|
-
fr += (Rational usec, 86400*1000000000)
|
103
|
-
of = (Rational utc_offset, 86400)
|
104
|
-
hd = DateTime.jd_to_ajd jd, fr, of
|
105
|
-
DateTime.new! hd, of, DateTime::ITALY
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
class Date
|
110
|
-
def to_time ; Time.local year, mon, mday ; end
|
111
|
-
def to_date ; self ; end
|
112
|
-
def to_datetime ; DateTime.new! Date.jd_to_ajd(jd,0,0), @of, @sg ; end
|
113
|
-
end
|
114
|
-
|
115
|
-
class DateTime
|
116
|
-
def to_time
|
117
|
-
(new_offset 0).instance_eval do
|
118
|
-
Time.utc year, mon, mday, hour, min, sec + sec_fraction
|
119
|
-
end.getlocal
|
120
|
-
end
|
121
|
-
def to_date ; Date.new! Date.jd_to_ajd(jd,0,0), 0, @sg ; end
|
122
|
-
def to_datetime ; self ; end
|
123
|
-
end
|
124
|
-
|
125
75
|
end
|
126
76
|
|
data/lib/supplement.c
CHANGED
@@ -508,8 +508,6 @@ rb_str_starts_with_p( VALUE str, VALUE oth)
|
|
508
508
|
char *s, *o;
|
509
509
|
VALUE ost;
|
510
510
|
|
511
|
-
if (!rb_str_comparable( str, oth))
|
512
|
-
return Qnil;
|
513
511
|
ost = rb_string_value( &oth);
|
514
512
|
i = RSTRING_LEN( ost);
|
515
513
|
if (i > RSTRING_LEN( str))
|
@@ -544,8 +542,6 @@ rb_str_ends_with_p( VALUE str, VALUE oth)
|
|
544
542
|
char *s, *o;
|
545
543
|
VALUE ost;
|
546
544
|
|
547
|
-
if (!rb_str_comparable( str, oth))
|
548
|
-
return Qnil;
|
549
545
|
ost = rb_string_value( &oth);
|
550
546
|
i = RSTRING_LEN( ost);
|
551
547
|
if (i > RSTRING_LEN( str))
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: supplement
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '2.
|
4
|
+
version: '2.22'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-04 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rake
|
@@ -38,9 +37,9 @@ dependencies:
|
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
39
|
version: '2.18'
|
41
|
-
description:
|
42
|
-
|
43
|
-
|
40
|
+
description: |
|
41
|
+
Simple methods that didn't manage to become
|
42
|
+
part of standard Ruby.
|
44
43
|
email: "<software@bertram-scharpf.de>"
|
45
44
|
executables: []
|
46
45
|
extensions:
|
@@ -71,14 +70,11 @@ files:
|
|
71
70
|
- lib/supplement/socket.h
|
72
71
|
- lib/supplement/terminal.c
|
73
72
|
- lib/supplement/terminal.h
|
74
|
-
homepage:
|
73
|
+
homepage: https://github.com/BertramScharpf/ruby-supplement
|
75
74
|
licenses:
|
76
75
|
- BSD-2-Clause
|
77
76
|
metadata: {}
|
78
|
-
post_install_message:
|
79
77
|
rdoc_options:
|
80
|
-
- "--charset"
|
81
|
-
- utf-8
|
82
78
|
- "--main"
|
83
79
|
- README
|
84
80
|
require_paths:
|
@@ -95,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
91
|
version: '0'
|
96
92
|
requirements:
|
97
93
|
- Ruby and the autorake gem
|
98
|
-
rubygems_version: 3.
|
99
|
-
signing_key:
|
94
|
+
rubygems_version: 3.6.2
|
100
95
|
specification_version: 4
|
101
96
|
summary: Simple Ruby extensions
|
102
97
|
test_files: []
|