aixm 1.3.0 → 1.3.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: af33154acb182006b0c9f4e048c305b2489cba22d15ee1bc9aa724ddec70ceab
4
- data.tar.gz: 44c42b5e93537e33cb2623a19a043216853664358d5c616f59aa884ee4c3e80c
3
+ metadata.gz: c4dd1d553f6bf8c1f704cd521b14f26e89dc1161d065b82fd867fde1a556d97e
4
+ data.tar.gz: 9fcba185054638267827d2e7a5eec09e849d237738455ec1bd9bb1cbabbabf5f
5
5
  SHA512:
6
- metadata.gz: e960a18401dd58557db667b01cb3f15683728798f3aee736fda794a18519d7b3fb99e0725154a01b564a4e35658cdde5310402fd1c2b6f2e4550880cf47db98b
7
- data.tar.gz: 2855fb8f01ca9dd515e8c05b60e79d80f4d4af77b48f1b03cc4baaadd1451810b877c92cd9364cb5d84b80f6d99ebda3b8c21d2445143f9d078a9e4e7ef2cc76
6
+ metadata.gz: 0ab5bd974c993d0813e550c129040c6fac9f2d31f787f428e3582aef9486d1a2e95983dca76c822be9b621c97fe87c0263d571e92a485b0a3f9b2af76a7a6d0b
7
+ data.tar.gz: 2969d03eb3bf308ad19fd481c1ca5244525848a5802eea3b9d4a999bb3feeb826ef483dbfdec23b567a2e326a3704fe1c45a61a74825cd0483bc4bfb2c7e9b97
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -2,16 +2,25 @@
2
2
 
3
3
  Nothing so far
4
4
 
5
+ ## 1.3.1
6
+
7
+ #### Changes
8
+ * Update certificate
9
+
5
10
  ## 1.3.0
6
11
 
7
12
  #### Breaking Changes
8
13
  * `Document#created_at` no longer falls back to `Document#effective_at`
14
+ * Renamed `AIXM::Date#succ` to `AIXM::Date#next`
9
15
 
10
16
  #### Additions
11
17
  * Refinement to pretty print Nokogiri XML documents
12
18
  * XML comments on features (e.g. to include raw NOTAM)
13
19
  * `Document#expiration_at` for OFMX
14
20
  * Generic features as raw XML (e.g. extracted from another AIXM/OFMX file)
21
+ * Convenience combinator `AIXM::Schedule::DateTime`
22
+ * Shortcuts `AIXM::BEGINNING_OF_DAY` and `AIXM::END_OF_DAY`
23
+ * `AIXM::Date#next` and `AIXM::Date#-`
15
24
 
16
25
  ## 1.2.1
17
26
 
data/README.md CHANGED
@@ -187,6 +187,13 @@ AIXM.config.ignored_errors = /invalid date/i
187
187
  * [VASIS](https://www.rubydoc.info/gems/aixm/AIXM/Component/VASIS.html)
188
188
  * [Vertical limit](https://www.rubydoc.info/gems/aixm/AIXM/Component/VerticalLimit.html)
189
189
 
190
+ ### Schedule
191
+
192
+ * [Date](https://www.rubydoc.info/gems/aixm/AIXM/Schedule/Date.html)
193
+ * [Day](https://www.rubydoc.info/gems/aixm/AIXM/Schedule/Day.html)
194
+ * [Time](https://www.rubydoc.info/gems/aixm/AIXM/Schedule/Time.html)
195
+ * [DateTime](https://www.rubydoc.info/gems/aixm/AIXM/Schedule/DateTime.html)
196
+
190
197
  ## Associations
191
198
 
192
199
  The different models are interwoven with [`has_many` and `has_one` associations](https://www.rubydoc.info/gems/aixm/AIXM/Association).
data/lib/aixm/classes.rb CHANGED
@@ -14,6 +14,7 @@ module AIXM
14
14
  date: 'AIXM::Schedule::Date',
15
15
  day: 'AIXM::Schedule::Day',
16
16
  time: 'AIXM::Schedule::Time',
17
+ datetime: 'AIXM::Schedule::DateTime',
17
18
  address: 'AIXM::Component::Address',
18
19
  approach_lighting: 'AIXM::Component::ApproachLighting',
19
20
  organisation: 'AIXM::Feature::Organisation',
@@ -18,6 +18,8 @@ module AIXM
18
18
  # airspace.add_layer(AIXM.layer)
19
19
  # airspace.geometry.add_segment(AIXM.point or AIXM.arc or AIXM.border or AIXM.circle)
20
20
  #
21
+ # Timetables and remarks have to be set on the layer!
22
+ #
21
23
  # The +id+ is mandatory, however, you may omit it when initializing a new
22
24
  # airspace or assign +nil+ to an existing airspace which will generate a 8
23
25
  # character digest from +type+, +local_type+ and +name+.
@@ -83,13 +83,25 @@ module AIXM
83
83
  self.class.new(date.strftime(yearless? ? '%m-%d' : '%F'))
84
84
  end
85
85
 
86
+ # Create new date one day prior to this one.
87
+ def prev
88
+ self.class.new(date.prev_day.to_s.sub(/^-/, '')).at(year: (YEARLESS_YEAR if yearless?))
89
+ end
90
+
86
91
  # Create new date one day after this one.
87
92
  #
88
93
  # @return [AIXM::Schedule::Date]
89
- def succ
94
+ def next
90
95
  self.class.new(date.next_day).at(year: (YEARLESS_YEAR if yearless?))
91
96
  end
92
97
 
98
+ # Calculate difference in days between two dates.
99
+ #
100
+ # @return [Integer]
101
+ def -(date)
102
+ (self.date - date.date).to_i
103
+ end
104
+
93
105
  # Convert date to day
94
106
  #
95
107
  # @raise [RuntimeError] if date is yearless
@@ -0,0 +1,56 @@
1
+ using AIXM::Refinements
2
+
3
+ module AIXM
4
+ module Schedule
5
+
6
+ # Datetimes suitable for schedules
7
+ #
8
+ # This class combines +AIXM::Schedule::Date+ and +AIXM::Schedule::Time+:
9
+ #
10
+ # @example
11
+ # datetime = AIXM.datetime('2022-04-20', '20:00') # => 2022-04-20 20:00
12
+ # datetime.date # => 2022-04-20
13
+ # datetime.date.class # => AIXM::Schedule::Date
14
+ # datetime.time # => 20:00
15
+ # datetime.time.class # => AIXM::Schedule::Time
16
+ class DateTime
17
+
18
+ # Date part
19
+ #
20
+ # @return [AIXM::Schedule::Date]
21
+ attr_reader :date
22
+
23
+ # Time part
24
+ #
25
+ # @return [AIXM::Schedule::Time]
26
+ attr_reader :time
27
+
28
+ # Parse the given representation of date and time.
29
+ #
30
+ # @param date [AIXM::Schedule::Date]
31
+ # @param time [AIXM::Schedule::Time]
32
+ def initialize(date, time)
33
+ fail(ArgumentError, 'invalid date') unless date.instance_of? AIXM::Schedule::Date
34
+ fail(ArgumentError, 'invalid time') unless time.instance_of? AIXM::Schedule::Time
35
+ @date, @time = date, time
36
+ end
37
+
38
+ # Human readable representation such as "2002-05-19 20:00"
39
+ #
40
+ # @return [String]
41
+ def to_s
42
+ [@date.to_s, @time.to_s].join(' ')
43
+ end
44
+
45
+ def inspect
46
+ %Q(#<#{self.class} #{to_s}>)
47
+ end
48
+
49
+ # @see Object#hash
50
+ def hash
51
+ [@date.hash, @time.hash].hash
52
+ end
53
+ end
54
+
55
+ end
56
+ end
@@ -19,6 +19,10 @@ module AIXM
19
19
  # @example
20
20
  # time = AIXM.time('21:30') # => 21:30
21
21
  # time.covered_by?(AIXM.time('20:00')..AIXM.time('02:00')) # => true
22
+ #
23
+ # ===Shortcuts:
24
+ # * +AIXM::BEGINNING_OF_DAY+ - midnight expressed as "00:00"
25
+ # * +AIXM::END_OF_DAY+ - midnight expressed as "24:00"
22
26
  class Time
23
27
  include AIXM::Concerns::HashEquality
24
28
  extend Forwardable
@@ -73,7 +77,7 @@ module AIXM
73
77
  case time_or_event
74
78
  when Symbol
75
79
  self.event = time_or_event
76
- when ::Time, DateTime
80
+ when ::Time, ::DateTime
77
81
  time_or_event = time_or_event.to_time
78
82
  set_time(time_or_event.hour, time_or_event.min, time_or_event.utc_offset)
79
83
  when /\A(\d{2}):?(\d{2}) ?([+-]\d{2}:?\d{2}|UTC)?\z/
@@ -15,10 +15,16 @@ module AIXM
15
15
  # Max flight level used to signal "no upper limit"
16
16
  UNLIMITED = z(999, :qne).freeze
17
17
 
18
+ # Day to signal "whatever date or day"
19
+ ANY_DAY = AIXM.day(:any).freeze
20
+
18
21
  # Timetable used to signal "always active"
19
22
  H24 = timetable(code: :H24).freeze
20
23
 
21
- # Day to signal "whatever date or day"
22
- ANY_DAY = AIXM.day(:any).freeze
24
+ # Time which marks midnight at beginning of the day
25
+ BEGINNING_OF_DAY = AIXM.time('00:00').freeze
26
+
27
+ # Time which marks midnight at end of the day
28
+ END_OF_DAY = AIXM.time('24:00').freeze
23
29
 
24
30
  end
data/lib/aixm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module AIXM
2
- VERSION = "1.3.0".freeze
2
+ VERSION = "1.3.1".freeze
3
3
  end
data/lib/aixm.rb CHANGED
@@ -45,6 +45,7 @@ require_relative 'aixm/p'
45
45
  require_relative 'aixm/schedule/date'
46
46
  require_relative 'aixm/schedule/day'
47
47
  require_relative 'aixm/schedule/time'
48
+ require_relative 'aixm/schedule/date_time'
48
49
 
49
50
  require_relative 'aixm/component'
50
51
  require_relative 'aixm/component/address'
data.tar.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- f���}fu���D`,F��E���ZQ�{�FA��g\���f�,P�*��ϗ@P���;���:7���ܫ�\俭��z ��-}����ʢ挰��N��A�ь�Z*��J�xÕ�smЖ�?Wd4��.7�7�)���
2
- =sZ���/���!wv���cUp��#�����]��yY��R S �O�S� �����՚�af�5
3
- �?����"��8.�lCHv;���P�՗(��e.���m�v��7
1
+ ��W���c
2
+ 滺P~��[9�z'�:������w3w�41�S�/0�Н$f�t��w;�m�O[�l�ϭ�ώKWy��z6�t���L��3�����3xjB��d�!}P9�hQe�-���%�*4��֎�_B��Ku�'Y���5�K��)4FX�}�����&�� �0�PR����B�ՠ�B32�cZ���ӎA8v^���w��Ӎ�����ɹ��M�7|&6;�%7\���4n�M��!�O����r�
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aixm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -10,27 +10,26 @@ bindir: exe
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ0wCwYDVQQDDARydWJ5
14
- MRkwFwYKCZImiZPyLGQBGRYJYml0Y2V0ZXJhMRMwEQYKCZImiZPyLGQBGRYDY29t
15
- MB4XDTIxMTEwODE0MzIyM1oXDTIyMTEwODE0MzIyM1owPzENMAsGA1UEAwwEcnVi
16
- eTEZMBcGCgmSJomT8ixkARkWC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kAyiRqgxF4dJviwtqI7mZIomWL63+kXLgjOjMe1SHxfIPo/0ji6+r1p4KYa7o41v
30
+ fwIwU1MKlFBdsjkd
32
31
  -----END CERTIFICATE-----
33
- date: 2022-05-04 00:00:00.000000000 Z
32
+ date: 2022-11-06 00:00:00.000000000 Z
34
33
  dependencies:
35
34
  - !ruby/object:Gem::Dependency
36
35
  name: nokogiri
@@ -266,6 +265,7 @@ files:
266
265
  - lib/aixm/r.rb
267
266
  - lib/aixm/refinements.rb
268
267
  - lib/aixm/schedule/date.rb
268
+ - lib/aixm/schedule/date_time.rb
269
269
  - lib/aixm/schedule/day.rb
270
270
  - lib/aixm/schedule/time.rb
271
271
  - lib/aixm/shortcuts.rb
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  - !ruby/object:Gem::Version
313
313
  version: '0'
314
314
  requirements: []
315
- rubygems_version: 3.3.13
315
+ rubygems_version: 3.3.25
316
316
  signing_key:
317
317
  specification_version: 4
318
318
  summary: Builder for AIXM/OFMX aeronautical information
metadata.gz.sig CHANGED
Binary file