headingify 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/headingify/core_ext/string.rb +1 -1
- data/lib/headingify/info.rb +1 -1
- data/spec/headingify_spec.rb +6 -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: 46b07b6c0913390f5e8e0d9b977ce499df45adb1
|
4
|
+
data.tar.gz: 1b9f9823622578038a93d367bd40735ca3e33467
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a60d1388ba154dead5f07eac78da6bec1786648aafa207da1710238204b4f895366248fc6db1893c7f4a68ff43889f956f714a105ea6a7f7b0735468ae8461
|
7
|
+
data.tar.gz: 6b1852d5fa94bcffe0c0789fbf3dd29a4c5290d971bebf4423a5421de6da2d496f5444ffa804e7b1af5f6b619ddf351949ddc353eee38b526fb0f12938a82814
|
@@ -47,7 +47,7 @@ class String
|
|
47
47
|
|
48
48
|
# capitalize only what's necessary
|
49
49
|
working.each_with_index do |s, i|
|
50
|
-
working[i] =
|
50
|
+
working[i] = s.gsub /\%/, "" if s.include? "\%"
|
51
51
|
next if s =~ /^o'.*$/
|
52
52
|
if blacklist.include?(s) && i == 0; s.capitalize!; next; end
|
53
53
|
blacklist.include?(s) ? s.downcase! : s.capitalize!
|
data/lib/headingify/info.rb
CHANGED
data/spec/headingify_spec.rb
CHANGED
@@ -10,7 +10,9 @@ describe Headingify do
|
|
10
10
|
"dad, what are you doing? it's 'shark week'!",
|
11
11
|
"i want to roll you into a little ball and shove you up my vagina.",
|
12
12
|
"i traveled 500 miles to give you my seed!",
|
13
|
-
"a simple string, including the preposition 'with'."
|
13
|
+
"a simple string, including the preposition 'with'.",
|
14
|
+
"this is a \%QuIcK\% test",
|
15
|
+
"\%PI\%"]
|
14
16
|
|
15
17
|
output = ["I'm Dale, but You Have to Call Me Dragon.",
|
16
18
|
"I Swear, I'm so Pissed off at My Mom.",
|
@@ -20,7 +22,9 @@ describe Headingify do
|
|
20
22
|
"Dad, What Are You Doing? It's 'Shark Week'!",
|
21
23
|
"I Want to Roll You into a Little Ball and Shove You up My Vagina.",
|
22
24
|
"I Traveled 500 Miles to Give You My Seed!",
|
23
|
-
"A Simple String, including the Preposition 'with'."
|
25
|
+
"A Simple String, including the Preposition 'with'.",
|
26
|
+
"This Is a QuIcK Test",
|
27
|
+
"PI"]
|
24
28
|
|
25
29
|
input.each_with_index do |s, i|
|
26
30
|
expect(s.headingify).to eq(output[i])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: headingify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Calo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|