fat_core 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fat_core/string.rb +5 -2
- data/lib/fat_core/version.rb +1 -1
- data/spec/lib/string_spec.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 743fbec5e5360c89047ded7e33b30772b0029d5d
|
4
|
+
data.tar.gz: afa6788b68f43119c4bf5f90b580bc9e9c997968
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a56a07d6f10c84655fa00684ea1f9fa769e9bc2d75b1b09c072550d9ca5b664885a1f62a67622aa4df093c68f00c46d34f2a8089ed277bc2fa9a26039b64c722
|
7
|
+
data.tar.gz: d20b8c5c3abf1884e3689f15bcbf214440a994207d85d38f1d59774e97651f5fa09a90d92302264be95b8eee34c2a5c53e1db0612de5f5edae5e35ddbe12a4cf
|
data/lib/fat_core/string.rb
CHANGED
@@ -140,8 +140,11 @@ class String
|
|
140
140
|
# Other runs starting with numbers,
|
141
141
|
# like 3-A
|
142
142
|
newwords.push(w.upcase)
|
143
|
-
elsif w =~ %r[^
|
144
|
-
#
|
143
|
+
elsif w =~ %r[^(N|S|E|W|NE|NW|SE|SW)$]i
|
144
|
+
# Compass directions all caps
|
145
|
+
newwords.push(w.upcase)
|
146
|
+
elsif w =~ %r[^[^aeiouy]*$]i && w.size > 2
|
147
|
+
# All consonants and at least 3 chars, probably abbr
|
145
148
|
newwords.push(w.upcase)
|
146
149
|
elsif w =~ %r[^(\w+)-(\w+)$]i
|
147
150
|
# Hypenated double word
|
data/lib/fat_core/version.rb
CHANGED
data/spec/lib/string_spec.rb
CHANGED
@@ -176,6 +176,9 @@ the people, for the people, shall not perish from the earth."
|
|
176
176
|
expect("the cat in the hat".entitle).to eq('The Cat in the Hat')
|
177
177
|
expect("dr".entitle).to eq('Dr')
|
178
178
|
expect("cr".entitle).to eq('Cr')
|
179
|
+
# Capitalize all consonants size if >= 3
|
180
|
+
expect("tr".entitle).to eq('Tr')
|
181
|
+
expect("trd".entitle).to eq('TRD')
|
179
182
|
# Don't capitalize c/o
|
180
183
|
expect("IBM c/o watson".entitle).to eq('Ibm c/o Watson')
|
181
184
|
# Capitlaize p.o.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fat_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel E. Doherty
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simplecov
|