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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 471214b4bbc235944a133c4e4fb5b18889a88daab2ac740cc46b6d49af0389a2
4
- data.tar.gz: a2fec0e51d6625e029beaa45b5dc4e6490158773f69c738096cda61aff575909
3
+ metadata.gz: 6cdb9fdf0babe62eb1bc1c355c7f1faa3c658ada53b1ec4bec48fdaeb06df13b
4
+ data.tar.gz: bf4696961d10db90fa60e768dea133fcbf3c96ab3f8eb407cfb40ba248f346bb
5
5
  SHA512:
6
- metadata.gz: 79b78dbb5606224cc47d4750875373d3cf3fcbe04791d14415b26b7a37d96521759c85261a3796285ec42dc8c74c644608d1ee2aa81a6837f0480dec4094d404
7
- data.tar.gz: 2e69a17ad1aa19ca18cdbc469b762f726dbdcf528f3c5fe13068e27d52856fa14d1eafa79c0e4be331f0cbfdfbd900b459375efa114e680f2941460cfac04cc1
6
+ metadata.gz: a1a638bfb6a8641705b6e10d97db86dc45b36a1c240e821b9186821caca487ef5fb35bb9f540a52ec2c60428e3a7f0d61b465273d00a72074ddb7a397fbe8b84
7
+ data.tar.gz: 13f0cd7abf6a86792a088236210226834f08b809ec567028f52f23a5cbca50901e1197cbfac644297bc12029a86f74ff83629696fcc6c6b78aadb508463a4ce0
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## Main
2
+
3
+ Nothing so far
4
+
5
+ ## 1.0.1
6
+
7
+ #### Additions
8
+ * Effective time range for any given cycle
9
+
1
10
  ## 1.0.0
2
11
 
3
12
  #### Initial Implementation
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  # AIRAC
7
7
 
8
- [AIRAC cycle](https://en.wikipedia.org/wiki/Aeronautical_Information_Publication) calculations for Ruby.
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 ((2458095j,0s,0n),+0s,2299161j)>
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 ((2458095j,0s,0n),+0s,2299161j)>
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AIRAC
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
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.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-01-22 00:00:00.000000000 Z
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.5
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