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 +4 -4
- data/README.md +2 -0
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +20 -15
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5064939efa2f734452f37eee44517c0a8d51095a
|
4
|
+
data.tar.gz: b0191dc3bffb802e0be53c69a29597a1d4680b49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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+)
|
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 =~
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
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
|
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
|
|