icalPal 4.2.0 → 4.2.1
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/README.md +18 -54
- data/bin/icalPal +46 -22
- data/ext/extconf.rb +7 -22
- data/icalPal.gemspec +1 -1
- data/lib/ToICalPal.rb +22 -64
- data/lib/event.rb +6 -6
- data/lib/icalPal.rb +4 -0
- data/lib/utils.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +4 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 261e842e93e9a86deda06bdbd1f365a574ef8022811138cc3659db1b48d322bc
|
|
4
|
+
data.tar.gz: 75c0f0726cea85b4fa1f1eb7e1638569acc80ec31d5380b2a92752dccdb59f63
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1d2fcebc0aa063ebe0fa783d0e0a4ac0d05e51969fbd945cf9b724a47cd90029be25aafca590ef096b1b6af6eac03a78c9d0b199305d6dc8b2fe6cc9b7f41fc5
|
|
7
|
+
data.tar.gz: a2b98f4ad0a568cf5c2d6f31d277e13d7eb382c16886c612264767987e0ed08655c288e25f4ad6683b13497fb9cc1be9e262bdb034a71f513c5e61017a786d42
|
data/README.md
CHANGED
|
@@ -6,10 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## Description
|
|
8
8
|
|
|
9
|
-
icalPal is a command-line tool to query macOS *Calendar* and
|
|
10
|
-
*Reminders* databases for accounts, calendars, events, and tasks. It
|
|
11
|
-
can be run on any system with [Ruby](https://www.ruby-lang.org/) and
|
|
12
|
-
access to a Calendar or Reminders database.
|
|
9
|
+
icalPal is a command-line tool to query macOS *Calendar* and *Reminders* databases for accounts, calendars, events, and tasks. It can be run on any system with [Ruby](https://www.ruby-lang.org/) and access to a Calendar or Reminders database.
|
|
13
10
|
|
|
14
11
|
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc-refresh-toc -->
|
|
15
12
|
|
|
@@ -52,10 +49,7 @@ brew install icalPal
|
|
|
52
49
|
|
|
53
50
|
### Compatability with icalBuddy
|
|
54
51
|
|
|
55
|
-
icalPal tries to be compatible with
|
|
56
|
-
[icalBuddy](https://github.com/ali-rantakari/icalBuddy) for
|
|
57
|
-
command-line options and for output. There are a some important
|
|
58
|
-
differences to be aware of.
|
|
52
|
+
icalPal tries to be compatible with [icalBuddy](https://github.com/ali-rantakari/icalBuddy) for command-line options and for output. There are a some important differences to be aware of.
|
|
59
53
|
|
|
60
54
|
* Options require two hyphens, except for single-letter options that require one hyphen
|
|
61
55
|
* *eventsFrom* is not supported. Instead there is *--from*, *--to*, and *--days*
|
|
@@ -71,8 +65,7 @@ icalPal also supports additional commands.
|
|
|
71
65
|
|
|
72
66
|
```icalPal accounts```
|
|
73
67
|
|
|
74
|
-
Shows a list of enabled Calendar accounts. Internally they are known
|
|
75
|
-
as *Stores*; you can run ```icalPal stores``` instead.
|
|
68
|
+
Shows a list of enabled Calendar accounts. Internally they are known as *Stores*; you can run ```icalPal stores``` instead.
|
|
76
69
|
|
|
77
70
|
```icalPal datedTasks```
|
|
78
71
|
|
|
@@ -80,12 +73,9 @@ Shows only reminders that have a due date.
|
|
|
80
73
|
|
|
81
74
|
```icalPal reminders```
|
|
82
75
|
|
|
83
|
-
*reminders*, *datedReminders*, *undatedReminders*, and
|
|
84
|
-
*remindersDueBefore* can be used instead of *tasks*
|
|
76
|
+
*reminders*, *datedReminders*, *undatedReminders*, and *remindersDueBefore* can be used instead of *tasks*
|
|
85
77
|
|
|
86
|
-
Reminders can also be viewed in the *Scheduled Reminders* calendar,
|
|
87
|
-
using the *events* commands. Repeating reminders are treated the same
|
|
88
|
-
as repeating events.
|
|
78
|
+
Reminders can also be viewed in the *Scheduled Reminders* calendar, using the *events* commands. Repeating reminders are treated the same as repeating events.
|
|
89
79
|
|
|
90
80
|
### Additional options
|
|
91
81
|
|
|
@@ -275,48 +265,22 @@ Environment variables:
|
|
|
275
265
|
|
|
276
266
|
## Output formats
|
|
277
267
|
|
|
278
|
-
icalPal supports several output formats. The **default** format tries
|
|
279
|
-
to mimic icalBuddy as much as possible.
|
|
268
|
+
icalPal supports several output formats. The **default** format tries to mimic icalBuddy as much as possible.
|
|
280
269
|
|
|
281
|
-
CSV, Hash, JSON, XML, and YAML print all fields for all items in their
|
|
282
|
-
respective formats. From that you can analyze the results any way you
|
|
283
|
-
like. [Remind](https://dianne.skoll.ca/projects/remind/) format uses a
|
|
284
|
-
minimal implementation built into icalPal.
|
|
270
|
+
CSV, Hash, JSON, XML, and YAML print all fields for all items in their respective formats. From that you can analyze the results any way you like. [Remind](https://dianne.skoll.ca/projects/remind/) format uses a minimal implementation built into icalPal.
|
|
285
271
|
|
|
286
|
-
Control characters are escaped in these formats to ensure they remain
|
|
287
|
-
properly formatted.
|
|
272
|
+
Control characters are escaped in these formats to ensure they remain properly formatted.
|
|
288
273
|
|
|
289
|
-
Other formats such as ANSI, HTML, Markdown, RDoc, and TOC, use Ruby's
|
|
290
|
-
[RDoc::Markup](https://ruby-doc.org/stdlib-2.6.10/libdoc/rdoc/rdoc/RDoc/Markup.html)
|
|
291
|
-
framework to build and render the items. See
|
|
292
|
-
[RDoc](https://github.com/ajrosen/icalPal/blob/main/RDoc.md) for a
|
|
293
|
-
breakdown of how icalPal uses RDoc::Markup.
|
|
274
|
+
Other formats such as ANSI, HTML, Markdown, RDoc, and TOC, use Ruby's [RDoc::Markup](https://ruby-doc.org/stdlib-2.6.10/libdoc/rdoc/rdoc/RDoc/Markup.html) framework to build and render the items. See [RDoc](https://github.com/ajrosen/icalPal/blob/main/RDoc.md) for a breakdown of how icalPal uses RDoc::Markup.
|
|
294
275
|
|
|
295
276
|
## History
|
|
296
277
|
|
|
297
|
-
I used icalBuddy for many years. It's great for scripting,
|
|
298
|
-
|
|
299
|
-
[
|
|
300
|
-
|
|
301
|
-
[
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
Lawton](https://github.com/jimlawton) that it even compiles anymore.
|
|
307
|
-
|
|
308
|
-
Instead of trying to understand and extend the existing code, I chose
|
|
309
|
-
to start anew using my language of choice:
|
|
310
|
-
[Ruby](https://www.ruby-lang.org). Using Ruby meant there is *much*
|
|
311
|
-
less code; a little over 2,200 lines vs. 7,000. It also means icalPal
|
|
312
|
-
is multi-platform.
|
|
313
|
-
|
|
314
|
-
Because icalPal is written in Ruby, and not a native Mac application,
|
|
315
|
-
you can run it just about anywhere. It's been tested with the
|
|
316
|
-
versions of Ruby included with macOS Sequoia and Tahoe (2.6.10) and
|
|
317
|
-
[Homebrew](https://brew.sh/) (3.4.x).
|
|
318
|
-
|
|
319
|
-
I won't pretend to understand **why** you would want to run this on
|
|
320
|
-
Linux or Windows. But since icalPal is written in Ruby and gets its
|
|
321
|
-
data directly from the Calendar and Reminders database files instead
|
|
322
|
-
of an API, you *can*.
|
|
278
|
+
I used icalBuddy for many years. It's great for scripting, automation, and as a widget for apps like [Übersicht](https://tracesof.net/uebersicht/), [GeekTool](https://www.tynsoe.org/geektool/), and [SketchyBar](https://felixkratz.github.io/SketchyBar/).
|
|
279
|
+
|
|
280
|
+
As with many applications, I started to run into some limitations in icalBuddy. The biggest being that active development ended in 2014. It's only thanks to the efforts of [Jim Lawton](https://github.com/jimlawton) that it even compiles anymore.
|
|
281
|
+
|
|
282
|
+
Instead of trying to understand and extend the existing code, I chose to start anew using my language of choice: [Ruby](https://www.ruby-lang.org). Using Ruby meant there is *much* less code; a little over 2,200 lines vs. 7,000. It also means icalPal is multi-platform.
|
|
283
|
+
|
|
284
|
+
Because icalPal is written in Ruby, and not a native Mac application, you can run it just about anywhere. It's been tested with the versions of Ruby included with macOS Sequoia and Tahoe (2.6.10) and [Homebrew](https://brew.sh/) (3.4.x).
|
|
285
|
+
|
|
286
|
+
I won't pretend to understand **why** you would want to run this on Linux or Windows. But since icalPal is written in Ruby and gets its data directly from the Calendar and Reminders database files instead of an API, you *can*.
|
data/bin/icalPal
CHANGED
|
@@ -135,7 +135,9 @@ unless success
|
|
|
135
135
|
|
|
136
136
|
$opts[:db].each do |db|
|
|
137
137
|
# Use a real open to get a useful error
|
|
138
|
+
# rubocop: disable Style/FileOpen
|
|
138
139
|
File.open(db).close
|
|
140
|
+
# rubocop: enable Style/FileOpen
|
|
139
141
|
rescue Exception => e
|
|
140
142
|
$log.fatal("#{e}: #{db}")
|
|
141
143
|
|
|
@@ -266,6 +268,7 @@ mu = case $opts[:output]
|
|
|
266
268
|
|
|
267
269
|
items = $items[0..($opts[:li] - 1)]
|
|
268
270
|
|
|
271
|
+
# Machine-friendly formats
|
|
269
272
|
unless mu
|
|
270
273
|
$log.debug("Output in #{$opts[:output]} format")
|
|
271
274
|
|
|
@@ -298,9 +301,9 @@ unless mu
|
|
|
298
301
|
exit
|
|
299
302
|
end
|
|
300
303
|
|
|
304
|
+
# Human-readable formats
|
|
301
305
|
$log.debug("Formatting with #{mu.inspect}")
|
|
302
306
|
|
|
303
|
-
doc = RDoc::Markup::Document.new
|
|
304
307
|
section = nil
|
|
305
308
|
|
|
306
309
|
items.each_with_index do |i, j|
|
|
@@ -309,28 +312,30 @@ items.each_with_index do |i, j|
|
|
|
309
312
|
# --li
|
|
310
313
|
break if $opts[:li].positive? && j >= $opts[:li]
|
|
311
314
|
|
|
312
|
-
#
|
|
313
|
-
|
|
314
|
-
v.format = i
|
|
315
|
-
doc << v
|
|
315
|
+
# Each item is a document
|
|
316
|
+
doc = RDoc::Markup::Document.new
|
|
316
317
|
|
|
317
318
|
# Sections
|
|
318
319
|
if $opts[:sep] && section != i[$opts[:sep]]
|
|
319
320
|
$log.debug("New section '#{$opts[:sep]}': #{i[$opts[:sep]]}") if $log.level <= Logger::DEBUG
|
|
320
321
|
|
|
321
|
-
doc << RDoc::Markup::Raw.new($opts[:sep])
|
|
322
|
-
|
|
323
322
|
doc << RDoc::Markup::BlankLine.new if j.positive?
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
doc << RDoc::Markup::Rule.new(0)
|
|
327
|
-
end
|
|
323
|
+
doc << RDoc::Markup::Heading.new(1, "#{i[$opts[:sep]]}:")
|
|
324
|
+
doc << RDoc::Markup::Rule.new(0)
|
|
328
325
|
|
|
329
326
|
section = i[$opts[:sep]]
|
|
330
327
|
end
|
|
331
328
|
|
|
329
|
+
# Placeholder
|
|
330
|
+
if i['placeholder']
|
|
331
|
+
doc << RDoc::Markup::Raw.new(i['title'])
|
|
332
|
+
doc << RDoc::Markup::BlankLine.new
|
|
333
|
+
print doc.accept(mu)
|
|
334
|
+
next
|
|
335
|
+
end
|
|
336
|
+
|
|
332
337
|
# Item
|
|
333
|
-
props = RDoc::Markup::List.new(:
|
|
338
|
+
props = RDoc::Markup::List.new(:LABEL)
|
|
334
339
|
|
|
335
340
|
# Properties
|
|
336
341
|
$opts[:props].each_with_index do |prop, k|
|
|
@@ -342,22 +347,41 @@ items.each_with_index do |i, j|
|
|
|
342
347
|
|
|
343
348
|
$log.debug("#{prop}: #{value}") if $log.level <= Logger::DEBUG
|
|
344
349
|
|
|
345
|
-
# Use Raw to save the property
|
|
346
|
-
props << RDoc::Markup::Raw.new(prop)
|
|
347
|
-
|
|
348
350
|
if k.positive?
|
|
349
|
-
props << RDoc::Markup::BlankLine.new unless
|
|
350
|
-
|
|
351
|
+
props << RDoc::Markup::BlankLine.new unless $opts[:ps]
|
|
352
|
+
|
|
353
|
+
v = ((value.is_a?(Enumerable))? value.join('; ') : value)
|
|
354
|
+
v = mu.colorize(*mu.DATE_COLOR, v) if prop == 'datetime' && mu.respond_to?('colorize')
|
|
355
|
+
|
|
356
|
+
props << RDoc::Markup::ListItem.new(prop, RDoc::Markup::Paragraph.new(v))
|
|
351
357
|
else
|
|
352
|
-
#
|
|
358
|
+
# Choose bullet
|
|
359
|
+
if mu.is_a?(RDoc::Markup::ToICalPal) && !$opts[:nb]
|
|
360
|
+
bullet = (i['due_date'] && i['due_date'].between?(0, $nowto_i))? $opts[:ab] : $opts[:bullet]
|
|
361
|
+
props << RDoc::Markup::Raw.new("#{bullet} ")
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
# Maybe colorize label
|
|
365
|
+
mu.is_a?(RDoc::Markup::ToICalPal) &&
|
|
366
|
+
mu.COLOR_LABEL.any?(prop) &&
|
|
367
|
+
value = mu.colorize(i['symbolic_color_name'], i['color'], value)
|
|
368
|
+
|
|
369
|
+
# Maybe add calendar to title
|
|
370
|
+
prop == 'title' &&
|
|
371
|
+
i['calendar'] &&
|
|
372
|
+
mu.respond_to?('bold') &&
|
|
373
|
+
!$opts[:nc] &&
|
|
374
|
+
value += mu.bold(" (#{i['calendar']})")
|
|
375
|
+
|
|
353
376
|
props << RDoc::Markup::Heading.new(2, value.to_s)
|
|
354
377
|
end
|
|
355
378
|
end
|
|
356
379
|
|
|
357
380
|
# Print it
|
|
358
|
-
|
|
381
|
+
unless props.empty?
|
|
382
|
+
doc << props
|
|
383
|
+
doc << RDoc::Markup::BlankLine.new
|
|
384
|
+
end
|
|
359
385
|
|
|
360
|
-
doc
|
|
386
|
+
print doc.accept(mu)
|
|
361
387
|
end
|
|
362
|
-
|
|
363
|
-
print doc.accept(mu)
|
data/ext/extconf.rb
CHANGED
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
begin
|
|
2
|
-
require 'mkmf'
|
|
3
2
|
require 'rubygems/dependency_installer'
|
|
4
3
|
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
Gem.path.each { |p| gemdir = p if File.writable? p }
|
|
4
|
+
# Install dependencies that are not already installed
|
|
5
|
+
stubs = Gem::Specification.stubs.map(&:name)
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
dependencies
|
|
7
|
+
dependencies = %w[ plist logger csv json open3 rdoc sqlite3 yaml ]
|
|
8
|
+
dependencies.reject! { |d| stubs.include?(d) }
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
# granular.
|
|
16
|
-
if RUBY_VERSION >= '3.0'
|
|
17
|
-
dependencies.push('logger')
|
|
18
|
-
dependencies.push('csv')
|
|
19
|
-
dependencies.push('json')
|
|
20
|
-
dependencies.push('rdoc')
|
|
21
|
-
dependencies.push('sqlite3')
|
|
22
|
-
dependencies.push('yaml')
|
|
10
|
+
unless dependencies.empty?
|
|
11
|
+
di = Gem::DependencyInstaller.new
|
|
12
|
+
dependencies.each { |d| di.install(d) }
|
|
23
13
|
end
|
|
24
14
|
|
|
25
|
-
di = Gem::DependencyInstaller.new(install_dir: gemdir)
|
|
26
|
-
dependencies.each { |d| di.install(d) }
|
|
27
|
-
|
|
28
15
|
rescue Exception => e
|
|
29
16
|
abort(e)
|
|
30
17
|
end
|
|
31
18
|
|
|
32
|
-
File.write('Makefile', "clean:\n\ttrue\ninstall:\n\ttrue")
|
|
33
|
-
|
|
34
19
|
exit(0)
|
data/icalPal.gemspec
CHANGED
|
@@ -33,7 +33,7 @@ EOF
|
|
|
33
33
|
|
|
34
34
|
s.post_install_message = <<-EOF
|
|
35
35
|
|
|
36
|
-
Note: #{ICalPal::NAME} requires "Full Disk Access" in System Settings to access your calendar.
|
|
36
|
+
Note: #{ICalPal::NAME} requires "Full Disk Access" in System Settings to access your calendar and reminders.
|
|
37
37
|
Make sure the program that runs #{ICalPal::NAME}, not #{ICalPal::NAME} itself, has these permissions.
|
|
38
38
|
|
|
39
39
|
EOF
|
data/lib/ToICalPal.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'rdoc'
|
|
2
|
+
|
|
1
3
|
##################################################
|
|
2
4
|
# Render an RDoc::Markup::Document, closely mimicking
|
|
3
5
|
# icalBuddy[https://github.com/ali-rantakari/icalBuddy]
|
|
@@ -45,19 +47,11 @@ class RDoc::Markup::ToICalPal < RDoc::Markup::Formatter
|
|
|
45
47
|
# Color for datetime value
|
|
46
48
|
DATE_COLOR = [ 'yellow', '#ffff00' ].freeze
|
|
47
49
|
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# @option opts [Boolean] :npn No property names
|
|
54
|
-
# @option opts [Integer] :palette (nil) 8 for \-f, 24 for \--color
|
|
55
|
-
# @option opts [Array<String>] :ps List of property separators
|
|
56
|
-
# @option opts [String] :ss Section separator
|
|
57
|
-
def initialize(opts)
|
|
58
|
-
super
|
|
59
|
-
@opts = opts
|
|
60
|
-
end
|
|
50
|
+
# Accessors for constants
|
|
51
|
+
def NO_LABEL() NO_LABEL end
|
|
52
|
+
def COLOR_LABEL() COLOR_LABEL end
|
|
53
|
+
def LABEL_COLOR() LABEL_COLOR end
|
|
54
|
+
def DATE_COLOR() DATE_COLOR end
|
|
61
55
|
|
|
62
56
|
# Start a new document
|
|
63
57
|
def start_accepting
|
|
@@ -70,29 +64,20 @@ class RDoc::Markup::ToICalPal < RDoc::Markup::Formatter
|
|
|
70
64
|
@res.join
|
|
71
65
|
end
|
|
72
66
|
|
|
73
|
-
# Add a
|
|
67
|
+
# Add a list
|
|
74
68
|
#
|
|
75
69
|
# @param _arg [Array] Ignored
|
|
76
|
-
def accept_list_start(_arg)
|
|
77
|
-
return if @opts[:nb] || @item['placeholder']
|
|
78
|
-
|
|
79
|
-
if @item['due_date'] && (@item['due_date']).between?(0, $nowto_i)
|
|
80
|
-
# Use alert bullet for overdue items
|
|
81
|
-
@res << "#{@opts[:ab]} "
|
|
82
|
-
else
|
|
83
|
-
@res << "#{@opts[:bullet]} "
|
|
84
|
-
end
|
|
85
|
-
end
|
|
70
|
+
def accept_list_start(_arg) end
|
|
86
71
|
|
|
87
72
|
# Add a property name
|
|
88
73
|
#
|
|
89
74
|
# @param arg [RDoc::Markup::ListItem]
|
|
90
75
|
# @option arg [String] .label Contains the property name
|
|
91
76
|
def accept_list_item_start(arg)
|
|
92
|
-
@res << (@
|
|
93
|
-
@res << colorize(*LABEL_COLOR, arg.label) << ': ' unless @
|
|
77
|
+
@res << (@options[:ps][@ps] || ' ')
|
|
78
|
+
@res << colorize(*LABEL_COLOR, arg.label) << ': ' unless @options[:npn] || NO_LABEL.any?(arg.label)
|
|
94
79
|
|
|
95
|
-
@ps += 1 unless @ps == @
|
|
80
|
+
@ps += 1 unless @ps == @options[:ps].count - 1
|
|
96
81
|
end
|
|
97
82
|
|
|
98
83
|
# Add a blank line
|
|
@@ -102,65 +87,38 @@ class RDoc::Markup::ToICalPal < RDoc::Markup::Formatter
|
|
|
102
87
|
@res << "\n"
|
|
103
88
|
end
|
|
104
89
|
|
|
105
|
-
# Add
|
|
106
|
-
#
|
|
107
|
-
# @param h [RDoc::Markup::Heading]
|
|
108
|
-
# @option h [Integer] :level 1 for a section header
|
|
109
|
-
# @option h [Integer] :level 2 for a property name
|
|
110
|
-
# @option h [String] :text The header's text
|
|
90
|
+
# Add a heading
|
|
111
91
|
def accept_heading(h)
|
|
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
92
|
@res << h.text
|
|
114
|
-
|
|
115
|
-
case h.level
|
|
116
|
-
when 1
|
|
117
|
-
@res << ':'
|
|
118
|
-
when 2
|
|
119
|
-
if @prop == 'title' && @item['calendar']
|
|
120
|
-
@res << bold(" (#{@item['calendar']})") unless @opts[:nc] || @item['title'] == @item['calendar']
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
93
|
end
|
|
124
94
|
|
|
125
|
-
# Add
|
|
95
|
+
# Add a paragraph
|
|
126
96
|
#
|
|
127
97
|
# @param p [RDoc::Markup::Paragraph]
|
|
128
98
|
# @option p [Array<String>] :parts The property's text
|
|
129
99
|
def accept_paragraph(p)
|
|
130
|
-
|
|
131
|
-
t = colorize(*DATE_COLOR, t) if @prop == 'datetime'
|
|
132
|
-
@res << t
|
|
100
|
+
@res << p.parts.join('; ').gsub("\n", "\n ")
|
|
133
101
|
end
|
|
134
102
|
|
|
135
|
-
# Add a section separator
|
|
103
|
+
# Add a section separator and a blank line
|
|
136
104
|
#
|
|
137
105
|
# @param _weight Ignored
|
|
138
106
|
def accept_rule(_weight)
|
|
139
|
-
@res << @
|
|
107
|
+
@res << @options[:ss]
|
|
140
108
|
accept_blank_line
|
|
141
109
|
end
|
|
142
110
|
|
|
143
|
-
#
|
|
144
|
-
#
|
|
145
|
-
# @param arg [RDoc::Markup::Verbatim]
|
|
146
|
-
# @option arg [Object] :format The item
|
|
147
|
-
def accept_verbatim(arg)
|
|
148
|
-
@item = arg.format
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
# Don't add anything to the document, just save the property name
|
|
152
|
-
# for later
|
|
111
|
+
# Add raw text
|
|
153
112
|
#
|
|
154
113
|
# @param arg [RDoc::Markup::Raw]
|
|
155
|
-
# @option arg [Object] :parts The property
|
|
156
114
|
def accept_raw(arg)
|
|
157
|
-
@
|
|
115
|
+
@res << arg.parts
|
|
158
116
|
end
|
|
159
117
|
|
|
160
118
|
# @param str [String]
|
|
161
119
|
# @return [String] str with increased intensity[#BOLD]
|
|
162
120
|
def bold(str)
|
|
163
|
-
return str unless @
|
|
121
|
+
return str unless @options[:palette]
|
|
164
122
|
|
|
165
123
|
BOLD + str + NORM
|
|
166
124
|
end
|
|
@@ -169,9 +127,9 @@ class RDoc::Markup::ToICalPal < RDoc::Markup::Formatter
|
|
|
169
127
|
# @param c24 [String] Color used for \--color
|
|
170
128
|
# @return [String] str in color, depending on opts[#]
|
|
171
129
|
def colorize(c8, c24, str)
|
|
172
|
-
return str unless c8 && c24 && @
|
|
130
|
+
return str unless c8 && c24 && @options[:palette]
|
|
173
131
|
|
|
174
|
-
case @
|
|
132
|
+
case @options[:palette]
|
|
175
133
|
when 8 # Default colour table
|
|
176
134
|
c = ANSI[c8.downcase.to_sym]
|
|
177
135
|
c ||= ANSI[c24[0..6].downcase.to_sym]
|
data/lib/event.rb
CHANGED
|
@@ -45,7 +45,7 @@ module ICalPal
|
|
|
45
45
|
EventKit::EKScheduledReminderFlag[@self['flags']] if @self['calendar'] == 'Scheduled Reminders'
|
|
46
46
|
|
|
47
47
|
when 'location' # location[ address]
|
|
48
|
-
|
|
48
|
+
[ @self['location'], @self['address'] ].uniq.join(' ').chop if @self['location']
|
|
49
49
|
|
|
50
50
|
when 'notes' # \n -> :nnr
|
|
51
51
|
(@self['notes'])? @self['notes'].strip.gsub("\n", $opts[:nnr]) : nil
|
|
@@ -75,11 +75,11 @@ module ICalPal
|
|
|
75
75
|
def initialize(obj)
|
|
76
76
|
# Placeholder for days with no events
|
|
77
77
|
return @self = {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
$opts[:sep] => obj,
|
|
79
|
+
'sdate' => obj,
|
|
80
|
+
'placeholder' => true,
|
|
81
|
+
'title' => 'Nothing.',
|
|
82
|
+
} if $opts[:sed] && obj.is_a?(DateTime)
|
|
83
83
|
|
|
84
84
|
super
|
|
85
85
|
|
data/lib/icalPal.rb
CHANGED
|
@@ -124,6 +124,8 @@ module ICalPal
|
|
|
124
124
|
end
|
|
125
125
|
end
|
|
126
126
|
|
|
127
|
+
# @!group Contants
|
|
128
|
+
|
|
127
129
|
# Epoch + 31 years (Mon Jan 1 00:00:00 UTC 2001)
|
|
128
130
|
ITIME = 978_307_200
|
|
129
131
|
|
|
@@ -132,6 +134,8 @@ module ICalPal
|
|
|
132
134
|
# <tt><i>SU, MO, TU, WE, TH, FR, SA</i></tt>
|
|
133
135
|
DOW = { SU: 0, MO: 1, TU: 2, WE: 3, TH: 4, FR: 5, SA: 6 }.freeze
|
|
134
136
|
|
|
137
|
+
# #!endgroup
|
|
138
|
+
|
|
135
139
|
# @!group Accessors
|
|
136
140
|
def [](k)
|
|
137
141
|
@self[k]
|
data/lib/utils.rb
CHANGED
|
@@ -51,7 +51,7 @@ end
|
|
|
51
51
|
|
|
52
52
|
# Get the application icalPal is most likely running in
|
|
53
53
|
#
|
|
54
|
-
# @return [
|
|
54
|
+
# @return [String] The basename of the program whose parent process id is 1 (launchd)
|
|
55
55
|
def ancestor
|
|
56
56
|
ppid = Process.ppid
|
|
57
57
|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: icalPal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.2.
|
|
4
|
+
version: 4.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Rosen
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: |
|
|
14
13
|
Inspired by icalBuddy and maintains close compatability. Includes
|
|
@@ -45,7 +44,7 @@ metadata:
|
|
|
45
44
|
rubygems_mfa_required: 'true'
|
|
46
45
|
post_install_message: |2+
|
|
47
46
|
|
|
48
|
-
Note: icalPal requires "Full Disk Access" in System Settings to access your calendar.
|
|
47
|
+
Note: icalPal requires "Full Disk Access" in System Settings to access your calendar and reminders.
|
|
49
48
|
Make sure the program that runs icalPal, not icalPal itself, has these permissions.
|
|
50
49
|
|
|
51
50
|
rdoc_options: []
|
|
@@ -62,8 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
62
61
|
- !ruby/object:Gem::Version
|
|
63
62
|
version: '0'
|
|
64
63
|
requirements: []
|
|
65
|
-
rubygems_version:
|
|
66
|
-
signing_key:
|
|
64
|
+
rubygems_version: 4.0.6
|
|
67
65
|
specification_version: 4
|
|
68
66
|
summary: Command-line tool to query the macOS Calendar and Reminders
|
|
69
67
|
test_files: []
|