mightystring 0.1.0 → 0.1.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.
@@ -2,13 +2,17 @@
2
2
  # by Daniel P. Clark
3
3
  # webmaster@6ftdan.com
4
4
 
5
+ # BUMP > after find_all was depreciated from Ruby 1.8.7 this didn't work.
6
+ # And it turns out this is a lot simpler then expected.
7
+ # Here for backwards compatibility.
8
+
5
9
  # Match Partial Case-Insensitive
6
10
  module Match_PCI
7
11
  module String
8
12
  # Match Partial Case-Insensitive: Usage: "My string has this?".matchpci('RinG') => true
9
13
  def match_pci(in_srch = "")
10
14
  if not in_srch.empty?
11
- return !self.find_all{|item| item.downcase.include?(in_srch.downcase)}.empty?
15
+ return !!self.downcase[in_srch.downcase]
12
16
  end
13
17
  return false
14
18
  end
@@ -1,3 +1,3 @@
1
1
  module MightyString
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/test/test_ms.rb CHANGED
@@ -19,13 +19,13 @@ class TestMightyString < Test::Unit::TestCase
19
19
  assert "the apple is the best fruit in the world".index_all "the" == [0, 13, 31]
20
20
  end
21
21
 
22
- def test_matchpci
22
+ def test_match_pci
23
23
  assert "<TD>".match_pci("td")
24
24
  assert "<TD>".match_pci("><") == false
25
25
  assert "Principle".match_pci("rINCi")
26
26
  end
27
27
 
28
- def test_stripbyac
28
+ def test_strip_byac
29
29
  assert "qa2ws3ed4rf5tg6yh7uj8ik9ol".strip_byac( Range.new( "0", "9" ).to_a ) == "23456789"
30
30
 
31
31
  custRange = (Range.new('a','z').to_a + Range.new('A','Z').to_a + [" "]).flatten
metadata CHANGED
@@ -1,80 +1,67 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mightystring
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Daniel P. Clark / 6ftDan(TM)
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-10-26 00:00:00 Z
12
+ date: 2012-12-12 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
- description: Array functionality in Strings as well as Matching, Indexing, Substitution, Deletion, and more.
14
+ description: Array functionality in Strings as well as Matching, Indexing, Substitution,
15
+ Deletion, and more.
22
16
  email: webmaster@6ftdan.com
23
- executables:
17
+ executables:
24
18
  - ms-striphtml
25
19
  extensions: []
26
-
27
- extra_rdoc_files:
20
+ extra_rdoc_files:
28
21
  - README
29
- files:
30
- - bin/ms-striphtml
31
- - lib/mightystring/string_at.rb
32
- - lib/mightystring/strip_html.rb
33
- - lib/mightystring/string_index_all.rb
22
+ files:
34
23
  - lib/mightystring/string_stripbyac.rb
35
24
  - lib/mightystring/string_matchpci.rb
36
25
  - lib/mightystring/string_del.rb
26
+ - lib/mightystring/string_index_all.rb
37
27
  - lib/mightystring/version.rb
28
+ - lib/mightystring/strip_html.rb
29
+ - lib/mightystring/string_at.rb
38
30
  - lib/mightystring.rb
39
31
  - test/test_ms.rb
40
32
  - README
41
33
  - LICENSE
34
+ - bin/ms-striphtml
42
35
  homepage: http://www.github.com/danielpclark/mightystring
43
- licenses:
36
+ licenses:
44
37
  - The MIT License (MIT)
45
- post_install_message: |-
46
- Enjoy MightyString! Your strings are now more powerful.
38
+ post_install_message: ! 'Enjoy MightyString! Your strings are now more powerful.
39
+
47
40
  Peak around inside String and MightyString.
48
- http://www.github.com/danielpclark/mightystring
49
- rdoc_options:
41
+
42
+ http://www.github.com/danielpclark/mightystring'
43
+ rdoc_options:
50
44
  - --main
51
45
  - README
52
- require_paths:
46
+ require_paths:
53
47
  - lib
54
- required_ruby_version: !ruby/object:Gem::Requirement
48
+ required_ruby_version: !ruby/object:Gem::Requirement
55
49
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
63
- required_rubygems_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
55
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- hash: 3
69
- segments:
70
- - 0
71
- version: "0"
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
72
60
  requirements: []
73
-
74
61
  rubyforge_project:
75
62
  rubygems_version: 1.8.24
76
63
  signing_key:
77
64
  specification_version: 3
78
65
  summary: Strings (are) Arrays & Matching, Indexing, Substitution, Deletion, and more.
79
- test_files:
66
+ test_files:
80
67
  - test/test_ms.rb