icalPal 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 → Event.rb} +17 -5
- data/lib/{options.rb → Options.rb} +2 -0
- data.tar.gz.sig +0 -0
- metadata +9 -9
- metadata.gz.sig +0 -0
- /data/lib/{calendar.rb → Calendar.rb} +0 -0
- /data/lib/{defaults.rb → Defaults.rb} +0 -0
- /data/lib/{icalPal.rb → ICalPal.rb} +0 -0
- /data/lib/{rdt.rb → RDT.rb} +0 -0
- /data/lib/{store.rb → Store.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e7119ea4a0a4ab593fdaafd6a77b190afae0ee23cdb5977e1b013321d7b9ce7
|
4
|
+
data.tar.gz: 1fd3b99ff20db0a4f87adbdc3e8156b16509087f4f6c023023c0b1462327e724
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835e84ef0fb7d74bd74b064d0ee6f6a31ca9e6450d9beb49b3dc798b77526ca2bd6e9474d2425d0ccd4d35d60201c8bb54afc68cdc1956715285b7f4a259bd9d
|
7
|
+
data.tar.gz: 96b7de3c1fd55bd6acb3d070ef93c7599bb213b6a5dc20b4ecf294e02264a346390f142aad39c2c4ad394a716231405e00f1dc9f4203ed5812d0e193e567819c
|
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 → Event.rb}
RENAMED
@@ -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
|
@@ -136,6 +138,13 @@ module ICalPal
|
|
136
138
|
|
137
139
|
# @!visibility public
|
138
140
|
|
141
|
+
# @return a deep clone of self
|
142
|
+
def clone()
|
143
|
+
self['stime'] = self['sdate'].to_i
|
144
|
+
self['etime'] = self['edate'].to_i
|
145
|
+
Marshal.load(Marshal.dump(self))
|
146
|
+
end
|
147
|
+
|
139
148
|
# Get next occurences of a recurring event
|
140
149
|
#
|
141
150
|
# @param changes [Array] Recurrence changes for the event
|
@@ -177,14 +186,14 @@ module ICalPal
|
|
177
186
|
proc {
|
178
187
|
self['sdate'] = RDT.new(*ndate.to_a[0..2], *self['sdate'].to_a[3..])
|
179
188
|
self['edate'] = RDT.new(*ndate.to_a[0..2], *self['edate'].to_a[3..])
|
180
|
-
retval.push(
|
189
|
+
retval.push(clone)
|
181
190
|
}) { |i| @self['sdate'].to_i == i['orig_date'] + ITIME }
|
182
191
|
end
|
183
192
|
|
184
193
|
# Check for changes
|
185
194
|
changes.detect(
|
186
195
|
proc {
|
187
|
-
retval.push(
|
196
|
+
retval.push(clone)
|
188
197
|
}) { |i| @self['sdate'].to_i == i['orig_date'] + ITIME } unless retval.count.positive?
|
189
198
|
|
190
199
|
retval
|
@@ -238,6 +247,7 @@ CalendarItem.availability,
|
|
238
247
|
CalendarItem.conference_url_detected,
|
239
248
|
CalendarItem.description AS notes,
|
240
249
|
CalendarItem.has_recurrences,
|
250
|
+
CalendarItem.invitation_status,
|
241
251
|
CalendarItem.orig_item_id,
|
242
252
|
CalendarItem.rowid,
|
243
253
|
CalendarItem.start_tz,
|
@@ -258,7 +268,9 @@ Recurrence.count,
|
|
258
268
|
CAST(Recurrence.end_date AS INT) AS rend_date,
|
259
269
|
Recurrence.frequency,
|
260
270
|
Recurrence.interval,
|
261
|
-
Recurrence.specifier
|
271
|
+
Recurrence.specifier,
|
272
|
+
|
273
|
+
min(Alarm.trigger_interval) AS trigger_interval
|
262
274
|
|
263
275
|
FROM Store
|
264
276
|
|
@@ -268,7 +280,7 @@ JOIN CalendarItem ON CalendarItem.calendar_id = Calendar.rowid
|
|
268
280
|
LEFT OUTER JOIN Location ON Location.rowid = CalendarItem.location_id
|
269
281
|
LEFT OUTER JOIN Recurrence ON Recurrence.owner_id = CalendarItem.rowid
|
270
282
|
LEFT OUTER JOIN ExceptionDate ON ExceptionDate.owner_id = CalendarItem.rowid
|
271
|
-
|
283
|
+
LEFT OUTER JOIN Alarm ON Alarm.calendaritem_owner_id = CalendarItem.rowid
|
272
284
|
LEFT OUTER JOIN Participant ON Participant.owner_id = CalendarItem.rowid
|
273
285
|
LEFT OUTER JOIN Identity ON Identity.rowid = Participant.identity_id
|
274
286
|
|
@@ -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.0
|
4
|
+
version: 1.1.0
|
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-05 00:00:00.000000000 Z
|
37
37
|
dependencies: []
|
38
38
|
description: |
|
39
39
|
Inspired by icalBuddy and maintains close compatability. Includes
|
@@ -48,15 +48,15 @@ files:
|
|
48
48
|
- README.md
|
49
49
|
- bin/icalPal
|
50
50
|
- icalPal.gemspec
|
51
|
+
- lib/Calendar.rb
|
52
|
+
- lib/Defaults.rb
|
53
|
+
- lib/Event.rb
|
51
54
|
- lib/EventKit.rb
|
55
|
+
- lib/ICalPal.rb
|
56
|
+
- lib/Options.rb
|
57
|
+
- lib/RDT.rb
|
58
|
+
- lib/Store.rb
|
52
59
|
- lib/ToICalPal.rb
|
53
|
-
- lib/calendar.rb
|
54
|
-
- lib/defaults.rb
|
55
|
-
- lib/event.rb
|
56
|
-
- lib/icalPal.rb
|
57
|
-
- lib/options.rb
|
58
|
-
- lib/rdt.rb
|
59
|
-
- lib/store.rb
|
60
60
|
homepage: https://github.com/ajrosen/icalPal
|
61
61
|
licenses:
|
62
62
|
- GPL-3.0+
|
metadata.gz.sig
CHANGED
Binary file
|
File without changes
|
File without changes
|
File without changes
|
/data/lib/{rdt.rb → RDT.rb}
RENAMED
File without changes
|
/data/lib/{store.rb → Store.rb}
RENAMED
File without changes
|