aga_palindrome 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cc69650fcfa6268413dce969b524ef651f43bd31de3d0576eaa55573857d79f
4
- data.tar.gz: 14cf388afde9827df6ba7a0f84bccabab86685577cc1b81ef96d7f68d4b442d0
3
+ metadata.gz: 3e12948f9c2cbdbc65e588fefa0ce7481c1cfd61a0579dc1e603640043bbd1b2
4
+ data.tar.gz: 4c9e743d73f0067b09f65dde2c5abca46770f20de2d29d0624bb1a00ae709295
5
5
  SHA512:
6
- metadata.gz: 39f1ad852b9a11b4dba0e76e5d167b370ed464bf7755d1b2203a045588141be8cdfeba1ba4c8bf95aca51b9eaa3a7fb8ab313f5ba86e3f9f4a18b28a9708183b
7
- data.tar.gz: e1fb699d4af964e60d57ae4315a39362153da94d0f416d77ad1dd38c3b04f8ffddd0a3fa5a7dd786e565c9c1d2bb2b4187faec78ffd8967a855ad787a31c29bf
6
+ metadata.gz: 1d7a7767ae1e5d3dcd56f036f8618a333786cefe32f0a3a800c223fe65f4ff68fcdd2209dfd917bf1b5d9d244463f8a836a3a7405087cecbc4b8dcbd0315b3e0
7
+ data.tar.gz: f0ef13266ab8bdd380ab12ba5abad36b6ff52f6fa912266dab58e51559c567476901c74e576c11e9a2ab6eea89b954d40dc0a965a3a45fe867f579c372375334
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aga_palindrome (0.1.0)
4
+ aga_palindrome (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,16 +1,28 @@
1
1
  require "aga_palindrome/version"
2
2
 
3
- class String
3
+ module AgaPalindrome
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
 
10
14
  private
11
15
 
12
16
  # Returns content for palindrome testing.
13
17
  def processed_content
14
- scan(/[a-z]/i).join.downcase
18
+ to_s.scan(/[][a-z]\d]/i).join.downcase
15
19
  end
16
20
  end
21
+
22
+ class String
23
+ include AgaPalindrome
24
+ end
25
+
26
+ class Integer
27
+ include AgaPalindrome
28
+ end
@@ -1,3 +1,3 @@
1
1
  module AgaPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aga_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aga