doing 1.0.1pre → 1.0.2pre

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
  SHA1:
3
- metadata.gz: d81d4068acde0a73c9c4cc7cd51d61ed3ac082e3
4
- data.tar.gz: d3d242a8ea49ad277dd37b829fc121e0bee46ca6
3
+ metadata.gz: 5064939efa2f734452f37eee44517c0a8d51095a
4
+ data.tar.gz: b0191dc3bffb802e0be53c69a29597a1d4680b49
5
5
  SHA512:
6
- metadata.gz: 333bc1be56d38238b60cfcdefaa0c8b259d87fb038b798963f4e405a8d4085f95758a3dc0f9765a0ab56d1f7cced5cfe8dedd1236598988d06631a23b32fd38f
7
- data.tar.gz: 75aaf396ffccd4e620e6a637a37e9d42b5ffc24c02e6a3e7e43d3210ce62627942e582cc049bf4ec20a2d843983e37ff06ea8010ffeb779d84f56a9c597ec1c2
6
+ metadata.gz: 073cafe680ac203949742743bc8b1fb18a92886d85758f0accca35fd363ea481fb33a468d17adb6f64b4433f01b5cf0a2a748eda30b2c35b37165ebbc14d9917
7
+ data.tar.gz: e1ee165879dd1640a07755e903385e1d94f60bc8a13a0dfa1a61de76b2a934cb37f9d9718a114293ec7d6bf078a7b112d6c4579f4232ae31fc0f03a9344a6f80
data/README.md CHANGED
@@ -122,6 +122,8 @@ The config also contains templates for various command outputs. Include placehol
122
122
  - `%odnote`: The notes with a leading tab removed (outdented note)
123
123
  - `%hr`: a horizontal rule (`-`) the width of the terminal
124
124
  - `%hr_under`: a horizontal rule (`_`) the width of the terminal
125
+ - `%n`: inserts a newline
126
+ - `%t`: inserts a tab
125
127
  - `%[color]`: color can be black, red, green, blue, yellow, magenta, cyan or white
126
128
  - you can prefix "bg" to affect background colors (%bgyellow)
127
129
  - prefix "bold" and "boldbg" for strong colors (%boldgreen, %boldbgblue)
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '1.0.1pre'
2
+ VERSION = '1.0.2pre'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -222,7 +222,7 @@ class WWID
222
222
  # Returns:
223
223
  # seconds(Integer)
224
224
  def chronify(input)
225
- if input =~ /^(\d+)\s*([mhd])?/i
225
+ if input =~ /^(\d+)([mhd])?$/i
226
226
  amt = $1
227
227
  type = $2.nil? ? "m" : $2
228
228
  input = case type.downcase
@@ -250,18 +250,20 @@ class WWID
250
250
  if qty.strip =~ /^(\d+):(\d\d)$/
251
251
  minutes += $1.to_i * 60
252
252
  minutes += $2.to_i
253
- elsif qty.strip =~ /\d+\s*[hmd]/
254
- matches = qty.scan(/([\d\.]+)\s*([hmd])/)
255
- matches.each {|m|
256
- case m[1]
257
- when "m"
258
- minutes += m[0].to_i
259
- when "h"
260
- minutes += (m[0].to_f * 60).round
261
- when "d"
262
- minutes += (m[0].to_f * 60 * 24).round
263
- end
264
- }
253
+ elsif qty.strip =~ /^(\d+)([hmd])?$/
254
+ amt = $1
255
+ type = $2.nil? ? "m" : $2
256
+
257
+ minutes = case type.downcase
258
+ when 'm'
259
+ $1.to_i
260
+ when 'h'
261
+ ($1.to_f * 60).round
262
+ when 'd'
263
+ ($1.to_f * 60 * 24).round
264
+ else
265
+ minutes
266
+ end
265
267
  end
266
268
  minutes * 60
267
269
  end
@@ -739,7 +741,7 @@ EOT
739
741
  end
740
742
 
741
743
  if (item.has_key?('note') && !item['note'].empty?) && @config[:include_notes]
742
- note_lines = item['note'].delete_if{|line| line =~ /^\s*$/ }.map{|line| "\t\t" + line.sub(/^\t\t/,'') }
744
+ note_lines = item['note'].delete_if{|line| line =~ /^\s*$/ }.map{|line| "\t" + line.sub(/^\t*/,'') + " " }
743
745
  if opt[:wrap_width] && opt[:wrap_width] > 0
744
746
  width = opt[:wrap_width]
745
747
  note_lines.map! {|line|
@@ -799,7 +801,8 @@ EOT
799
801
  end
800
802
  o
801
803
  end
802
-
804
+ output.gsub!(/%n/,"\n")
805
+ output.gsub!(/%t/,"\t")
803
806
 
804
807
  out += output + "\n"
805
808
  }
@@ -879,6 +882,7 @@ EOT
879
882
  }
880
883
  @content[section]['items'] = moved_items
881
884
  @content[destination]['items'] += items
885
+ @results.push("Archived #{items.length} items from #{section} to #{destination}")
882
886
  else
883
887
 
884
888
  return if items.length < count
@@ -894,6 +898,7 @@ EOT
894
898
  end
895
899
  }
896
900
  @content[destination]['items'] += items[count..-1]
901
+ @results.push("Archived #{items.length - count} items from #{section} to #{destination}")
897
902
  end
898
903
  end
899
904
 
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: 1.0.1pre
4
+ version: 1.0.2pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra