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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77aa38c27b2e8f26c2dca2a0c7dc3e4e7a29ec6d
4
- data.tar.gz: b12881d8efe483fd75f717e0cfa4d2ef9182c371
3
+ metadata.gz: 992e4f17a5488b4918a443141dcb4c5050afffb0
4
+ data.tar.gz: 1b2314175b6b58df01e81f519490dbc85cb64af3
5
5
  SHA512:
6
- metadata.gz: 959e4e8f4475092e3da1365fe96e1f0c86f934766391af75f6e94e5f3054f749156a3e74ff6cd297bc359940632086cd31f8d6d0995c4e68abe5fa75ff3d1066
7
- data.tar.gz: 0e78902e10b17c12d5843bb600feb7871053b71393a3d1a6d5cb56ec6290b0e31b3900872686de5ccdb35d51fc8e4ffd66ecea02e1e7281da0c60a89371e64eb
6
+ metadata.gz: cf74bb0d0c9e9f9726b00ded3e383e439ba687cfea471d7443ed77e172cebb97fd62d1942d62bd7221621906181c1298517daee57658f026f4bc7b55a5bf2272
7
+ data.tar.gz: 7c4310001e3c78c46fe04d086f43ed1516c983d32c1b60a96d12f84517a24548f5111355cb7d37af2e08f6dafdc849d0a6462ca801cd2192e6d8855625ffe60e
data/README.md CHANGED
@@ -36,7 +36,7 @@ Major differences are:
36
36
  License
37
37
  ---------
38
38
  © 2014 Noah Birnel
39
- Do whatever you want to with this code.
39
+ MIT license
40
40
 
41
41
 
42
42
 
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.0'
3
+ s.version = '0.2.1'
4
4
  s.date = '2014-02-14'
5
- s.summary = 'String methods and CLI to properly title case a headline.'
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.0
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 methods and CLI to properly title case a headline.
50
+ summary: String Methods and CLI to Properly Title Case a Headline.
51
51
  test_files: []