icalPal 3.10.2 → 4.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: a19cb126e559cf9684d82d4d47eebfefe1a058dadc63ca642693d1ac488a97b0
4
- data.tar.gz: 562f98a62d93eda9a03de31a5d1a09a7ddf9841d97abe0ea7d335a0976625dc7
3
+ metadata.gz: d4b7182e130e10193863e5b5b524977b5d373aa13a6a9db809e67249e8b04ce6
4
+ data.tar.gz: 65caec1dde0005f62256ac196de8f5a20fcf62aa16cbef37a43a249a08f31a5b
5
5
  SHA512:
6
- metadata.gz: 659550c0e455ff95a565dbc7d2af162872e14126b35f50f7c8cbaee43c154252d2ef45748421540ab2bc7bde89e50aba0135280a093d086a37e3df970adefd89
7
- data.tar.gz: 941c218eef0998cc5356dac3e23cd91ea00046f6463b01e0bf6ebb651f008ce00c615d3c787945ec707a9fda35cdb25e733f10058464234ccb93d092213d727e
6
+ metadata.gz: 7ad00fb2a168c77de262d4f121f9a08b628e398c831da59cda5fb33e9b37cecfc122b309eb65d9c2d964902c9f55e5a3a9b5bea7a8f4aa76ff84cae5d99e98c5
7
+ data.tar.gz: fa60df16a0afd9de3c1385406bddd2c1ea6ec868d6fd0ace59b7ae2e5a58c866f7301b4629ced941984a7652c13b4d7646cb2d442d05d524b8cce60fd26d0ece
data/ext/extconf.rb CHANGED
@@ -9,31 +9,16 @@ begin
9
9
  # Dependencies common to all environments
10
10
  dependencies = %w[ plist ]
11
11
 
12
- if RUBY_VERSION >= '3.4'
13
- # bigdecimal is not part of the default gems starting from Ruby 3.4.0.
14
- # csv is not part of the default gems starting from Ruby 3.4.0.
15
- dependencies.push('bigdecimal')
12
+ # All dependencies are included with the installation of Ruby in
13
+ # macOS. Adding these dependencies anyway will cause errors that
14
+ # prevent icalPal from being installed.
15
+ unless RUBY_VERSION >= '2.6'
16
+ dependencies.push('logger')
16
17
  dependencies.push('csv')
17
-
18
- # The macOS and Homebrew versions of rubygems have incompatible
19
- # requirements for sqlite3.
20
- #
21
- # macOS 15.5 (Sequoia) comes with version 1.3.13, so it does not
22
- # need to be added as a dependency, and it cannot install anything
23
- # newer:
24
- #
25
- # requires Ruby version >= 3.0, < 3.4.dev. The current ruby version is 2.6.10.
26
- #
27
- # Homebrew's Ruby formula does not come with sqlite3, so it does
28
- # need to be added as a dependency, but it cannot install version
29
- # 1.3.13:
30
- #
31
- # error: call to undeclared function
32
- #
33
- # So neither environment can install the other's sqlite3 gem. We
34
- # must install sqlite3, but iff we are not building with macOS'
35
- # Ruby installation.
18
+ dependencies.push('json')
19
+ dependencies.push('rdoc')
36
20
  dependencies.push('sqlite3')
21
+ dependencies.push('yaml')
37
22
  end
38
23
 
39
24
  di = Gem::DependencyInstaller.new(install_dir: gemdir)
data/lib/EventKit.rb CHANGED
@@ -23,6 +23,11 @@ class EventKit
23
23
  canceled: 3,
24
24
  }.freeze
25
25
 
26
+ EKScheduledReminderFlag = %w[
27
+ TODO
28
+ Completed
29
+ ].freeze
30
+
26
31
  EKRecurrenceFrequency = %w[
27
32
  daily
28
33
  weekly
data/lib/ToICalPal.rb CHANGED
@@ -109,7 +109,7 @@ class RDoc::Markup::ToICalPal < RDoc::Markup::Formatter
109
109
  # @option h [Integer] :level 2 for a property name
110
110
  # @option h [String] :text The header's text
111
111
  def accept_heading(h)
112
- h.text = colorize(@item['symbolic_color_name'], @item['color'], h.text) if (h.level == 2) || COLOR_LABEL.any?(@prop)
112
+ h = RDoc::Markup::Heading.new(h.level, colorize(@item['symbolic_color_name'], @item['color'], h.text)) if (h.level == 2) || COLOR_LABEL.any?(@prop)
113
113
  @res << h.text
114
114
 
115
115
  case h.level
data/lib/event.rb CHANGED
@@ -16,8 +16,8 @@ module ICalPal
16
16
  end
17
17
 
18
18
  # Standard accessor with special handling for +age+,
19
- # +availability+, +datetime+, +location+, +notes+, +sday+,
20
- # +status+, +uid+, and +event+/+name+/+title+
19
+ # +availability+, +datetime+, +flags+, +location+, +notes+,
20
+ # +sday+, +status+, +uid+, and +event+/+name+/+title+
21
21
  #
22
22
  # @param k [String] Key/property name
23
23
  def [](k)
@@ -41,6 +41,9 @@ module ICalPal
41
41
  end
42
42
  t
43
43
 
44
+ when 'flags' # Integer -> String
45
+ EventKit::EKScheduledReminderFlag[@self['flags']] if @self['calendar'] == 'Scheduled Reminders'
46
+
44
47
  when 'location' # location[ address]
45
48
  (@self['location'])? [ @self['location'], @self['address'] ].join(' ').chop : nil
46
49
 
@@ -96,7 +99,7 @@ module ICalPal
96
99
  # Save as seconds, Time, RDT
97
100
  ctime = obj[k] + ITIME
98
101
  ctime -= Time.at(ctime).utc_offset if obj["#{k.split('_')[0]}_tz"] == '_float' && !zone
99
- ttime = Time.at(ctime, in: zone)
102
+ ttime = (zone)? Time.at(ctime, in: zone) : Time.at(ctime)
100
103
 
101
104
  @self["#{k[0]}seconds"] = ctime
102
105
  @self["#{k[0]}ctime"] = ttime
@@ -344,6 +347,7 @@ CalendarItem.availability,
344
347
  CalendarItem.conference_url_detected,
345
348
  CalendarItem.description AS notes,
346
349
  CalendarItem.end_tz,
350
+ CalendarItem.flags,
347
351
  CalendarItem.has_recurrences,
348
352
  CalendarItem.invitation_status,
349
353
  CalendarItem.orig_item_id,
data/lib/options.rb CHANGED
@@ -304,7 +304,7 @@ module ICalPal
304
304
  $log.level = opts[:debug]
305
305
 
306
306
  # For posterity
307
- opts[:ruby] = RUBY_VERSION
307
+ opts[:ruby] = RUBY_DESCRIPTION
308
308
  opts[:version] = @op.version
309
309
 
310
310
  # From the Department of Redundancy Department
data/lib/rdt.rb CHANGED
@@ -3,16 +3,28 @@ module ICalPal
3
3
  class RDT < DateTime
4
4
 
5
5
  # Create a new RDT from a Time object
6
+ #
7
+ # @param t [Time] The Time object
8
+ #
9
+ # @return [RDT] a new RDT
6
10
  def self.from_time(t)
7
- new(*t.to_a[0..5].reverse, (t.gmt_offset / 3600).to_s)
11
+ new(*t.to_a[0..5].reverse, Rational((t.gmt_offset / 3600), 24))
8
12
  end
9
13
 
10
14
  # Create a new RDT from seconds since epoch
15
+ #
16
+ # @param s [Integer] Seconds since the Unix epoch (Thu Jan 1 00:00:00 UTC 1970)
17
+ #
18
+ # @return [RDT] a new RDT
11
19
  def self.from_epoch(s)
12
20
  from_time(Time.at(s))
13
21
  end
14
22
 
15
23
  # Create a new RDT from seconds since iCal epoch
24
+ #
25
+ # @param s [Integer] Seconds since the iCal epoch (Jan 1 00:00:00 UTC 2001)
26
+ #
27
+ # @return [RDT] a new RDT
16
28
  def self.from_itime(s)
17
29
  from_epoch(s + ITIME)
18
30
  end
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module ICalPal
2
2
  NAME = 'icalPal'.freeze
3
- VERSION = '3.10.2'.freeze
3
+ VERSION = '4.1.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icalPal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.2
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Rosen
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  requirements: []
64
- rubygems_version: 3.6.9
64
+ rubygems_version: 4.0.3
65
65
  specification_version: 4
66
66
  summary: Command-line tool to query the macOS Calendar and Reminders
67
67
  test_files: []