caldav.rb 0.0.1 → 0.1.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: cd83567be6a0888519587dec09f4c94aea73cf679f3f32156bb1faa5e47bfba5
4
- data.tar.gz: efff3242239f80e621a790ddacdc94b8caf6d9e6f7c3ffe7f19b6831a595edef
3
+ metadata.gz: 1bade6bf8d4171a511851eab788d9a4e0c6926ee1cfa8811ce61ba1a8b4e61ba
4
+ data.tar.gz: 428761e5e9978cab9cae7ae1e15a38cbec9dade3b3547b2be5168851abc46645
5
5
  SHA512:
6
- metadata.gz: 888f26ce9164ee670b1ec54a4551e2d75978e851091100d8b90427fad5228f880be92dc33d3e16401a7eb3016420ad30a662e0d328fcbfe4ae76b87686cc0637
7
- data.tar.gz: 132bf372fcd50edcbb2ea9de6b657b6595a020f8c30b2870ba5a26bee5541094b6eedc65b8a8c1cbb33068fd834e9fa109ee280e7143e21496801152b572e6b3
6
+ metadata.gz: 7f43dad1403215dc884edd5ad4cd54e7f5d1ef30f72926c949be39c30ddc141fde805b895f057533e6a7acd5b2a2fe822de29557f47971ba1e308b147650fa70
7
+ data.tar.gz: 96ce0a9f7c0894180276d7d33e22b4b5df287ddd1fdbfc9bdbfed589021cb14e650bc10d77a6ce33e46d0b9a84684363f4c21d63a5deb8cc87ca7b5a9b20c55c
data/CHANGELOG CHANGED
@@ -1,5 +1,19 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 20260623
4
+
5
+ 0.1.0: Complete the RFC 4791 §5.2 navigation surface.
6
+
7
+ 1. + CalDAV::Resource#supported_calendar_data (§5.2.4)
8
+ 2. + CalDAV::Resource#max_resource_size (§5.2.5)
9
+ 3. + CalDAV::Resource#min_date_time (§5.2.6)
10
+ 4. + CalDAV::Resource#max_date_time (§5.2.7)
11
+ 5. + CalDAV::Resource#max_instances (§5.2.8)
12
+ 6. + CalDAV::Resource#max_attendees_per_instance (§5.2.9)
13
+ 7. + CalDAV::Resource unit tests for the six accessors. supported-calendar-data is an empty-element-with-attributes property, so it falls through MultiStatus#parse_properties to its serialised markup (like supported-calendar-component-set); the other five are plain text-valued. All return raw strings — no Integer/time coercion, which stays Layer 2's job.
14
+ 8. ~ README navigation-accessor list.
15
+ 9. ~ VERSION: /0.0.1/0.1.0/
16
+
3
17
  ## 20260621
4
18
 
5
19
  0.0.1: Lowercase load file; require VERSION; MultiStatus tests.
data/README.md CHANGED
@@ -99,7 +99,13 @@ The REPORT verbs return `CalDAV::MultiStatus`, a type-preserving subclass of `We
99
99
  - `calendar_data` — the iCalendar string from `<c:calendar-data>`
100
100
  - `calendar_description` — `<c:calendar-description>`
101
101
  - `supported_calendar_component_set` — `<c:supported-calendar-component-set>`
102
+ - `supported_calendar_data` — `<c:supported-calendar-data>`
102
103
  - `calendar_timezone` — the VTIMEZONE string from `<c:calendar-timezone>`
104
+ - `max_resource_size` — `<c:max-resource-size>`
105
+ - `min_date_time` — `<c:min-date-time>`
106
+ - `max_date_time` — `<c:max-date-time>`
107
+ - `max_instances` — `<c:max-instances>`
108
+ - `max_attendees_per_instance` — `<c:max-attendees-per-instance>`
103
109
  - `is_calendar?` — true when `<d:resourcetype>` includes `<c:calendar/>`
104
110
 
105
111
  These are strictly navigation: they return raw strings and values, never parsed iCalendar objects. Parsing is Layer 2's job.
@@ -34,10 +34,34 @@ class CalDAV < WebDAV
34
34
  property(NAMESPACE, 'supported-calendar-component-set')
35
35
  end
36
36
 
37
+ def supported_calendar_data
38
+ property(NAMESPACE, 'supported-calendar-data')
39
+ end
40
+
37
41
  def calendar_timezone
38
42
  property(NAMESPACE, 'calendar-timezone')
39
43
  end
40
44
 
45
+ def max_resource_size
46
+ property(NAMESPACE, 'max-resource-size')
47
+ end
48
+
49
+ def min_date_time
50
+ property(NAMESPACE, 'min-date-time')
51
+ end
52
+
53
+ def max_date_time
54
+ property(NAMESPACE, 'max-date-time')
55
+ end
56
+
57
+ def max_instances
58
+ property(NAMESPACE, 'max-instances')
59
+ end
60
+
61
+ def max_attendees_per_instance
62
+ property(NAMESPACE, 'max-attendees-per-instance')
63
+ end
64
+
41
65
  # Matches a <calendar> element (under any namespace prefix) in the serialised
42
66
  # resourcetype, rather than a bare 'calendar' substring: the substring also
43
67
  # matches calendar-proxy-read/write collections, which are not calendars.
@@ -4,5 +4,5 @@
4
4
  class WebDAV; end
5
5
 
6
6
  class CalDAV < WebDAV
7
- VERSION = '0.0.1'
7
+ VERSION = '0.1.0'
8
8
  end
@@ -13,6 +13,12 @@ describe CalDAV::Resource do
13
13
  <d:prop>
14
14
  <d:resourcetype><d:collection/><c:calendar/></d:resourcetype>
15
15
  <c:calendar-description>Work calendar</c:calendar-description>
16
+ <c:supported-calendar-data><c:calendar-data content-type="text/calendar" version="2.0"/></c:supported-calendar-data>
17
+ <c:max-resource-size>10485760</c:max-resource-size>
18
+ <c:min-date-time>19000101T000000Z</c:min-date-time>
19
+ <c:max-date-time>20491231T235959Z</c:max-date-time>
20
+ <c:max-instances>100</c:max-instances>
21
+ <c:max-attendees-per-instance>25</c:max-attendees-per-instance>
16
22
  </d:prop>
17
23
  <d:status>HTTP/1.1 200 OK</d:status>
18
24
  </d:propstat>
@@ -61,6 +67,30 @@ describe CalDAV::Resource do
61
67
  _(event_resource.calendar_data).must_equal 'BEGIN:VCALENDAR'
62
68
  end
63
69
 
70
+ it "reads supported-calendar-data as serialised markup" do
71
+ _(calendar_resource.supported_calendar_data).must_match %r{<(?:\w+:)?calendar-data\b[^>]*content-type=['"]text/calendar['"][^>]*version=['"]2\.0['"]}
72
+ end
73
+
74
+ it "reads max-resource-size" do
75
+ _(calendar_resource.max_resource_size).must_equal '10485760'
76
+ end
77
+
78
+ it "reads min-date-time" do
79
+ _(calendar_resource.min_date_time).must_equal '19000101T000000Z'
80
+ end
81
+
82
+ it "reads max-date-time" do
83
+ _(calendar_resource.max_date_time).must_equal '20491231T235959Z'
84
+ end
85
+
86
+ it "reads max-instances" do
87
+ _(calendar_resource.max_instances).must_equal '100'
88
+ end
89
+
90
+ it "reads max-attendees-per-instance" do
91
+ _(calendar_resource.max_attendees_per_instance).must_equal '25'
92
+ end
93
+
64
94
  it "identifies a calendar collection" do
65
95
  _(calendar_resource.is_calendar?).must_equal true
66
96
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: caldav.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran