icalPal 3.9.1 → 3.9.2

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: a3c3807a9fd8957753d06626cb7fa9d2fa34853352a4e28ace5302d8abcf706d
4
- data.tar.gz: 8f9c792ca674a18037e89eed786f4c66db91b0e1105ba483d66fb73710281f79
3
+ metadata.gz: 726009d217b28c21e4a35339eef172f033429792b68d4c36157e6234f6221cab
4
+ data.tar.gz: cf2ee63838a89a8acf25719154d03654e1bbf1fe47459481ddcb5e09f19a31f0
5
5
  SHA512:
6
- metadata.gz: 0b21f98466467cd6b2e2f518f3d5591c5e3b0abd6c1562b482950294512a3e0e57e2d95a2de96581886ac80b6da6d46d59cef01942684602018af6c7f05a5fa0
7
- data.tar.gz: '0209a037605af52065d6727a2dd9ec06ddc9028ff801de2da5c4eb6825ad8aceb1a4a58747a172f22db85eee25d1b1724f9f4f337fe32473df6c604f77603d2e'
6
+ metadata.gz: 7120724aaa3be333484a6feca64cb1cf5b6f5ded5e93b5a4f6c99ec6e247ddd659bcc7c4f3af70b7b3e81dc28b1221bebac88d29c70bc497a89f242689ae088b
7
+ data.tar.gz: b452c105b9ea954aa9c68a9b7a4088599b32b0b1b29e3f783804ec692eef65e8c7a1d916d3b9061c475ed880b950f9eebf31d870c8eda7751f33e4fd79bc9ae9
data/README.md CHANGED
@@ -280,11 +280,12 @@ to mimic icalBuddy as much as possible.
280
280
 
281
281
  CSV, Hash, JSON, XML, and YAML print all fields for all items in their
282
282
  respective formats. From that you can analyze the results any way you
283
- like.
284
-
285
- [Remind](https://dianne.skoll.ca/projects/remind/) format uses a
283
+ like. [Remind](https://dianne.skoll.ca/projects/remind/) format uses a
286
284
  minimal implementation built into icalPal.
287
285
 
286
+ Control characters are escaped in these formats to ensure they remain
287
+ properly formatted.
288
+
288
289
  Other formats such as ANSI, HTML, Markdown, RDoc, and TOC, use Ruby's
289
290
  [RDoc::Markup](https://ruby-doc.org/stdlib-2.6.10/libdoc/rdoc/rdoc/RDoc/Markup.html)
290
291
  framework to build and render the items.
data/bin/icalPal CHANGED
@@ -290,7 +290,7 @@ unless mu
290
290
  when 'remind' then items.map { |i|
291
291
  "REM #{i['sdate'].strftime('%F AT %R')} " +
292
292
  "DURATION #{((i['edate'] - i['sdate']).to_f * 1440).to_i} " +
293
- "MSG #{i['title']}"
293
+ "MSG #{i['title'].gsub(/([[:cntrl:]])/) { |c| c.dump[1..-2] } }"
294
294
  }.join("\n")
295
295
  else abort "No formatter for #{$opts[:output]}"
296
296
  end
data/bin/icalpal CHANGED
@@ -290,7 +290,7 @@ unless mu
290
290
  when 'remind' then items.map { |i|
291
291
  "REM #{i['sdate'].strftime('%F AT %R')} " +
292
292
  "DURATION #{((i['edate'] - i['sdate']).to_f * 1440).to_i} " +
293
- "MSG #{i['title']}"
293
+ "MSG #{i['title'].gsub(/([[:cntrl:]])/) { |c| c.dump[1..-2] } }"
294
294
  }.join("\n")
295
295
  else abort "No formatter for #{$opts[:output]}"
296
296
  end
data/lib/icalPal.rb CHANGED
@@ -88,14 +88,17 @@ module ICalPal
88
88
  obj['symbolic_color_name'] ||= type[:color]
89
89
  end
90
90
 
91
- # Create a new CSV::Row with values from +self+. Newlines are
92
- # replaced with '\n' to ensure each Row is a single line of text.
91
+ # Create a new CSV::Row with values from +self+. Control characters
92
+ # are escaped to ensure they are not interpreted by the terminal.
93
93
  #
94
94
  # @param headers [Array] Key names used as the header row in a CSV::Table
95
95
  # @return [CSV::Row] The +Store+, +Calendar+, +CalendarItem+, or
96
96
  # +Reminder+ as a CSV::Row
97
97
  def to_csv(headers)
98
- values = headers.map { |h| (@self[h].respond_to?(:gsub))? @self[h].gsub("\n", '\n') : @self[h] }
98
+ values = headers.map do |h|
99
+ (@self[h].respond_to?(:gsub))?
100
+ @self[h].gsub(/([[:cntrl:]])/) { |c| c.dump[1..-2] } : @self[h]
101
+ end
99
102
 
100
103
  CSV::Row.new(headers, values)
101
104
  end
data/lib/options.rb CHANGED
@@ -337,6 +337,8 @@ module ICalPal
337
337
  raise(OptionParser::InvalidArgument, '--li cannot be negative') if opts[:li].negative?
338
338
  raise(OptionParser::InvalidOption, 'Start date must be before end date') if opts[:from] && opts[:from] > opts[:to]
339
339
  raise(OptionParser::MissingArgument, 'No properties to display') if opts[:props].empty?
340
+ raise(OptionParser::InvalidArgument, 'Cannot use remind output with tasks') if opts[:cmd] == 'tasks' &&
341
+ opts[:output] == 'remind'
340
342
 
341
343
  rescue StandardError => e
342
344
  @op.abort("#{e}\n\n#{@op.help}\n#{e}")
data/lib/reminder.rb CHANGED
@@ -53,7 +53,7 @@ module ICalPal
53
53
  when 'name', 'reminder', 'task' # Aliases
54
54
  @self['title']
55
55
 
56
- else @self[k]
56
+ else super
57
57
  end
58
58
  end
59
59
 
data/lib/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module ICalPal
2
2
  NAME = 'icalPal'.freeze
3
- VERSION = '3.9.1'.freeze
3
+ VERSION = '3.9.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icalPal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.1
4
+ version: 3.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Rosen
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-08-11 00:00:00.000000000 Z
10
+ date: 2025-08-23 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: |
13
13
  Inspired by icalBuddy and maintains close compatability. Includes