run_ical 0.4.1 → 0.4.2

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
  SHA1:
3
- metadata.gz: 55a00479e1e64797ff7cef62ef61318d8d1d953b
4
- data.tar.gz: 94021608b85f3d67fcfdd1ece1f754bea88667b2
3
+ metadata.gz: a4cd8689f224051c3227966f9ca8ef1068e8585d
4
+ data.tar.gz: 92e22cf7282ab9bf0d821fe12cb25b1a5b0cf1d4
5
5
  SHA512:
6
- metadata.gz: f2b3a48c1e4ca6bd5dff64d3bc0779170edcc7df14c684b9982267c80545ba8e7d7fde402016bdd2f0155c584745b53c2189e04b50ab9ec7f3dcb2d86586f885
7
- data.tar.gz: 68b8c2fc5d9880b5e0e9a33514736bfcfecc3ab0f4ad540fd4eff2117f4c150a7cebfe90e13d53f642d2b83224f40e2219def3b9e1d9682dba9bcd743ef27633
6
+ metadata.gz: 47c80321a6a6f74ee444aed5e7e6f53339ef597bdeb41334d21726b1d66300ccd7f38760e8dc7aef1fa8d961ab264c898505d35866d3f023c2845161691024cd
7
+ data.tar.gz: 2ffa16cd844a2d8bb14f18fc5ac3372db08520d50b26a60e01f03c845e85854338eefc0ca8e43ead8880e7a9918cf78b44dcba909a9f69d2020f7c32fb8edd12
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- run_ical (0.4.1)
4
+ run_ical (0.4.2)
5
5
  activesupport (>= 5.0.0)
6
6
  icalendar (>= 2.0.0)
7
7
 
@@ -1,3 +1,3 @@
1
1
  module RunIcal
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
data/lib/run_ical.rb CHANGED
@@ -25,11 +25,16 @@ module RunIcal
25
25
  data = @program.const_get(:DATA)
26
26
  cal = Icalendar::Calendar.new
27
27
  cal.x_wr_calname = "#{description} for #{@race_date}"
28
- start_date_padding = @race_date.sunday? ? 1 : 2
28
+ start_date_padding = @race_date.saturday? ? 2 : 1
29
29
  start_date = @race_date - (data.size - start_date_padding).days
30
30
 
31
- (start_date..@race_date).to_a.each.with_index do |date, index|
31
+ date_list = (start_date..@race_date).to_a
32
+ date_list.each.with_index do |date, index|
32
33
  activity = data[index][:activity]
34
+ if activity =~ /rest/i && @race_date.saturday? && index == date_list.size - 1
35
+ activity = data[index + 1][:activity]
36
+ end
37
+
33
38
  cal.event do |e|
34
39
  e.dtstart = Icalendar::Values::Date.new(date)
35
40
  e.dtend = Icalendar::Values::Date.new(date)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: run_ical
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Cashin