icalPal 1.0.2 → 1.1.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
- checksums.yaml.gz.sig +0 -0
- data/README.md +0 -2
- data/bin/icalPal +55 -45
- data/icalPal.gemspec +1 -1
- data/lib/event.rb +20 -7
- data/lib/options.rb +2 -0
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8950d0b14f9309fd520aba9eb995c55903cdad42171b32582188f94c66e3f0c3
|
4
|
+
data.tar.gz: ca6c0377e5215300dead2823200e4a3383a510c18e5b9077f403acfe87d950aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1580173a395e45c255d25e755a87cd18666f87f7d30803fd98ce4d74b52b6bd149650744294bcc2d41fd267471636b6c04563e47f694a4624a41dec712609885
|
7
|
+
data.tar.gz: 0370bc4bada2cfa8b221017e78edad0467a58a55132e646a7b64ac770743a61b1ef9b8a85413f05a6876360cf7c0d3e7d1d29551b5d827138eb4d4273648fbad
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
data/bin/icalPal
CHANGED
@@ -124,7 +124,6 @@ end
|
|
124
124
|
# Configure formatting
|
125
125
|
mu = case $opts[:output]
|
126
126
|
when 'ansi' then RDoc::Markup::ToAnsi.new
|
127
|
-
when 'csv' then proc { |f| f.respond_to?(:gsub)? f.gsub(/\n/, '\n') : f }
|
128
127
|
when 'default' then RDoc::Markup::ToICalPal.new($opts)
|
129
128
|
when 'html' then
|
130
129
|
rdoc = RDoc::Options.new
|
@@ -140,65 +139,76 @@ mu = case $opts[:output]
|
|
140
139
|
##################################################
|
141
140
|
# Print the data
|
142
141
|
|
142
|
+
items = $items[0..$opts[:li] - 1]
|
143
|
+
|
144
|
+
unless mu
|
145
|
+
puts case $opts[:output]
|
146
|
+
when 'csv' then
|
147
|
+
o = {
|
148
|
+
headers: items[0].keys,
|
149
|
+
write_converters: proc { |f| f.respond_to?(:gsub)? f.gsub(/\n/, '\n') : f },
|
150
|
+
write_headers: true,
|
151
|
+
}
|
152
|
+
|
153
|
+
CSV.generate(o) { |k| items.each { |i| k << i.values.map { |v| v.to_s } } }
|
154
|
+
when 'hash' then items.map { |i| i.self }
|
155
|
+
when 'json' then items.map { |i| i.self }.to_json
|
156
|
+
when 'yaml' then items.map { |i| i.self }.to_yaml
|
157
|
+
else abort "No formatter for #{$opts[:output]}"
|
158
|
+
end
|
159
|
+
|
160
|
+
exit
|
161
|
+
end
|
162
|
+
|
143
163
|
section = nil if $opts[:sep]
|
144
164
|
|
145
|
-
|
165
|
+
items.each_with_index do |i, j|
|
146
166
|
# --li
|
147
167
|
break if $opts[:li].positive? && j >= $opts[:li]
|
148
168
|
|
149
|
-
|
150
|
-
when 'csv' then
|
151
|
-
values = i.values.map { |v| v.to_s }
|
152
|
-
puts CSV.generate(write_converters: mu) { |k| k << i.keys } unless j.positive?
|
153
|
-
puts CSV.generate(write_converters: mu) { |k| k << values }
|
154
|
-
when 'hash' then p i.self
|
155
|
-
when 'json' then puts i.self.to_json
|
156
|
-
when 'yaml' then puts i.self.to_yaml
|
157
|
-
else
|
158
|
-
doc = RDoc::Markup::Document.new
|
169
|
+
doc = RDoc::Markup::Document.new
|
159
170
|
|
160
|
-
|
161
|
-
|
162
|
-
|
171
|
+
# Sections
|
172
|
+
if $opts[:sep] && section != i[$opts[:sep]]
|
173
|
+
$log.debug("Section: #{i[$opts[:sep]]}")
|
163
174
|
|
164
|
-
|
165
|
-
|
166
|
-
|
175
|
+
v = RDoc::Markup::Verbatim.new
|
176
|
+
v.format = { item: i, prop: $opts[:sep] }
|
177
|
+
doc << v
|
167
178
|
|
168
|
-
|
169
|
-
|
170
|
-
|
179
|
+
doc << RDoc::Markup::BlankLine.new if j.positive?
|
180
|
+
doc << RDoc::Markup::Heading.new(1, i[$opts[:sep]].to_s)
|
181
|
+
doc << RDoc::Markup::Rule.new(0)
|
171
182
|
|
172
|
-
|
173
|
-
|
183
|
+
section = i[$opts[:sep]]
|
184
|
+
end
|
174
185
|
|
175
|
-
|
176
|
-
|
186
|
+
# Item
|
187
|
+
props = RDoc::Markup::List.new(:BULLET)
|
177
188
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
189
|
+
# Properties
|
190
|
+
$opts[:props].each_with_index do |prop, k|
|
191
|
+
next unless i[prop]
|
192
|
+
next if Array === i[prop] && !i[prop][0]
|
182
193
|
|
183
|
-
|
194
|
+
$log.debug("#{prop}: #{i[prop]}")
|
184
195
|
|
185
|
-
|
186
|
-
|
187
|
-
|
196
|
+
v = RDoc::Markup::Verbatim.new
|
197
|
+
v.format = { item: i, prop: prop }
|
198
|
+
props << v
|
188
199
|
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
end
|
200
|
+
unless k.positive?
|
201
|
+
# First property, value only
|
202
|
+
props << RDoc::Markup::Heading.new(2, i[prop].to_s)
|
203
|
+
else
|
204
|
+
props << RDoc::Markup::BlankLine.new unless (i['placeholder'] || $opts[:ps])
|
205
|
+
props << RDoc::Markup::ListItem.new(prop, RDoc::Markup::Paragraph.new(i[prop]))
|
196
206
|
end
|
207
|
+
end
|
197
208
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
end
|
209
|
+
# Print it
|
210
|
+
unless props.empty?
|
211
|
+
doc << props
|
212
|
+
puts doc.accept(mu)
|
203
213
|
end
|
204
214
|
end
|
data/icalPal.gemspec
CHANGED
data/lib/event.rb
CHANGED
@@ -95,8 +95,10 @@ module ICalPal
|
|
95
95
|
|
96
96
|
# Repeat for multi-day events
|
97
97
|
((self['duration'] / 86400).to_i + 1).times do |i|
|
98
|
-
|
98
|
+
self['daynum'] = i + 1
|
99
|
+
retval.push(clone) if in_window?(self['sdate'])
|
99
100
|
self['sdate'] += 1
|
101
|
+
self['edate'] += 1
|
100
102
|
end
|
101
103
|
|
102
104
|
retval
|
@@ -118,12 +120,13 @@ module ICalPal
|
|
118
120
|
|
119
121
|
i = 1
|
120
122
|
while self['sdate'] <= stop
|
123
|
+
return(retval) if self['count'].positive? && i > self['count']
|
124
|
+
i += 1
|
125
|
+
|
121
126
|
unless @self['xdate'].any?(@self['sdate']) # Exceptions?
|
122
127
|
o = get_occurrences(changes)
|
123
128
|
o.each { |r| retval.push(r) if in_window?(r['sdate'], r['edate']) }
|
124
129
|
|
125
|
-
i += 1
|
126
|
-
return(retval) if self['count'].positive? && i > self['count']
|
127
130
|
end
|
128
131
|
|
129
132
|
apply_frequency!
|
@@ -136,6 +139,13 @@ module ICalPal
|
|
136
139
|
|
137
140
|
# @!visibility public
|
138
141
|
|
142
|
+
# @return a deep clone of self
|
143
|
+
def clone()
|
144
|
+
self['stime'] = self['sdate'].to_i
|
145
|
+
self['etime'] = self['edate'].to_i
|
146
|
+
Marshal.load(Marshal.dump(self))
|
147
|
+
end
|
148
|
+
|
139
149
|
# Get next occurences of a recurring event
|
140
150
|
#
|
141
151
|
# @param changes [Array] Recurrence changes for the event
|
@@ -177,14 +187,14 @@ module ICalPal
|
|
177
187
|
proc {
|
178
188
|
self['sdate'] = RDT.new(*ndate.to_a[0..2], *self['sdate'].to_a[3..])
|
179
189
|
self['edate'] = RDT.new(*ndate.to_a[0..2], *self['edate'].to_a[3..])
|
180
|
-
retval.push(
|
190
|
+
retval.push(clone)
|
181
191
|
}) { |i| @self['sdate'].to_i == i['orig_date'] + ITIME }
|
182
192
|
end
|
183
193
|
|
184
194
|
# Check for changes
|
185
195
|
changes.detect(
|
186
196
|
proc {
|
187
|
-
retval.push(
|
197
|
+
retval.push(clone)
|
188
198
|
}) { |i| @self['sdate'].to_i == i['orig_date'] + ITIME } unless retval.count.positive?
|
189
199
|
|
190
200
|
retval
|
@@ -238,6 +248,7 @@ CalendarItem.availability,
|
|
238
248
|
CalendarItem.conference_url_detected,
|
239
249
|
CalendarItem.description AS notes,
|
240
250
|
CalendarItem.has_recurrences,
|
251
|
+
CalendarItem.invitation_status,
|
241
252
|
CalendarItem.orig_item_id,
|
242
253
|
CalendarItem.rowid,
|
243
254
|
CalendarItem.start_tz,
|
@@ -258,7 +269,9 @@ Recurrence.count,
|
|
258
269
|
CAST(Recurrence.end_date AS INT) AS rend_date,
|
259
270
|
Recurrence.frequency,
|
260
271
|
Recurrence.interval,
|
261
|
-
Recurrence.specifier
|
272
|
+
Recurrence.specifier,
|
273
|
+
|
274
|
+
min(Alarm.trigger_interval) AS trigger_interval
|
262
275
|
|
263
276
|
FROM Store
|
264
277
|
|
@@ -268,7 +281,7 @@ JOIN CalendarItem ON CalendarItem.calendar_id = Calendar.rowid
|
|
268
281
|
LEFT OUTER JOIN Location ON Location.rowid = CalendarItem.location_id
|
269
282
|
LEFT OUTER JOIN Recurrence ON Recurrence.owner_id = CalendarItem.rowid
|
270
283
|
LEFT OUTER JOIN ExceptionDate ON ExceptionDate.owner_id = CalendarItem.rowid
|
271
|
-
|
284
|
+
LEFT OUTER JOIN Alarm ON Alarm.calendaritem_owner_id = CalendarItem.rowid
|
272
285
|
LEFT OUTER JOIN Participant ON Participant.owner_id = CalendarItem.rowid
|
273
286
|
LEFT OUTER JOIN Identity ON Identity.rowid = Participant.identity_id
|
274
287
|
|
data/lib/options.rb
CHANGED
@@ -174,6 +174,8 @@ module ICalPal
|
|
174
174
|
@op.parse!(File.read(File.expand_path(cli[:cf])).split, into: cf) rescue nil
|
175
175
|
|
176
176
|
cli[:cmd] ||= @op.default_argv[0]
|
177
|
+
cli[:cmd] ||= env[:cmd] if env[:cmd]
|
178
|
+
cli[:cmd] ||= cf[:cmd] if cf[:cmd]
|
177
179
|
cli[:cmd] = 'stores' if cli[:cmd] == 'accounts'
|
178
180
|
|
179
181
|
# Parse eventsNow and eventsToday commands
|
data.tar.gz.sig
CHANGED
Binary file
|
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: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Rosen
|
@@ -33,7 +33,7 @@ cert_chain:
|
|
33
33
|
PDmWrfNO9LeQhiYLyVsOQ1xuWKDF0acQFAVIZctRp4VuZZMVqis4FRmqMdZcB/R2
|
34
34
|
HaQXi3DWVibRuVZ3N77DWUKG
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date: 2023-
|
36
|
+
date: 2023-03-21 00:00:00.000000000 Z
|
37
37
|
dependencies: []
|
38
38
|
description: |
|
39
39
|
Inspired by icalBuddy and maintains close compatability. Includes
|
metadata.gz.sig
CHANGED
Binary file
|