commentbox 0.3.0 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/cbwiz +8 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5bf8ca4be9a56802c326ec4f5e1562262bf40d334571113c70ca11847c904195
4
- data.tar.gz: ec433e2a0da5b227827e00f35033a626cb521a67668d2dc79a4061e7ffceb98f
3
+ metadata.gz: 8c9924ff53c559dcf315eb35ecc7587b702a1a7bd561a126910f9b1d51a073b1
4
+ data.tar.gz: aa7434f90f115cecdca5a6b1f1735c82622127ac47343bb052c59f3b7a760373
5
5
  SHA512:
6
- metadata.gz: 1aea4172ca5e47d5d2dc79b25249d577e3c4d5d61f9b04e11fa7925ff2d77719dbc43a3418fd198d4e2c92a0b728552049e071933caf50078eceee81c3fd2c87
7
- data.tar.gz: 3580327e9e93b7043bfdc64fb48a48ce0fbfc8b4372736aa5a49f527a2e955b4706190ddc5c91032eedbb4f2f6e1a866e2be324a53b8f1c1856b301f4dfccf0b
6
+ metadata.gz: b38c2d5f76c2554890d9fc309e313d8339ec9d4b150817d275b23ef16d3e50dc5841b9d77d3724048f3f4fc91ceaaa2b313dc52171d6ecda2cdf0554622a7187
7
+ data.tar.gz: d888803e4c6a6a53ca7896d4f3fce2664f7109f5ae877e1bc00858789583ae0e4981ed7cd0e53ddd13a5c6e3c966e09e68f25b15169d8017682efe616e3ec0d2
data/bin/cbwiz CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'commentbox'
4
4
 
5
- $HELP_MSG = %q(Usage: cb_script.rb [options] [text]
5
+ $HELP_MSG = %q(Usage: cbwiz [options] [text]
6
6
  Options:
7
7
  -t, --text [text] Text to be commented. Optional flag for first argument
8
8
  -a, --align [l1, l2...] Alignment of text: left, center, right
@@ -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
  )
@@ -34,8 +35,8 @@ ARGV.each do |arg|
34
35
  help_and_exit
35
36
  when '-t', '--text'
36
37
  mode = :text
37
- when '-a', '--align'
38
- mode = :align
38
+ when '-a', '--align', '--alignment'
39
+ mode = :alignment
39
40
  when '-s', '--style'
40
41
  mode = :style
41
42
  when '-p', '--padding'
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commentbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leonard H. Phelan IV