Yassoabi_palindrome 0.1.0 → 0.2.0

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: 1333134ef3fe3f22c0e9bea4416ff0f8d4906762
4
- data.tar.gz: 69169e24c81cb702313e249597250e456c008641
3
+ metadata.gz: 9d2d9b070b8d52833379eeda8f293a560a9409ad
4
+ data.tar.gz: 9335bb4c589c1e54343fb8623e5bfc3e7a999863
5
5
  SHA512:
6
- metadata.gz: 5ab0f07414331c7796a30e190a06637ca9098ed4d051247d88248f0eb25e71f7752c0145787cbe88c01638573e196991d4cdc01889f6fb8c204dfa4eb06d0a80
7
- data.tar.gz: 435256db1150e46d2f4e28b618cbc818c7687364adf8c06623f86369dbfe7895e6c73c836b3d8905c09e94e873f2266c71cb6548230be5384633c888f018181e
6
+ metadata.gz: 2bca9f4a236c774c5adfde280835ae5589141e5f69d3a1ac21e4d59fd23a0218be254420060453c530c64df2b3c2de79c3a5cfc5157ada31de3d9ffef85e6e9c
7
+ data.tar.gz: a65a0c3208d07a26be9a3943409c3943fcd5b4d4a05e636d45b4130828ae9ef9b02ef3992204fa8eb3a4bcd884b4075f0e5b66dcadf1011221915b3c6aa4bfc1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- Yassoabi_palindrome (0.1.0)
4
+ Yassoabi_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,17 +1,27 @@
1
1
  require "Yassoabi_palindrome/version"
2
2
 
3
3
 
4
- class String
4
+ module YassoabiPalindrome
5
5
 
6
6
  # Returns true for a palindrome, false otherwise.
7
7
  def palindrome?
8
+ if processed_content.empty?
9
+ false
10
+ else
8
11
  processed_content == processed_content.reverse
9
12
  end
10
-
13
+ end
11
14
  private
12
15
  # Returns content for palindrome testing.
13
16
  def processed_content
14
- self.scan(/[a-z]/i).join.downcase
17
+ self.to_s.scan(/[a-z0-9]/i).join.downcase
15
18
 
16
19
  end
17
20
  end
21
+
22
+ class String
23
+ include YassoabiPalindrome
24
+ end
25
+ class Integer
26
+ include YassoabiPalindrome
27
+ end
@@ -1,3 +1,3 @@
1
1
  module YassoabiPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Yassoabi_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yasin Erol