commentbox 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cbwiz +5 -3
- data/lib/commentbox.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d885fdd08fd18ac60202587ef33d6fc5dc34927c41b3b21b9e29b9c3ad5942b
|
4
|
+
data.tar.gz: 437d8fc15c5e66942db4b88cab58df28b6659653a7748f4044bab06efb2625ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb9910ad5f48e6122c282e6fd8547516b285d820776ab98105f4b2c4220ad6ed03044229034c590997997cbdccef3d1af9d35e6efae4fecba3c836d1e76da618
|
7
|
+
data.tar.gz: dd9301199657470d285fddca65d7b908904b965ec69e99d04e331efb1ecf634270d545919135d7f1d788ec32bd291ef1c8b814d338a4744bef77b565dee0b4e4
|
data/bin/cbwiz
CHANGED
@@ -10,6 +10,7 @@ Options:
|
|
10
10
|
-p, --padding [padding] Padding of comment box
|
11
11
|
-o, --offset [offset] Offset of comment box
|
12
12
|
-w, --stretch [stretch] Stretch of comment box
|
13
|
+
-m, --minwidth [minwidth] Minimum width of comment box (like a more absolute stretch)
|
13
14
|
-sl, --spacelines Remove space lines (default true)
|
14
15
|
-h, --help Display this help message
|
15
16
|
)
|
@@ -44,6 +45,8 @@ ARGV.each do |arg|
|
|
44
45
|
mode = :offset
|
45
46
|
when '-w', '--stretch'
|
46
47
|
mode = :stretch
|
48
|
+
when '-m', '--minwidth', '--min_width', '--min-width'
|
49
|
+
mode = :min_width
|
47
50
|
when '-sl', '--spacelines'
|
48
51
|
mode = :spacelines
|
49
52
|
# default is true so if it's mentioned, we implicitly assume false
|
@@ -58,8 +61,7 @@ ARGV.each do |arg|
|
|
58
61
|
end
|
59
62
|
end
|
60
63
|
end
|
61
|
-
|
62
|
-
|
63
|
-
puts options.to_s
|
64
|
+
# finally, unescape newlines in text
|
65
|
+
options[:text] = options[:text].gsub('\n', "\n")
|
64
66
|
|
65
67
|
puts CommentBox.new options
|
data/lib/commentbox.rb
CHANGED
@@ -124,8 +124,8 @@ class CommentBox
|
|
124
124
|
if params.is_a? String then params = {text: params} end
|
125
125
|
|
126
126
|
# fill in a bunch of instance variables from params or default values
|
127
|
-
@padding = params[:padding]
|
128
|
-
@offset = params[:offset]
|
127
|
+
@padding = (params[:padding] || @@default_params[:padding]).to_i
|
128
|
+
@offset = (params[:offset] || @@default_params[:offset]).to_i
|
129
129
|
# one of the options for this is false, so it's not gonna play nice with ||
|
130
130
|
@spacelines = (params[:spacelines] != nil) ? params[:spacelines] : @@default_params[:spacelines]
|
131
131
|
@stretch = (params[:stretch] || @@default_params[:stretch]).to_i
|