calendav 0.5.1 → 0.7.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: b9184c07924c977505c60443440baa861d062b0d79277fc17659e3847033beb0
4
- data.tar.gz: c9e59f88fd7b1774443171047180e75ab6a6dd60323ece5344191625750ad760
3
+ metadata.gz: 34d502fbdb651ebe05b7a94b1883c68b4bf2596c45120325afba8fefef3d6097
4
+ data.tar.gz: 10ce336e86721b9619f0e0bd7cfc07d82159e49d7ed24619f10fd41c1da8578b
5
5
  SHA512:
6
- metadata.gz: 7b0e23683f9359c7670d6a7b9ba1741a866634892c7cd7b190ff1b788f14eaf3e72bfafdde8a7f413cdc0c27bc1871644b0ff41a041f211afdcacc3fce1106c4
7
- data.tar.gz: 8dc1bcb05f35892cad6f3c9e7502cc903d3bf6e771e3f556f34178dcf5d90b44bcffa137aa71735a6af4a849e421102433e531a6f8a66a3b741ce4e1eeff0b83
6
+ metadata.gz: 16133c0de06e2ebe64e351bff39117b908cb935b1cb970b23810373bc3d6012e557dcef41fc4f3b20fdf955014bdc0a8892248e4d7a0b5f4a12e8824cc1e25d0
7
+ data.tar.gz: d384ca0f4a93db9a10aac1e5e83a0280548b87c6b4bf3f8ae1c45ff4224ed2e8d39c98e48754652e4ed52d9c5132f90af68828d553112d4c7fbf5a96eb05c042
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.7.0 - 2026-11-29
4
+
5
+ * Memoise expensive parsing logic for events and todos (François Ferrandis #17)
6
+ * Fix multi_json use in test suite (François Ferrandis #18)
7
+ * Drop support for Ruby versions prior to v3.2.
8
+ * Added a policy banning AI/LLM contributions.
9
+
10
+ ## 0.6.0 - 2026-04-12
11
+
12
+ * Add `current-user-privilege-set` support (Antoine Girard #15)
13
+
3
14
  ## 0.5.1 - 2025-11-21
4
15
 
5
16
  * Expose transp attribute on events (Antoine Girard #14)
data/README.md CHANGED
@@ -309,7 +309,7 @@ With the CalDAV server running, you can now run `rake spec` to run the tests.
309
309
 
310
310
  ## Contributing
311
311
 
312
- Bug reports and pull requests are welcome on GitHub at https://github.com/pat/calendav. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/pat/calendav/blob/main/CODE_OF_CONDUCT.md).
312
+ Bug reports and pull requests are welcome on GitHub at https://github.com/pat/calendav. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/pat/calendav/blob/main/CODE_OF_CONDUCT.md) and [AI/LLMs policy](https://github.com/pat/calendav/blob/main/AI_POLICY.md).
313
313
 
314
314
  ## License
315
315
 
@@ -7,7 +7,7 @@ module Calendav
7
7
  class Calendar
8
8
  ATTRIBUTES = %i[
9
9
  url display_name description ctag etag time_zone color components reports
10
- sync_token
10
+ sync_token current_user_privilege_set
11
11
  ].freeze
12
12
 
13
13
  def self.from_xml(host, node)
@@ -15,6 +15,7 @@ module Calendav
15
15
  class CalendarsClient
16
16
  DEFAULT_ATTRIBUTES = %i[
17
17
  display_name resource_type etag ctag color components reports
18
+ current_user_privilege_set
18
19
  ].freeze
19
20
 
20
21
  def initialize(client, endpoint, credentials)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Calendav
4
- Error = Class.new(StandardError)
4
+ class Error < StandardError; end
5
5
 
6
6
  class ParsingXMLError < Error
7
7
  attr_reader :xml, :original
@@ -30,5 +30,5 @@ module Calendav
30
30
  end
31
31
  end
32
32
 
33
- PreconditionError = Class.new(RequestError)
33
+ class PreconditionError < RequestError; end
34
34
  end
@@ -58,11 +58,11 @@ module Calendav
58
58
  attr_reader :attributes
59
59
 
60
60
  def inner_calendar
61
- Icalendar::Calendar.parse(calendar_data).first
61
+ @inner_calendar ||= Icalendar::Calendar.parse(calendar_data).first
62
62
  end
63
63
 
64
64
  def inner_event
65
- @inner_event = inner_calendar.events.first
65
+ @inner_event ||= inner_calendar.events.first
66
66
  end
67
67
  end
68
68
  end
@@ -24,7 +24,11 @@ module Calendav
24
24
  def call
25
25
  XPATHS
26
26
  .transform_values { |xpath| value(xpath) }
27
- .merge(components: components, reports: reports)
27
+ .merge(
28
+ components: components,
29
+ reports: reports,
30
+ current_user_privilege_set: privileges
31
+ )
28
32
  end
29
33
 
30
34
  private
@@ -43,6 +47,12 @@ module Calendav
43
47
  ).collect(&:name)
44
48
  end
45
49
 
50
+ def privileges
51
+ element.xpath(
52
+ ".//dav:current-user-privilege-set/dav:privilege/*"
53
+ ).collect(&:name)
54
+ end
55
+
46
56
  def value(xpath)
47
57
  node = element.xpath(xpath)
48
58
  return nil if node.children.empty?
@@ -19,6 +19,11 @@ module Calendav
19
19
  key: :components,
20
20
  namespace: "caldav",
21
21
  name: "supported-calendar-component-set"
22
+ },
23
+ {
24
+ key: :current_user_privilege_set,
25
+ namespace: "dav",
26
+ name: "current-user-privilege-set"
22
27
  }
23
28
  ].freeze
24
29
 
data/lib/calendav/todo.rb CHANGED
@@ -50,11 +50,11 @@ module Calendav
50
50
  attr_reader :attributes
51
51
 
52
52
  def inner_calendar
53
- Icalendar::Calendar.parse(calendar_data).first
53
+ @inner_calendar ||= Icalendar::Calendar.parse(calendar_data).first
54
54
  end
55
55
 
56
56
  def inner_todo
57
- @inner_todo = inner_calendar.todos.first
57
+ @inner_todo ||= inner_calendar.todos.first
58
58
  end
59
59
  end
60
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calendav
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Allan
@@ -107,14 +107,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 2.7.0
110
+ version: 3.2.0
111
111
  required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  requirements:
113
113
  - - ">="
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.7.2
117
+ rubygems_version: 4.0.20
118
118
  specification_version: 4
119
119
  summary: CalDAV client
120
120
  test_files: []