zeke-monkey_patches 0.1.17 → 0.1.18
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.
- data/VERSION.yml +1 -1
- data/lib/monkey_patches.rb +6 -1
- data/spec/monkey_patches_spec.rb +6 -0
- metadata +4 -3
data/VERSION.yml
CHANGED
data/lib/monkey_patches.rb
CHANGED
@@ -147,7 +147,12 @@ class String
|
|
147
147
|
def remove_whitespace
|
148
148
|
self.gnix("\t").split(" ").remove_blanks.join(" ")
|
149
149
|
end
|
150
|
-
|
150
|
+
|
151
|
+
# Returns true if all letters in the string are capitalized
|
152
|
+
def upcase?
|
153
|
+
self.upcase == self
|
154
|
+
end
|
155
|
+
|
151
156
|
def replace_wonky_characters_with_ascii
|
152
157
|
t = self.to_s
|
153
158
|
t.gsub!(/–/, '-') # en-dash
|
data/spec/monkey_patches_spec.rb
CHANGED
@@ -95,6 +95,12 @@ describe "MonkeyPatches" do
|
|
95
95
|
" this \t is also a test ".remove_whitespace.should == "this is also a test"
|
96
96
|
end
|
97
97
|
|
98
|
+
it "determines capitalization" do
|
99
|
+
"This is mixed case".upcase?.should == false
|
100
|
+
"ALL CAPS DUDE".upcase?.should == true
|
101
|
+
"ALL-CAPS, WITH! EXTRA.. CHARS & STUFF/SYMBOLS?".upcase?.should == true
|
102
|
+
end
|
103
|
+
|
98
104
|
# Array specs
|
99
105
|
|
100
106
|
it "removes blank elements from an array" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeke-monkey_patches
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zeke Sikelianos
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-31 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- LICENSE
|
32
32
|
has_rdoc: true
|
33
33
|
homepage: http://github.com/zeke/monkey_patches
|
34
|
+
licenses:
|
34
35
|
post_install_message:
|
35
36
|
rdoc_options:
|
36
37
|
- --inline-source
|
@@ -52,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
53
|
requirements: []
|
53
54
|
|
54
55
|
rubyforge_project:
|
55
|
-
rubygems_version: 1.
|
56
|
+
rubygems_version: 1.3.5
|
56
57
|
signing_key:
|
57
58
|
specification_version: 2
|
58
59
|
summary: A handly collection of helper methods, primarily for String and Array
|