string_utility_belt 0.2.1 → 0.2.2
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.
@@ -28,11 +28,16 @@ class String
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def regex_builder options={}
|
31
|
+
|
31
32
|
self.gsub!(/\*/,'.*') if options[:any]
|
33
|
+
|
34
|
+
regex_latin_ci_list if options[:latin_chars_variation]
|
35
|
+
|
32
36
|
border_me(options[:border][:to],
|
33
37
|
options[:border][:direction]) if options[:border]
|
34
|
-
|
38
|
+
|
35
39
|
insert_OR_in_right unless options[:delete_or]
|
40
|
+
|
36
41
|
self
|
37
42
|
end
|
38
43
|
|
data/lib/regex_me/regex_me.rb
CHANGED
@@ -52,10 +52,9 @@ module RegexMe
|
|
52
52
|
def builder string, exact_word, border_to, latin_chars_variation, exact_phrase
|
53
53
|
|
54
54
|
if exact_phrase
|
55
|
-
regexp = string.gsub(/\s+/, " ").gsub(/\s/, '[^0-9a-zA-Z\_]+').regex_builder(:
|
56
|
-
:delete_or => true,
|
55
|
+
regexp = string.gsub(/\s+/, " ").regex_latin_ci_list.gsub(/\s/, '[^0-9a-zA-Z\_]+').regex_builder(:delete_or => true,
|
57
56
|
:border => {:to => border_to,
|
58
|
-
|
57
|
+
:direction => :both})
|
59
58
|
else
|
60
59
|
regexp = '('
|
61
60
|
|
data/string_utility_belt.gemspec
CHANGED
@@ -2,7 +2,7 @@ $LOAD_PATH << File.join(File.dirname(__FILE__), 'lib')
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "string_utility_belt"
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.2"
|
6
6
|
s.description = "Useful methods for strings!"
|
7
7
|
s.summary = "Useful methods for strings!"
|
8
8
|
s.author = "Rodrigo Serradura"
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string_utility_belt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rodrigo Serradura
|