useless_string 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.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +1 -0
- data/Rakefile +0 -0
- data/lib/compare_without.rb +6 -0
- data/lib/equal_without.rb +4 -0
- data/lib/helpers/without_helper.rb +6 -1
- data/lib/useless_string.rb +0 -0
- data/lib/useless_string/version.rb +1 -1
- data/lib/with_only_starter.rb +0 -0
- data/lib/without_starter.rb +1 -1
- data/useless_string.gemspec +0 -0
- 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: be1d8270d9f5ea13c2c59b798840b9f3aef96202
|
4
|
+
data.tar.gz: b96884005116a76932a4fcc67cfce9dc9838830b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9fc659ec4e460354ec8d06a4c05750d57584d38b210dbe013b38cc73c7bd98ba44e0f6f3468020240182178ffef6f140ccdff19d3ef09c99c5700c48e8e8c32
|
7
|
+
data.tar.gz: 705a2ab3eaa628ca1b10fca1ab3f6f3eb53fdbbc8067f5d7d4d6f469d2a503e775c572c4026c026b2570486198a0322dea55df25f70ed7a1935e6ee51549f33a
|
data/.gitignore
CHANGED
File without changes
|
data/CODE_OF_CONDUCT.md
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
data/Rakefile
CHANGED
File without changes
|
data/lib/compare_without.rb
CHANGED
@@ -48,6 +48,12 @@ module UselessString
|
|
48
48
|
end
|
49
49
|
|
50
50
|
alias_method :cmp_without_these, :cmp_without_this
|
51
|
+
|
52
|
+
def cmp_without_theses_words(other_str, array)
|
53
|
+
remove_these_words!(str = self.dup, other = other_str.dup, array.dup)
|
54
|
+
str <=> other
|
55
|
+
end
|
56
|
+
|
51
57
|
alias_method :cmp_without_regex, :cmp_without_this
|
52
58
|
end
|
53
59
|
end
|
data/lib/equal_without.rb
CHANGED
@@ -13,7 +13,7 @@ module UselessString
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def remove_spaces!(str, other_str)
|
16
|
-
remove_this_regex!(str, other_str, / /)
|
16
|
+
remove_this_regex!(str, other_str, / |\\t/)
|
17
17
|
end
|
18
18
|
|
19
19
|
def remove_numbers!(str, other_str)
|
@@ -36,5 +36,10 @@ module UselessString
|
|
36
36
|
str.gsub!(regex, '')
|
37
37
|
other_str.gsub!(regex, '')
|
38
38
|
end
|
39
|
+
|
40
|
+
def remove_these_words!(str, other_str, array)
|
41
|
+
array.map { |w| Regexp.escape(w) }
|
42
|
+
remove_this_regex!(str, other_str, Regexp.union(array))
|
43
|
+
end
|
39
44
|
end
|
40
45
|
end
|
data/lib/useless_string.rb
CHANGED
File without changes
|
data/lib/with_only_starter.rb
CHANGED
File without changes
|
data/lib/without_starter.rb
CHANGED
@@ -3,7 +3,6 @@ module UselessString
|
|
3
3
|
|
4
4
|
def eql_without?(other_str, options = {})
|
5
5
|
set_according_to_options(str = self.dup, other = other_str.dup, options)
|
6
|
-
p str, other, options
|
7
6
|
options[:case_insensitive] ? str.upcase.eql?(other.upcase) : str.eql?(other)
|
8
7
|
end
|
9
8
|
|
@@ -22,6 +21,7 @@ module UselessString
|
|
22
21
|
remove_numbers!(str, other_str) if options[:numbers]
|
23
22
|
remove_special_characters!(str, other_str) if options[:special_characters]
|
24
23
|
remove_alphabets!(str, other_str) if options[:alphabets]
|
24
|
+
remove_these_words!(str, other_str, options[:words]) if options[:words]
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/useless_string.gemspec
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: useless_string
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Azam
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|