Skip to content

Commit

Permalink
Merge branch 'master' into 514-daily-interval-start-date-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pacso authored Oct 29, 2021
2 parents 50e3c23 + ae5e7b2 commit 2cf2cc6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ schedule.previous_occurrence(from_time)
schedule.previous_occurrences(4, from_time)

# or include prior occurrences with a duration overlapping from_time
schedule.next_occurrences(4, from_time, :spans => true)
schedule.occurrences_between(from_time, to_time, :spans => true)
schedule.next_occurrences(4, from_time, spans: true)
schedule.occurrences_between(from_time, to_time, spans: true)

# or give the schedule a duration and ask if occurring_at?
schedule = IceCube::Schedule.new(now, :duration => 3600)
schedule = IceCube::Schedule.new(now, duration: 3600)
schedule.add_recurrence_rule IceCube::Rule.daily
schedule.occurring_at?(now + 1800) # true
schedule.occurring_between?(t1, t2)

# using end_time also sets the duration
schedule = IceCube::Schedule.new(start = Time.now, :end_time => start + 3600)
schedule = IceCube::Schedule.new(start = Time.now, end_time: start + 3600)
schedule.add_recurrence_rule IceCube::Rule.daily
schedule.occurring_at?(start + 3599) # true
schedule.occurring_at?(start + 3600) # false
Expand Down Expand Up @@ -162,7 +162,7 @@ ice_cube can provide ical or string representations of individual rules, or the
whole schedule.

```ruby
rule = IceCube::Rule.daily(2).day_of_week(:tuesday => [1, -1], :wednesday => [2])
rule = IceCube::Rule.daily(2).day_of_week(tuesday: [1, -1], wednesday: [2])

rule.to_ical # 'FREQ=DAILY;INTERVAL=2;BYDAY=1TU,-1TU,2WE'

Expand Down Expand Up @@ -218,12 +218,12 @@ month (e.g. no occurrences in February for `day_of_month(31)`).

```ruby
# every month on the first and last tuesdays of the month
schedule.add_recurrence_rule IceCube::Rule.monthly.day_of_week(:tuesday => [1, -1])
schedule.add_recurrence_rule IceCube::Rule.monthly.day_of_week(tuesday: [1, -1])

# every other month on the first monday and last tuesday
schedule.add_recurrence_rule IceCube::Rule.monthly(2).day_of_week(
:monday => [1],
:tuesday => [-1]
monday: [1],
tuesday: [-1]
)

# for programmatic convenience (same as above)
Expand Down Expand Up @@ -270,7 +270,7 @@ schedule.add_recurrence_rule IceCube::Rule.hourly(2).day(:monday)
schedule.add_recurrence_rule IceCube::Rule.minutely(10)

# every hour and a half, on the last tuesday of the month
schedule.add_recurrence_rule IceCube::Rule.minutely(90).day_of_week(:tuesday => [-1])
schedule.add_recurrence_rule IceCube::Rule.minutely(90).day_of_week(tuesday: [-1])
```

### Secondly (every N seconds)
Expand Down Expand Up @@ -298,10 +298,7 @@ https://github.com/GetJobber/recurring_select

## Contributors

* Andrew Vit ([@avit][github-avit])
* Mat Brown - [email protected]
* Philip Roberts
* @sakrafd
https://github.com/seejohnrun/ice_cube/graphs/contributors

---

Expand Down
5 changes: 4 additions & 1 deletion ice_cube.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ Gem::Specification.new do |s|
s.description = "ice_cube is a recurring date library for Ruby. It allows for quick, programatic expansion of recurring date rules."
s.author = "John Crepezzi"
s.email = "[email protected]"
s.homepage = "http://seejohnrun.github.com/ice_cube/"
s.homepage = "https://seejohnrun.github.io/ice_cube/"
s.license = "MIT"

s.metadata["changelog_uri"] = "https://github.com/seejohnrun/ice_cube/blob/master/CHANGELOG.md"
s.metadata["wiki_uri"] = "https://github.com/seejohnrun/ice_cube/wiki"

s.version = IceCube::VERSION
s.platform = Gem::Platform::RUBY
s.files = Dir["lib/**/*.rb", "config/**/*.yml"]
Expand Down

0 comments on commit 2cf2cc6

Please sign in to comment.