HumbleCarrot_palindrome 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 757a85cc1ea842a5e1e378a9fd018c202d73e0c0
4
- data.tar.gz: 2e03a91ebc258d5e5b1b8602d0cd6b83796b0207
3
+ metadata.gz: 1cef32630b8f610da1144cf4ba4e9638cb52c76e
4
+ data.tar.gz: 6a63f3bda1fc3b990436cc4364640fde86da3d15
5
5
  SHA512:
6
- metadata.gz: 6706028faa6e69d6b2058cf83efc249476859be069f98e56eee7427fa94b2fd1d5c122799c33434f698acee518d766effb6d451b73511aa2ba76097ab95e04be
7
- data.tar.gz: 38ca04925416ece33ef59d12ee51b29bc53565aa0de60d5d05ec55c2b507651be5c8f2e6e2fafeb81c638b7fea94b85206cfa650283dd62051b8ba10924d0c4e
6
+ metadata.gz: 2228e8212bf96228ece261c75ee352f798b2ebc99cef168d9c70846434ee5be93b8605990a9ce21f951c38e4a4285cb577396110ec49ee74d397764aa5be5c97
7
+ data.tar.gz: 544e015caf23ad9c9ca0fc8b10d96811eb91b012f56c9afc99473ca37959caea5e04055ede38850f457ba537214641fc3e0132b46f950e011544f61745050b9a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- HumbleCarrot_palindrome (0.1.0)
4
+ HumbleCarrot_palindrome (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,15 +1,28 @@
1
1
  require "HumbleCarrot_palindrome/version"
2
2
 
3
- class String
3
+ module HumbleCarrotPalindrome
4
4
 
5
5
  # Returns true for a palindrome, false otherwise.
6
6
  def palindrome?
7
- processed_content == processed_content.reverse
7
+ if processed_content.empty?
8
+ false
9
+ else
10
+ processed_content == processed_content.reverse
11
+ end
8
12
  end
9
13
 
14
+ private
10
15
 
11
- # Returns content for palindrome testing.
12
- private def processed_content
13
- self.scan(/[a-z]/i).join.downcase
14
- end
16
+ # Returns content for palindrome testing.
17
+ def processed_content
18
+ self.to_s.scan(/[a-z|0-9]/i).join.downcase
19
+ end
20
+ end
21
+
22
+ class String
23
+ include HumbleCarrotPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include HumbleCarrotPalindrome
15
28
  end
@@ -1,3 +1,3 @@
1
1
  module HumbleCarrotPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HumbleCarrot_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aashir Khan
@@ -70,6 +70,7 @@ files:
70
70
  - bin/setup
71
71
  - lib/HumbleCarrot_palindrome.rb
72
72
  - lib/HumbleCarrot_palindrome/version.rb
73
+ - lib/pkg/HumbleCarrot_palindrome-0.1.0.gem
73
74
  homepage: https://github.com/aashir-khan/LearnEnoughRuby_Chapter8
74
75
  licenses: []
75
76
  metadata: