string_search 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/string_search.rb +6 -6
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf7879ff86ce3d7ef2e8239d34def83e38f2ce9b
|
4
|
+
data.tar.gz: 96048c7ec06c30e92bff5b4e69363b85921399b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbc6fe09089888cd6e6426f73c51cd7fc59d8e3fdafda3a104f9fe20753d64ecff884418971a3b33c7920dd5356b87bb0a897f549bd569c037cc04bb83d732fb
|
7
|
+
data.tar.gz: 65d7633071942f70980727fd0f7733d6d3ad79ff9efded9239c6046e87c0c253a1bc1b9869e7fbc4a2d593a9754b84dfb3808575af9b864adff91c23fa2552ff
|
data/lib/string_search.rb
CHANGED
@@ -13,19 +13,19 @@ def search_me(string, substring)
|
|
13
13
|
if string[index, len] == substring
|
14
14
|
i += 1
|
15
15
|
if i == 1
|
16
|
-
sing_or_plural = "match"
|
16
|
+
@sing_or_plural = "match"
|
17
17
|
elsif i > 1
|
18
|
-
sing_or_plural = "matches"
|
19
|
-
end
|
20
|
-
print "found #{i} #{sing_or_plural}: #{substring.upcase}"
|
21
|
-
true
|
18
|
+
@sing_or_plural = "matches"
|
22
19
|
end
|
23
20
|
end
|
21
|
+
end
|
24
22
|
if i == 0
|
25
23
|
print "no match"
|
26
24
|
false
|
27
25
|
end
|
28
|
-
|
26
|
+
end
|
27
|
+
unless string.include?(substring) == false
|
28
|
+
print "found #{i} #{@sing_or_plural}: #{substring.upcase}"
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
metadata
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: string_search
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fookh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: simple search function for user supplied strings
|
13
|
+
description: simple search function for user supplied strings. more concise search
|
14
|
+
result printout introduced
|
14
15
|
email: foo@yetispeak.com
|
15
16
|
executables: []
|
16
17
|
extensions: []
|