icalendar 2.10.2 → 2.10.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 +4 -4
- data/.github/workflows/main.yml +3 -3
- data/CHANGELOG.md +5 -0
- data/icalendar.gemspec +1 -0
- data/lib/icalendar/value.rb +8 -0
- data/lib/icalendar/values/helpers/time_with_zone.rb +1 -6
- data/lib/icalendar/version.rb +1 -1
- data/spec/spec_helper.rb +6 -0
- data/spec/values/date_spec.rb +24 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '091658a5c785f876d990794ef88444d4ea39e047aaf533ca3e93bfc8549c2495'
|
4
|
+
data.tar.gz: 1292b5e139aae74264694245d9a722bc42e501abe6620b341b12d4922ac3cac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 698656b8f89e982eb58c80cce76c4a8512df6ebdbcc37779eeeb2c57daaf3f180fe0226c3a8bdb66155438e2f71afa6df76b537d8a4cb528646211c850a1e70d
|
7
|
+
data.tar.gz: acd49ceb561f8f5a61be057c3ea00b938a6907a4af9826afd27fe2f484e256d1ff97869d5777ac58e79e55834ed97cc7c56136fb38d6b54f500959dc054c8d22
|
data/.github/workflows/main.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 2.10.3 - 2024-09-21
|
4
|
+
- Override Icalendar::Value.== so that value objects can be compared to each other.
|
5
|
+
- Correctly load activesupport before activesupport/time
|
6
|
+
- Load ostruct to address deprecation warning - aki77
|
7
|
+
|
3
8
|
## 2.10.2 - 2024-07-21
|
4
9
|
- Raise Icalendar::Parser::ParseError on bad .ics file input instead of RuntimeError - Micah Geisel
|
5
10
|
- Remove Ruby 3.0 from the test matrix - still should work for now with ice_cube < 0.17.0
|
data/icalendar.gemspec
CHANGED
@@ -32,6 +32,7 @@ ActiveSupport is required for TimeWithZone support, but not required for general
|
|
32
32
|
s.required_ruby_version = '>= 2.4.0'
|
33
33
|
|
34
34
|
s.add_dependency 'ice_cube', '~> 0.16'
|
35
|
+
s.add_dependency 'ostruct'
|
35
36
|
|
36
37
|
s.add_development_dependency 'rake', '~> 13.0'
|
37
38
|
s.add_development_dependency 'bundler', '~> 2.0'
|
data/lib/icalendar/value.rb
CHANGED
@@ -45,6 +45,14 @@ module Icalendar
|
|
45
45
|
self.class.value_type
|
46
46
|
end
|
47
47
|
|
48
|
+
def ==(other)
|
49
|
+
if other.is_a?(Icalendar::Value)
|
50
|
+
super(other.value) && ical_params == other.ical_params
|
51
|
+
else
|
52
|
+
super
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
48
56
|
private
|
49
57
|
|
50
58
|
def needs_value_type?(default_type)
|
@@ -1,17 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
begin
|
4
|
+
require 'active_support'
|
4
5
|
require 'active_support/time'
|
5
6
|
|
6
7
|
if defined?(ActiveSupport::TimeWithZone)
|
7
8
|
require_relative 'active_support_time_with_zone_adapter'
|
8
9
|
end
|
9
|
-
rescue NameError
|
10
|
-
# ActiveSupport v7+ needs the base require to be run first before loading
|
11
|
-
# specific parts of it.
|
12
|
-
# https://guides.rubyonrails.org/active_support_core_extensions.html#stand-alone-active-support
|
13
|
-
require 'active_support'
|
14
|
-
retry
|
15
10
|
rescue LoadError
|
16
11
|
# tis ok, just a bit less fancy
|
17
12
|
end
|
data/lib/icalendar/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -12,6 +12,12 @@ end
|
|
12
12
|
require 'timecop'
|
13
13
|
require 'icalendar'
|
14
14
|
|
15
|
+
if defined?(ActiveSupport)
|
16
|
+
# this has been default behavior for new Rails apps for a long time, and the
|
17
|
+
# only option once ActiveSupport goes to 8.x
|
18
|
+
ActiveSupport.to_time_preserves_timezone = true if ActiveSupport.respond_to?(:to_time_preserves_timezone=)
|
19
|
+
end
|
20
|
+
|
15
21
|
RSpec.configure do |config|
|
16
22
|
config.run_all_when_everything_filtered = true
|
17
23
|
config.filter_run :focus
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Icalendar::Values::Date do
|
4
|
+
|
5
|
+
subject { described_class.new value, params }
|
6
|
+
let(:value) { '20140209' }
|
7
|
+
let(:params) { {} }
|
8
|
+
|
9
|
+
describe "#==" do
|
10
|
+
let(:other) { described_class.new value }
|
11
|
+
|
12
|
+
it "is equivalent to another Icalendar::Values::Date" do
|
13
|
+
expect(subject).to eq other
|
14
|
+
end
|
15
|
+
|
16
|
+
context "differing params" do
|
17
|
+
let(:params) { {"x-custom-param": "param-value"} }
|
18
|
+
|
19
|
+
it "is no longer equivalent" do
|
20
|
+
expect(subject).not_to eq other
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
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: 2.10.
|
4
|
+
version: 2.10.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: 2024-
|
11
|
+
date: 2024-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ice_cube
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ostruct
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,6 +251,7 @@ files:
|
|
237
251
|
- spec/todo_spec.rb
|
238
252
|
- spec/tzinfo_spec.rb
|
239
253
|
- spec/values/date_or_date_time_spec.rb
|
254
|
+
- spec/values/date_spec.rb
|
240
255
|
- spec/values/date_time_spec.rb
|
241
256
|
- spec/values/duration_spec.rb
|
242
257
|
- spec/values/period_spec.rb
|
@@ -304,6 +319,7 @@ test_files:
|
|
304
319
|
- spec/todo_spec.rb
|
305
320
|
- spec/tzinfo_spec.rb
|
306
321
|
- spec/values/date_or_date_time_spec.rb
|
322
|
+
- spec/values/date_spec.rb
|
307
323
|
- spec/values/date_time_spec.rb
|
308
324
|
- spec/values/duration_spec.rb
|
309
325
|
- spec/values/period_spec.rb
|