icalPal 1.1.4 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a4c83cdb34723fcb8765291ee5724c3a3521d32aa268649631b2ae6e0d597c13
4
- data.tar.gz: 54c399338c62d6ee482ad5240ede35b0b86b7d796320ec95bc6076485e672365
3
+ metadata.gz: 6703471968f72fe70d6335b8c2a374ecb3416d9b38c267087ac94d1b984a341c
4
+ data.tar.gz: 5ddc51e615381d6088da72b88cc2b5845c5311923617301cbfa8c76f423eb0c3
5
5
  SHA512:
6
- metadata.gz: d284b817b3c49f1db9ca67920ccced88a4b0c1247b3137a590568f388b60f9b5e79af493cc16f6384a7d7ae09de16f3e578851cf184df9bcc16e8bf8ab8bef53
7
- data.tar.gz: 716a3c40617e47413ce661157e0bface4671b0b400b1fad3f4bdf0b084d1fc4a9c75f88dfb05a89928749355cce56984692c6e740fd196820a8cb03f06c643aa
6
+ metadata.gz: e587235744a2ebff78e4f539f5db283b1caf2bb087054a49a76de05e5c569c480ceabe4b0f92abf8de84d2162063e7edcceda21212201a3f563d654d0e11e888
7
+ data.tar.gz: 173dbfb9c76e4fa35553430433458cd994ae004d1f99ab474b21e82f1ceb977033cdcf0c7b4d9c4064bc6e18bf851195af56d00a2d59a6c7148b4f758782b229
data/README.md CHANGED
@@ -69,7 +69,7 @@ Global options:
69
69
  --db=DB Use DB file instead of Calendar
70
70
  --cf=FILE Set config file path (default: $HOME/.icalPal)
71
71
  -o, --output=FORMAT Print as FORMAT (default: default)
72
- [ansi, csv, default, hash, html, json, md, rdoc, toc, yaml]
72
+ [ansi, csv, default, hash, html, json, md, rdoc, toc, yaml, remind]
73
73
 
74
74
  Including/excluding calendars:
75
75
 
@@ -132,7 +132,7 @@ Formatting the output:
132
132
  --tf=FORMAT Set time format
133
133
  See https://ruby-doc.org/stdlib-2.6.1/libdoc/date/rdoc/DateTime.html#method-i-strftime for details
134
134
 
135
- -b, --ab=STRING Use STRING for bullets
135
+ -b, --bullet=STRING Use STRING for bullets
136
136
  --nnr=SEPARATOR Set replacement for newlines within notes
137
137
 
138
138
  -f Format output using standard ANSI colors
@@ -160,8 +160,8 @@ automation, and as a desktop widget for apps like
160
160
  [Übersicht](https://tracesof.net/uebersicht/).
161
161
 
162
162
  As with many applications, I started to run into some limitations in
163
- icalBuddy. The biggest being that active development ended over 8
164
- years ago. It's only thanks to the efforts of [Jim
163
+ icalBuddy. The biggest being that active development ended in 2014.
164
+ It's only thanks to the efforts of [Jim
165
165
  Lawton](https://github.com/jimlawton) that it even compiles anymore.
166
166
 
167
167
  Instead of trying to understand and extend the existing code, I chose
@@ -181,7 +181,7 @@ to mimic icalBuddy as much as possible.
181
181
  CSV, Hash, JSON, and YAML print all fields for all items in their
182
182
  respective formats. From that you can analyze the results any way you like.
183
183
 
184
- Remind format uses a minimal implementation built in icalPal.
184
+ [Remind](https://dianne.skoll.ca/projects/remind/) format uses a minimal implementation built in icalPal.
185
185
 
186
186
  Other formats such as ANSI, HTML, Markdown, RDoc, and TOC, use Ruby's
187
187
  [RDoc::Markup](https://ruby-doc.org/stdlib-2.6.10/libdoc/rdoc/rdoc/RDoc/Markup.html)
data/bin/icalPal CHANGED
@@ -17,11 +17,11 @@ require_relative '../lib/options'
17
17
  # Load options
18
18
 
19
19
  # All kids love log!
20
- $log = Logger.new(STDERR, { datetime_format: '%H:%M:%S.%L', level: $defaults[:common][:debug] })
20
+ $log = Logger.new(STDERR, { level: $defaults[:common][:debug] })
21
21
  $log.formatter = proc do |s, t, p, m| # Severity, time, progname, msg
22
22
  ($log.level.positive?)? "#{s}: #{m}\n" :
23
23
  "[%-5s] %s [%s] - %s\n" %
24
- [ s, t.strftime($log.datetime_format), caller(4, 1)[0].split('/')[-1], m ]
24
+ [ s, t.strftime('%H:%M:%S.%L'), caller(4, 1)[0].split('/')[-1], m ]
25
25
  end
26
26
 
27
27
  $opts = ICalPal::Options.new.parse_options
@@ -153,7 +153,7 @@ unless mu
153
153
  write_headers: true,
154
154
  }
155
155
 
156
- CSV.generate(o) { |k| items.each { |i| k << i.values.map { |v| v.to_s } } }
156
+ CSV.generate(**o) { |k| items.each { |i| k << i.values.map { |v| v.to_s } } }
157
157
  when 'hash' then items.map { |i| i.self }
158
158
  when 'json' then items.map { |i| i.self }.to_json
159
159
  when 'yaml' then items.map { |i| i.self }.to_yaml
data/icalPal.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "icalPal"
3
- s.version = "1.1.4"
3
+ s.version = "1.1.6"
4
4
  s.summary = "Command-line tool to query the macOS Calendar"
5
5
  s.description = <<-EOF
6
6
  Inspired by icalBuddy and maintains close compatability. Includes
data/lib/ToICalPal.rb CHANGED
@@ -67,7 +67,7 @@ class RDoc::Markup::ToICalPal < RDoc::Markup::Formatter
67
67
  rescue
68
68
  end
69
69
 
70
- @res << "#{@opts[:bullet]} "
70
+ @res << "#{@opts[:bullet]} " unless @opts[:nb]
71
71
  end
72
72
 
73
73
  # Add a property name
data/lib/options.rb CHANGED
@@ -23,7 +23,7 @@ module ICalPal
23
23
  @op = OptionParser.new
24
24
  @op.summary_width = 23
25
25
  @op.banner += " [-c] COMMAND"
26
- @op.version = '1.1.4'
26
+ @op.version = '1.1.6'
27
27
 
28
28
  @op.accept(ICalPal::RDT) { |s| ICalPal::RDT.conv(s) }
29
29
 
@@ -133,7 +133,8 @@ module ICalPal
133
133
  'See https://ruby-doc.org/stdlib-2.6.1/libdoc/date/rdoc/DateTime.html#method-i-strftime for details')
134
134
 
135
135
  @op.separator('')
136
- @op.on('-b', '--ab=STRING', String, 'Use STRING for bullets')
136
+ @op.on('-b', '--bullet=STRING', String, 'Use STRING for bullets')
137
+ @op.on('--nb', 'Do not use bullets')
137
138
  @op.on('--nnr=SEPARATOR', String, 'Set replacement for newlines within notes')
138
139
 
139
140
  @op.separator('')
data/lib/rdt.rb CHANGED
@@ -29,9 +29,7 @@ module ICalPal
29
29
  def to_s
30
30
  return strftime($opts[:df]) if $opts[:nrd] && $opts[:df]
31
31
 
32
- d1 = RDT.new(year, month, day)
33
-
34
- case Integer(d1 - $today)
32
+ case Integer(RDT.new(year, month, day) - $today)
35
33
  when -2 then 'day before yesterday'
36
34
  when -1 then 'yesterday'
37
35
  when 0 then 'today'
@@ -42,7 +40,7 @@ module ICalPal
42
40
  end
43
41
 
44
42
  alias inspect to_s
45
-
43
+
46
44
  # @see Time.to_a
47
45
  #
48
46
  # @return [Array] Self as an array
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icalPal
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Rosen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-28 00:00:00.000000000 Z
11
+ date: 2024-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3