title_case 0.2.0 → 0.2.1
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/README.md +1 -1
- data/lib/title_case.rb +8 -0
- data/title_case.gemspec +2 -2
- 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: 992e4f17a5488b4918a443141dcb4c5050afffb0
|
|
4
|
+
data.tar.gz: 1b2314175b6b58df01e81f519490dbc85cb64af3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf74bb0d0c9e9f9726b00ded3e383e439ba687cfea471d7443ed77e172cebb97fd62d1942d62bd7221621906181c1298517daee57658f026f4bc7b55a5bf2272
|
|
7
|
+
data.tar.gz: 7c4310001e3c78c46fe04d086f43ed1516c983d32c1b60a96d12f84517a24548f5111355cb7d37af2e08f6dafdc849d0a6462ca801cd2192e6d8855625ffe60e
|
data/README.md
CHANGED
data/lib/title_case.rb
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
class String
|
|
2
|
+
##
|
|
3
|
+
# title_case_word upcases the first alpha character in a string.
|
|
2
4
|
|
|
3
5
|
def title_case_word
|
|
4
6
|
# the non-alpha beginning lets us capitalize "'the'" to "'The'",
|
|
5
7
|
self.sub(/^[^[:alpha:]]*[[:alpha:]]/){|first| first.upcase}
|
|
6
8
|
end
|
|
7
9
|
|
|
10
|
+
##
|
|
11
|
+
# title_case_line capitalizes each 'word' in a string,
|
|
12
|
+
# except for words which already have an upper case letter somewhere in them,
|
|
13
|
+
# and except for short articles, prepositions, conjugations and abbreviations
|
|
14
|
+
# which are not the first word of the string.
|
|
15
|
+
|
|
8
16
|
def title_case_line
|
|
9
17
|
art = "(a)|(an)|(the)"
|
|
10
18
|
prep = "(on)|(in)|(to)|(by)|(for)|(at)|(of)|(as)|(off)|(as)|(out)|(up)"
|
data/title_case.gemspec
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Gem::Specification.new do |s|
|
|
2
2
|
s.name = 'title_case'
|
|
3
|
-
s.version = '0.2.
|
|
3
|
+
s.version = '0.2.1'
|
|
4
4
|
s.date = '2014-02-14'
|
|
5
|
-
s.summary = 'String
|
|
5
|
+
s.summary = 'String Methods and CLI to Properly Title Case a Headline.'
|
|
6
6
|
s.description = 'title_case is a set of Ruby String methods for title casing,
|
|
7
7
|
and a command-line utility using those methods.'
|
|
8
8
|
s.authors = ['Noah Birnel']
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: title_case
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Noah Birnel
|
|
@@ -47,5 +47,5 @@ rubyforge_project:
|
|
|
47
47
|
rubygems_version: 2.2.2
|
|
48
48
|
signing_key:
|
|
49
49
|
specification_version: 4
|
|
50
|
-
summary: String
|
|
50
|
+
summary: String Methods and CLI to Properly Title Case a Headline.
|
|
51
51
|
test_files: []
|