icalendar 1.4.2 → 1.4.3

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: 037c1a6dc0343e14f0ee3ab43f078385795d9b1c
4
- data.tar.gz: e14616a6a69ca12590b9634100708b3f3b7276c6
3
+ metadata.gz: 8a1a061b2cdba8b3b5058a77d5a3f6c06a795c34
4
+ data.tar.gz: a404fedca32cb195c8f939b42e384114a227611d
5
5
  SHA512:
6
- metadata.gz: fcd6f74754bd83938a343d5f5b5fe9c3e70d22fc135f83960c5a615226c7d9418a0e972d2fa0daee663f60e40a21bf88f85e5327a3c7fff06defcfb08699d128
7
- data.tar.gz: 9e400bf9c4c693f97e98759d020a3616d754fb7630ee75ddbb9cc8a824d9951c349157fd91e5911048691992171f0ff8d4df079fd81e9a408b50613982aecb66
6
+ metadata.gz: 825777c1bd1bd283931d9ed8b81305ba0bfa2ffc6114054452b2ea47f300114d3c1704cf53a15a21abbb81ba5b2ff5190c14797aece6d0f56de6288194f45967
7
+ data.tar.gz: 6f568404d5a15e36d83294552076135504b964516780f856aa60e3d7a3ba40f6a93dde4bd1e95c658d8c3cb00818d2ae761e3aae21a0d7d6b11073ddb1c82fbb
@@ -11,7 +11,7 @@ require 'logger'
11
11
 
12
12
  module Icalendar #:nodoc:
13
13
 
14
- VERSION = '1.4.2'
14
+ VERSION = '1.4.3'
15
15
 
16
16
  # A simple error class to differentiate iCalendar library exceptions
17
17
  # from ruby language exceptions or others.
@@ -21,14 +21,14 @@ module Icalendar
21
21
  #
22
22
  # Example:
23
23
  # rules = event.recurrence_rules.map{ |rule| rule.orig_value }
24
-
24
+
25
25
  class RRule < Icalendar::Base
26
-
26
+
27
27
  class Weekday
28
28
  def initialize(day, position)
29
29
  @day, @position = day, position
30
30
  end
31
-
31
+
32
32
  def to_s
33
33
  "#{@position}#{@day}"
34
34
  end
@@ -54,7 +54,7 @@ module Icalendar
54
54
  @by_list[:bysetpos] = parse_int_list("BYSETPOS", value)
55
55
  @wkst = parse_wkstart(value)
56
56
  end
57
-
57
+
58
58
  # Returns the original pre-parsed RRULE value.
59
59
  def orig_value
60
60
  @value
@@ -68,28 +68,22 @@ module Icalendar
68
68
  result << "COUNT=#{count}" if count
69
69
  result << "INTERVAL=#{interval}" if interval
70
70
  by_list.each do |key, value|
71
- if value
72
- if key == :byday
73
- result << "BYDAY=#{value.join ','}"
74
- else
75
- result << "#{key.to_s.upcase}=#{value}"
76
- end
77
- end
71
+ result << "#{key.to_s.upcase}=#{value.join ','}" if value
78
72
  end
79
73
  result << "WKST=#{wkst}" if wkst
80
74
  result.join ';'
81
75
  end
82
-
76
+
83
77
  def parse_date_val(name, string)
84
78
  match = string.match(/;#{name}=(.*?)(;|$)/)
85
79
  match ? DateTime.parse(match[1]) : nil
86
80
  end
87
-
81
+
88
82
  def parse_int_val(name, string)
89
83
  match = string.match(/;#{name}=(\d+)(;|$)/)
90
84
  match ? match[1].to_i : nil
91
85
  end
92
-
86
+
93
87
  def parse_int_list(name, string)
94
88
  match = string.match(/;#{name}=([+-]?.*?)(;|$)/)
95
89
  if match
@@ -98,7 +92,7 @@ module Icalendar
98
92
  nil
99
93
  end
100
94
  end
101
-
95
+
102
96
  def parse_weekday_list(name, string)
103
97
  match = string.match(/;#{name}=(.*?)(;|$)/)
104
98
  if match
@@ -120,7 +114,7 @@ module Icalendar
120
114
  nil
121
115
  end
122
116
  end
123
-
117
+
124
118
  # TODO: Incomplete
125
119
  def occurrences_of_event_starting(event, datetime)
126
120
  initial_start = event.dtstart
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icalendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Ahearn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-11 00:00:00.000000000 Z
11
+ date: 2013-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake