zeke-monkey_patches 0.1.9 → 0.1.10

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 1
3
- :patch: 9
3
+ :patch: 10
4
4
  :major: 0
@@ -29,6 +29,11 @@ class String
29
29
  result.gsub!(/^\-|\-$/i, '') # Remove leading/trailing separator.
30
30
  result.downcase
31
31
  end
32
+
33
+ # Removes HTML tags from a string
34
+ def strip_tags
35
+ self.gsub(/<\/?[^>]*>/, "")
36
+ end
32
37
 
33
38
  # Remove first instance of string
34
39
  def nix(string)
@@ -46,6 +46,12 @@ describe "MonkeyPatches" do
46
46
  "We ‘are’ single".replace_wonky_characters_with_ascii.should == "We 'are' single"
47
47
  end
48
48
 
49
+ it "strips tags" do
50
+ "whoa".strip_tags.should == "whoa"
51
+ "<a href='http://shitstorm.com'>click</a>".strip_tags.should == "click"
52
+ "this is <b>bold</b> and <em>emphatic</em>".strip_tags.should == "this is bold and emphatic"
53
+ end
54
+
49
55
  it "nixes" do
50
56
  "this thing that thing".nix("thing").should == "this that thing"
51
57
  end
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.9
4
+ version: 0.1.10
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-04-10 00:00:00 -07:00
12
+ date: 2009-04-22 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15