doing 0.1.5 → 0.1.6

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
  SHA1:
3
- metadata.gz: 51229f7a538c0bacb2a484a3b589ae47225d347e
4
- data.tar.gz: 362a2bb6bf888c1c72adb2e707276c554b9a6b31
3
+ metadata.gz: 6ccdae4ab0a67e874760d5d4fe6fbd78b24f36c5
4
+ data.tar.gz: 22748bcd5b5c737edea91b74da309a56b860839e
5
5
  SHA512:
6
- metadata.gz: e0023e3e4b0e9da5b06e0f11a0e747d02f1bd1650dccf2f4cd633d7638f3b8084240db54af666134cbd11b55f1b1eb0db0e2a89e6e77e2e34c7dc7488015d171
7
- data.tar.gz: 69dd050bafec72448ef0de14e07cb055c908abf9a17a861d6611d744152658acff53fadadbd259a562961af18ef33748540ea7eb708af01e10eb03d9ba880851
6
+ metadata.gz: 9033c80e4da1e79781192f09a3d0c6fe82b7fb28eead86ac6d98d051b7de5dfb22071e89011c0947cdb79a93b5e24dea168d46a4b45a52910e999c5cf18fd57b
7
+ data.tar.gz: de5a4f7aa2bc7157b6850ba3415dbbd050ff77d943f4de135b81e1a9dc362159d879c645cd526c16995f377e1965429aa35db1c6e095c48dc5851049f91382d6
data/README.rdoc CHANGED
@@ -13,6 +13,10 @@ The config file is stored in "~/.doingrc", and is created on the first run. It c
13
13
  - %odnote: The notes with a leading tab removed (outdented note)
14
14
  - %hr: a horizontal rule (`-`) the width of the terminal
15
15
  - %hr_under: a horizontal rule (`_`) the width of the terminal
16
+ - `%[color]`: color can be black, green, blue, yellow, magenta, cyan or white
17
+ - you can prefix "bg" to affect background colors (%bgyellow)
18
+ - prefix "bold" and "boldbg" for strong colors (%boldgreen, %boldbgblue)
19
+
16
20
 
17
21
  Date formats are based on Ruby `strftime` formatting.
18
22
 
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -52,6 +52,13 @@ class WWID
52
52
  'wrap_width' => 0,
53
53
  'section' => 'section_name',
54
54
  'count' => 5
55
+ },
56
+ 'color' => {
57
+ 'date_format' => '%F %_I:%M%P',
58
+ 'template' => '%boldblack%date %boldgreen| %boldwhite%title%default%note',
59
+ 'wrap_width' => 0,
60
+ 'section' => 'Currently',
61
+ 'count' => 10,
55
62
  }
56
63
  }
57
64
 
@@ -245,6 +252,13 @@ class WWID
245
252
  note = ""
246
253
  end
247
254
  output = opt[:template].dup
255
+ output.gsub!(/%[a-z]+/) do |m|
256
+ if colors.has_key?(m.sub(/^%/,''))
257
+ colors[m.sub(/^%/,'')]
258
+ else
259
+ m
260
+ end
261
+ end
248
262
  output.sub!(/%date/,item['date'].strftime(opt[:format]))
249
263
  output.sub!(/%shortdate/) {
250
264
  if item['date'] > Date.today.to_time
@@ -273,6 +287,8 @@ class WWID
273
287
  end
274
288
  o
275
289
  end
290
+
291
+
276
292
  out += output + "\n"
277
293
  }
278
294
 
@@ -291,6 +307,47 @@ class WWID
291
307
  end
292
308
  end
293
309
 
310
+
311
+
312
+ def colors
313
+ color = {}
314
+ color['black'] = "\033[30m"
315
+ color['red'] = "\033[31m"
316
+ color['green'] = "\033[32m"
317
+ color['yellow'] = "\033[33m"
318
+ color['blue'] = "\033[34m"
319
+ color['magenta'] = "\033[35m"
320
+ color['cyan'] = "\033[36m"
321
+ color['white'] = "\033[37m"
322
+ color['bgblack'] = "\033[40m"
323
+ color['bgred'] = "\033[41m"
324
+ color['bggreen'] = "\033[42m"
325
+ color['bgyellow'] = "\033[43m"
326
+ color['bgblue'] = "\033[44m"
327
+ color['bgmagenta'] = "\033[45m"
328
+ color['bgcyan'] = "\033[46m"
329
+ color['bgwhite'] = "\033[47m"
330
+ color['boldblack'] = "\033[1;30m"
331
+ color['boldred'] = "\033[1;31m"
332
+ color['boldgreen'] = "\033[1;32m"
333
+ color['boldyellow'] = "\033[1;33m"
334
+ color['boldblue'] = "\033[1;34m"
335
+ color['boldmagenta'] = "\033[1;35m"
336
+ color['boldcyan'] = "\033[1;36m"
337
+ color['boldwhite'] = "\033[1;37m"
338
+ color['boldbgblack'] = "\033[1;40m"
339
+ color['boldbgred'] = "\033[1;41m"
340
+ color['boldbggreen'] = "\033[1;42m"
341
+ color['boldbgyellow'] = "\033[1;43m"
342
+ color['boldbgblue'] = "\033[1;44m"
343
+ color['boldbgmagenta'] = "\033[1;45m"
344
+ color['boldbgcyan'] = "\033[1;46m"
345
+ color['boldbgwhite'] = "\033[1;47m"
346
+ color['default']="\033[0;39m"
347
+ color
348
+ end
349
+
350
+
294
351
  def all(order="")
295
352
  order = "asc" if order == ""
296
353
  cfg = @config['templates']['default_template']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
@@ -83,12 +83,12 @@ extra_rdoc_files:
83
83
  - README.rdoc
84
84
  - doing.rdoc
85
85
  files:
86
+ - README.rdoc
86
87
  - bin/doing
87
- - lib/doing/version.rb
88
+ - doing.rdoc
88
89
  - lib/doing.rb
90
+ - lib/doing/version.rb
89
91
  - lib/doing/wwid.rb
90
- - README.rdoc
91
- - doing.rdoc
92
92
  homepage: http://brettterpstra.com
93
93
  licenses:
94
94
  - MIT
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.1.11
118
+ rubygems_version: 2.2.2
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: A command line tool for managing What Was I Doing reminders