hron 0.5.1 → 0.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee599aa7c2d192e696b13aa9ce580646930f177d12fea11207c8a0364ce72098
4
- data.tar.gz: 6c0ad8e2e53cad36ceb9e3cf6f93ea2d8a981d1201c739680b3d90fecc74fcc6
3
+ metadata.gz: 83e68eccedae56c786fee25ac787926f1ba648cf98cf6e1574faadbaf8624817
4
+ data.tar.gz: 25fa66640c1a1b132008fe52e96164a6501997dae76a1db470f51bde72bfbdec
5
5
  SHA512:
6
- metadata.gz: 160761a9f062f461cc93613fb4008279fac3200183b128079440c734a328e32a8f682c374692307420ce8c0e672523e8d9db0df5ee854bd096aef4f8b084ce5e
7
- data.tar.gz: f216e50bc6d69ae4a6a6a22396eea71777b051e34e4af3ff21fd245f45a1936385f0a70999276f977c1fb9f12cc16b9a1ce9a594449d4d51b3d01e5799a2a179
6
+ metadata.gz: 7a7be1616230531d0d60285c84c1cddfa9435ccce5fe38253a6a1c3f994baededacd97acbaff727e37d56f3774b2f21ea2a9db6c664820689efa2d5b0f389744
7
+ data.tar.gz: c30d7e497650a4a122f4f0c8c6fb463bea3bc36177b69126da2f250b14cbdbacd5676abb45e97cc44b52cb63aa6d01ba4d6771b4b9c3452d27b7b1e10e5e118b
data/hron.gemspec CHANGED
@@ -9,16 +9,16 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["prasrvenkat@gmail.com"]
10
10
 
11
11
  spec.summary = "Human-readable cron — a scheduling expression language that is a superset of cron"
12
- spec.description = "HRON (Human Readable Object Notation for schedules) is a scheduling expression language " \
12
+ spec.description = "hron (human-readable cron) is a scheduling expression language " \
13
13
  "that is designed to be easy to read, write, and understand. It is a superset of cron, " \
14
- "meaning any valid cron expression can be converted to and from HRON."
14
+ "meaning any valid cron expression can be converted to and from hron."
15
15
  spec.homepage = "https://github.com/prasrvenkat/hron"
16
16
  spec.license = "MIT"
17
17
  spec.required_ruby_version = ">= 4.0.0"
18
18
 
19
19
  spec.metadata["homepage_uri"] = spec.homepage
20
20
  spec.metadata["source_code_uri"] = "https://github.com/prasrvenkat/hron"
21
- spec.metadata["changelog_uri"] = "https://github.com/prasrvenkat/hron/blob/main/CHANGELOG.md"
21
+ spec.metadata["changelog_uri"] = "https://github.com/prasrvenkat/hron/releases"
22
22
  spec.metadata["rubygems_mfa_required"] = "true"
23
23
 
24
24
  spec.files = Dir.chdir(__dir__) do
data/lib/hron/ast.rb CHANGED
@@ -165,11 +165,20 @@ module Hron
165
165
  SingleDay = Data.define(:day)
166
166
  DayRange = Data.define(:start, :end_day) # end_day to avoid Ruby keyword
167
167
 
168
+ # --- Direction for nearest weekday ---
169
+
170
+ module NearestDirection
171
+ NEXT = :next
172
+ PREVIOUS = :previous
173
+ end
174
+
168
175
  # --- Month target variants ---
169
176
 
170
177
  DaysTarget = Data.define(:specs) # specs: Array<DayOfMonthSpec>
171
178
  LastDayTarget = Data.define
172
179
  LastWeekdayTarget = Data.define
180
+ NearestWeekdayTarget = Data.define(:day, :direction) # day: 1-31, direction: nil or NearestDirection
181
+ OrdinalWeekdayTarget = Data.define(:ordinal, :weekday)
173
182
 
174
183
  # --- Year target variants ---
175
184
 
@@ -199,7 +208,6 @@ module Hron
199
208
  DayRepeat = Data.define(:interval, :days, :times)
200
209
  WeekRepeat = Data.define(:interval, :days, :times)
201
210
  MonthRepeat = Data.define(:interval, :target, :times)
202
- OrdinalRepeat = Data.define(:interval, :ordinal, :day, :times)
203
211
  SingleDateExpr = Data.define(:date, :times)
204
212
  YearRepeat = Data.define(:interval, :target, :times)
205
213