airac 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +9 -0
- data/README.md +4 -3
- data/lib/airac/cycle.rb +10 -1
- data/lib/airac/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -17
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cdb9fdf0babe62eb1bc1c355c7f1faa3c658ada53b1ec4bec48fdaeb06df13b
|
4
|
+
data.tar.gz: bf4696961d10db90fa60e768dea133fcbf3c96ab3f8eb407cfb40ba248f346bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1a638bfb6a8641705b6e10d97db86dc45b36a1c240e821b9186821caca487ef5fb35bb9f540a52ec2c60428e3a7f0d61b465273d00a72074ddb7a397fbe8b84
|
7
|
+
data.tar.gz: 13f0cd7abf6a86792a088236210226834f08b809ec567028f52f23a5cbca50901e1197cbfac644297bc12029a86f74ff83629696fcc6c6b78aadb508463a4ce0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
# AIRAC
|
7
7
|
|
8
|
-
[AIRAC
|
8
|
+
[AIRAC (Aeronautical Information Regulation And Control)](https://en.wikipedia.org/wiki/Aeronautical_Information_Publication) cycle calculations for Ruby.
|
9
9
|
|
10
10
|
* [Homepage](https://github.com/svoop/airac)
|
11
11
|
* [API](https://www.rubydoc.info/gems/airac)
|
@@ -26,7 +26,7 @@ gem cert --add <(curl -Ls https://raw.github.com/svoop/airac/main/certs/svoop.pe
|
|
26
26
|
Add the following to the <tt>Gemfile</tt> or <tt>gems.rb</tt> of your [Bundler](https://bundler.io) powered Ruby project:
|
27
27
|
|
28
28
|
```ruby
|
29
|
-
gem airac
|
29
|
+
gem 'airac'
|
30
30
|
```
|
31
31
|
|
32
32
|
And then install the bundle:
|
@@ -41,7 +41,8 @@ You can use this gem in your Ruby project:
|
|
41
41
|
|
42
42
|
```ruby
|
43
43
|
cycle = AIRAC::Cycle.new('2018-01-01')
|
44
|
-
cycle.date # => #<Date: 2017-12-07
|
44
|
+
cycle.date # => #<Date: 2017-12-07>
|
45
|
+
cycle.effective # => 2017-12-07 00:00:00 UTC..2018-01-03 23:59:59 UTC
|
45
46
|
cycle.id # => 1713
|
46
47
|
(cycle + 5).id # => 1804
|
47
48
|
(cycle - 5).id # => 1708
|
data/lib/airac/cycle.rb
CHANGED
@@ -4,7 +4,8 @@ module AIRAC
|
|
4
4
|
#
|
5
5
|
# @example
|
6
6
|
# cycle = AIRAC::Cycle.new('2018-01-01')
|
7
|
-
# cycle.date # => #<Date: 2017-12-07
|
7
|
+
# cycle.date # => #<Date: 2017-12-07>
|
8
|
+
# cycle.effective # => 2017-12-07 00:00:00 UTC..2018-01-03 23:59:59 UTC
|
8
9
|
# cycle.id # => 1713
|
9
10
|
# (cycle + 5).id # => 1804
|
10
11
|
# (cycle - 5).id # => 1708
|
@@ -50,6 +51,14 @@ module AIRAC
|
|
50
51
|
date.strftime((template || '%i %Y-%m-%d').sub(/%i/, id))
|
51
52
|
end
|
52
53
|
|
54
|
+
# Time range within which this cycle is effective.
|
55
|
+
#
|
56
|
+
# @return [Range<Time>]
|
57
|
+
def effective
|
58
|
+
next_date = date + DAYS_PER_CYCLE
|
59
|
+
(Time.utc(date.year, date.month, date.day)..(Time.utc(next_date.year, next_date.month, next_date.day) - 1))
|
60
|
+
end
|
61
|
+
|
53
62
|
# @param days [Numerical] add this many days
|
54
63
|
# @return [AIRAC::Cycle] new object with offset applied
|
55
64
|
def +(cycles)
|
data/lib/airac/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: airac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Schwyn
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
1+2Y1+i+4jd1B7qxIgOLxQTNIJiwE0sqU1itFfuesfgUACS7M0IV9u9Bp4hBGNEw
|
31
31
|
5JcY2h7owdMxXIvgk1oakgldFJc=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2022-
|
33
|
+
date: 2022-04-26 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rake
|
@@ -60,20 +60,6 @@ dependencies:
|
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: minitest-reporters
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
63
|
- !ruby/object:Gem::Dependency
|
78
64
|
name: minitest-sound
|
79
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
182
|
- !ruby/object:Gem::Version
|
197
183
|
version: '0'
|
198
184
|
requirements: []
|
199
|
-
rubygems_version: 3.3.
|
185
|
+
rubygems_version: 3.3.12
|
200
186
|
signing_key:
|
201
187
|
specification_version: 4
|
202
188
|
summary: AIRAC cycle calculations
|
metadata.gz.sig
CHANGED
Binary file
|