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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/string_search.rb +6 -6
  3. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b6e0a46cc3ecf9d63f3889fe6dc370c5b5074e5
4
- data.tar.gz: 3d6b8ce739d13aa0133a0c50e59668b8a1c06b99
3
+ metadata.gz: cf7879ff86ce3d7ef2e8239d34def83e38f2ce9b
4
+ data.tar.gz: 96048c7ec06c30e92bff5b4e69363b85921399b7
5
5
  SHA512:
6
- metadata.gz: 540feeac49d67ee9493464cd41b59048ef7718ea3062c7381b94ad4adac89e5c63abb81cb10a1cc6eaada58adce9a2fd771b359b7e21bb5a8e58c33d45608a51
7
- data.tar.gz: e0e87b23d066c151517544ebf7ef1648c90aec76e9a42dd22c8b5584edaea5efb246bc47ad4974c44f3dde60cac848d69f52234fa2d07f1163acbd5001118831
6
+ metadata.gz: dbc6fe09089888cd6e6426f73c51cd7fc59d8e3fdafda3a104f9fe20753d64ecff884418971a3b33c7920dd5356b87bb0a897f549bd569c037cc04bb83d732fb
7
+ data.tar.gz: 65d7633071942f70980727fd0f7733d6d3ad79ff9efded9239c6046e87c0c253a1bc1b9869e7fbc4a2d593a9754b84dfb3808575af9b864adff91c23fa2552ff
@@ -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.1
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-16 00:00:00.000000000 Z
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: []