ed-precompiled_date 3.4.1-arm64-darwin
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 +7 -0
- data/BSDL +22 -0
- data/COPYING +56 -0
- data/README.md +102 -0
- data/ext/date/date_core.c +10066 -0
- data/ext/date/date_parse.c +3086 -0
- data/ext/date/date_strftime.c +638 -0
- data/ext/date/date_strptime.c +704 -0
- data/ext/date/date_tmx.h +56 -0
- data/ext/date/extconf.rb +13 -0
- data/ext/date/prereq.mk +19 -0
- data/ext/date/zonetab.h +1564 -0
- data/ext/date/zonetab.list +330 -0
- data/lib/3.0/date_core.bundle +0 -0
- data/lib/3.1/date_core.bundle +0 -0
- data/lib/3.2/date_core.bundle +0 -0
- data/lib/3.3/date_core.bundle +0 -0
- data/lib/3.4/date_core.bundle +0 -0
- data/lib/date.rb +75 -0
- metadata +63 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 353da32a8c097f1db942190743febc28ee7414f21bc7bd9c0a00dde884ec90c7
|
|
4
|
+
data.tar.gz: abc9737d3277a6d5dc083bb36852dce24a0319d8e9b1000dbddd03aa37093ce1
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f8f4d523d3fe1b75aa733616185e212a2fd063ca1b982eb84c59979307e4223be3d9f29d36dc76762063a350ee96f26848de3be514066471b5e2f68fcecef3bd
|
|
7
|
+
data.tar.gz: 6ca9a50a0d23e9f4a8e3d71dd12b588ecdc1df5fb2c25bb0b3c9a413f42814df985be2a85d0d2cd8033c797a645b5b51e3886c053aaaa3fa82eefe3f620927ab
|
data/BSDL
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions
|
|
5
|
+
are met:
|
|
6
|
+
1. Redistributions of source code must retain the above copyright
|
|
7
|
+
notice, this list of conditions and the following disclaimer.
|
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright
|
|
9
|
+
notice, this list of conditions and the following disclaimer in the
|
|
10
|
+
documentation and/or other materials provided with the distribution.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
13
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
14
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
15
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
16
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
17
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
18
|
+
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
19
|
+
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
20
|
+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
21
|
+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
22
|
+
SUCH DAMAGE.
|
data/COPYING
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
|
2
|
+
You can redistribute it and/or modify it under either the terms of the
|
|
3
|
+
2-clause BSDL (see the file BSDL), or the conditions below:
|
|
4
|
+
|
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
|
6
|
+
software without restriction, provided that you duplicate all of the
|
|
7
|
+
original copyright notices and associated disclaimers.
|
|
8
|
+
|
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
|
10
|
+
you do at least ONE of the following:
|
|
11
|
+
|
|
12
|
+
a. place your modifications in the Public Domain or otherwise
|
|
13
|
+
make them Freely Available, such as by posting said
|
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
|
15
|
+
the author to include your modifications in the software.
|
|
16
|
+
|
|
17
|
+
b. use the modified software only within your corporation or
|
|
18
|
+
organization.
|
|
19
|
+
|
|
20
|
+
c. give non-standard binaries non-standard names, with
|
|
21
|
+
instructions on where to get the original software distribution.
|
|
22
|
+
|
|
23
|
+
d. make other distribution arrangements with the author.
|
|
24
|
+
|
|
25
|
+
3. You may distribute the software in object code or binary form,
|
|
26
|
+
provided that you do at least ONE of the following:
|
|
27
|
+
|
|
28
|
+
a. distribute the binaries and library files of the software,
|
|
29
|
+
together with instructions (in the manual page or equivalent)
|
|
30
|
+
on where to get the original distribution.
|
|
31
|
+
|
|
32
|
+
b. accompany the distribution with the machine-readable source of
|
|
33
|
+
the software.
|
|
34
|
+
|
|
35
|
+
c. give non-standard binaries non-standard names, with
|
|
36
|
+
instructions on where to get the original software distribution.
|
|
37
|
+
|
|
38
|
+
d. make other distribution arrangements with the author.
|
|
39
|
+
|
|
40
|
+
4. You may modify and include the part of the software into any other
|
|
41
|
+
software (possibly commercial). But some files in the distribution
|
|
42
|
+
are not written by the author, so that they are not under these terms.
|
|
43
|
+
|
|
44
|
+
For the list of those files and their copying conditions, see the
|
|
45
|
+
file LEGAL.
|
|
46
|
+
|
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
|
48
|
+
output from the software do not automatically fall under the
|
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
|
51
|
+
software.
|
|
52
|
+
|
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
56
|
+
PURPOSE.
|
data/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# `Date`
|
|
2
|
+
|
|
3
|
+
The official date library for Ruby.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'date'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install date
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
require 'date'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
A `Date` object is created with `Date::new`, `Date::jd`, `Date::ordinal`, `Date::commercial`, `Date::parse`, `Date::strptime`, `Date::today`, `Time#to_date`, etc.
|
|
28
|
+
|
|
29
|
+
```ruby
|
|
30
|
+
require 'date'
|
|
31
|
+
|
|
32
|
+
Date.new(2001,2,3)
|
|
33
|
+
#=> #<Date: 2001-02-03 ...>
|
|
34
|
+
Date.jd(2451944)
|
|
35
|
+
#=> #<Date: 2001-02-03 ...>
|
|
36
|
+
Date.ordinal(2001,34)
|
|
37
|
+
#=> #<Date: 2001-02-03 ...>
|
|
38
|
+
Date.commercial(2001,5,6)
|
|
39
|
+
#=> #<Date: 2001-02-03 ...>
|
|
40
|
+
Date.parse('2001-02-03')
|
|
41
|
+
#=> #<Date: 2001-02-03 ...>
|
|
42
|
+
Date.strptime('03-02-2001', '%d-%m-%Y')
|
|
43
|
+
#=> #<Date: 2001-02-03 ...>
|
|
44
|
+
Time.new(2001,2,3).to_date
|
|
45
|
+
#=> #<Date: 2001-02-03 ...>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
All `Date` objects are immutable; hence cannot modify themselves.
|
|
49
|
+
|
|
50
|
+
The concept of a date object can be represented as a tuple of the day count, the offset and the day of calendar reform.
|
|
51
|
+
|
|
52
|
+
The day count denotes the absolute position of a temporal dimension. The offset is relative adjustment, which determines decoded local time with the day count. The day of calendar reform denotes the start day of the new style. The old style of the West is the Julian calendar which was adopted by Caesar. The new style is the Gregorian calendar, which is the current civil calendar of many countries.
|
|
53
|
+
|
|
54
|
+
The day count is virtually the astronomical Julian day number. The offset in this class is usually zero, and cannot be specified directly.
|
|
55
|
+
|
|
56
|
+
A `Date` object can be created with an optional argument, the day of calendar reform as a Julian day number, which should be 2298874 to 2426355 or negative/positive infinity. The default value is `Date::ITALY` (2299161=1582-10-15). See also sample/cal.rb.
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
$ ruby sample/cal.rb -c it 10 1582
|
|
60
|
+
October 1582
|
|
61
|
+
S M Tu W Th F S
|
|
62
|
+
1 2 3 4 15 16
|
|
63
|
+
17 18 19 20 21 22 23
|
|
64
|
+
24 25 26 27 28 29 30
|
|
65
|
+
31
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
$ ruby sample/cal.rb -c gb 9 1752
|
|
70
|
+
September 1752
|
|
71
|
+
S M Tu W Th F S
|
|
72
|
+
1 2 14 15 16
|
|
73
|
+
17 18 19 20 21 22 23
|
|
74
|
+
24 25 26 27 28 29 30
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
A `Date` object has various methods. See each reference.
|
|
78
|
+
|
|
79
|
+
```ruby
|
|
80
|
+
d = Date.parse('3rd Feb 2001')
|
|
81
|
+
#=> #<Date: 2001-02-03 ...>
|
|
82
|
+
d.year #=> 2001
|
|
83
|
+
d.mon #=> 2
|
|
84
|
+
d.mday #=> 3
|
|
85
|
+
d.wday #=> 6
|
|
86
|
+
d += 1 #=> #<Date: 2001-02-04 ...>
|
|
87
|
+
d.strftime('%a %d %b %Y') #=> "Sun 04 Feb 2001"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Development
|
|
91
|
+
|
|
92
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
93
|
+
|
|
94
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
95
|
+
|
|
96
|
+
## Contributing
|
|
97
|
+
|
|
98
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/date.
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
The gem is available as open source under the terms of the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause).
|