legal-poo 0.0.0 → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/legal-poo +16 -1
  2. data/lib/fdosl.txt.erb +2 -5
  3. metadata +3 -3
data/bin/legal-poo CHANGED
@@ -115,7 +115,22 @@ class LegalPoo < Thor
115
115
 
116
116
  def smart_wrap(text, width=80)
117
117
  text.split("\n").collect do |line|
118
- word_wrap(line.strip, line.match(/^(\s*)/)[1], width)+"\n"
118
+ # oh my gosh this is ugly, but the hanging indent is so cool!
119
+ list_rgx = /^\s*?((?:\d+[\.\)]|\*)\s?)/
120
+ prfx_rgx = /^(\s*(?:\*|\d+[\.\)])\s?)/
121
+ if line.match list_rgx
122
+ # cut off the asterisk or number or whatever
123
+ cut = line.match(list_rgx)[1]
124
+ pfx = line.match(prfx_rgx)[1]
125
+ line.gsub!(list_rgx, ' '*cut.length)
126
+ line = word_wrap(line.strip, ' '*pfx.length, width)
127
+ line.gsub!(/(\A\s*)/) { |r| r.gsub!($1, pfx) }
128
+ line+"\n"
129
+ elsif line.match /^\s?$/
130
+ "\n"
131
+ else
132
+ word_wrap(line.strip, line.match(/^(\s*)/)[1], width)+"\n"
133
+ end
119
134
  end
120
135
  end
121
136
 
data/lib/fdosl.txt.erb CHANGED
@@ -10,12 +10,9 @@ This software is licensed under the Firestorm Development Open-Source License, w
10
10
 
11
11
  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
12
12
 
13
- 1. Redistributions of source code must retain the above copyright notice,
14
- this list of conditions and the following disclaimer.
13
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
15
14
 
16
- 2. Redistributions in binary form must reproduce the above copyright notice,
17
- this list of conditions and the following disclaimer in the documentation
18
- and/or other materials provided with the distribution.
15
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
19
16
 
20
17
  THIS SOFTWARE IS PROVIDED BY <%=@copyright_holder.upcase%> "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <%=@copyright_holder.upcase%> OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21
18
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legal-poo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 249797067578206834
4
+ hash: 856480538658449761
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Christopher Miller