johntheyoung_palindrome 0.1.0 → 0.1.4

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
  SHA256:
3
- metadata.gz: 74f7c95b0b6a57d216e7f3248539849ca97b8907402a301794bac04482e711ba
4
- data.tar.gz: 1a3803b8d940b2dc54eaf896083794de047217cab9c49aff1f50d99ec5d1e3c4
3
+ metadata.gz: 2252d65d65c3053188e6e84b24402bec510461219cd36368686bf9e72b81d603
4
+ data.tar.gz: a01e978e1ea638c02e6d157ce38a144538dbd4992f5b673d3c4c307f91c24a70
5
5
  SHA512:
6
- metadata.gz: bf5a6f22988ee60e82d340df98e104dacf7c43adc9cde26858868320d4e37614813437e3277f42800c25456a46845968c3bae2220a218f9bb4ad9415db81d6fc
7
- data.tar.gz: 41ee5a354f868019bbb6fdab848ef98c2dddeaf0ddfa6331287185b4cbcbbdb3998884497ec0cc657b268a368e8bfe757827a5f69230e490208fd75ba9fe6027
6
+ metadata.gz: 5b988aad9f3f824ef262a9540df2e726aebf529653b750eb3f79c6ddb4cc127e4d1367eb508c9743bda596ebc55b9a71541da4addff200a2e69a36553cb63904
7
+ data.tar.gz: 4c3b3d74078907c0f755649e56830fee25b03e4d43feb7ced701855bdfcac571d36b74c2d1a8f07053ee5d42a1f147d3b02611b1afe403a1d15d13dcd5df271f
data/.DS_Store ADDED
Binary file
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- johntheyoung_palindrome (0.1.0)
4
+ johntheyoung_palindrome (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/lib/.DS_Store ADDED
Binary file
@@ -1,3 +1,3 @@
1
1
  module JohntheyoungPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -1,16 +1,30 @@
1
1
  require "johntheyoung_palindrome/version"
2
2
 
3
- class String
3
+
4
+ module Palindrome
4
5
 
5
6
  # Returns true for a palindrome, false otherwise.
6
7
  def palindrome?
7
- processed_content == processed_content.reverse
8
+ if processed_content.empty?
9
+ false
10
+ else
11
+ processed_content == processed_content.reverse
12
+ end
8
13
  end
9
14
 
15
+
10
16
  private
11
17
 
12
18
  # Returns content for palindrome testing.
13
19
  def processed_content
14
- scan(/[a-z]/i).join.downcase
20
+ self.to_s.scan(/[a-zA-Z]|\d/i).join.downcase
15
21
  end
16
22
  end
23
+
24
+ class String
25
+ include Palindrome
26
+ end
27
+
28
+ class Integer
29
+ include Palindrome
30
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: johntheyoung_palindrome
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Young
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-17 00:00:00.000000000 Z
11
+ date: 2021-11-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Learn Enough Ruby palindrome detector
14
14
  email:
@@ -17,6 +17,7 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - ".DS_Store"
20
21
  - ".gitignore"
21
22
  - ".travis.yml"
22
23
  - Gemfile
@@ -26,6 +27,7 @@ files:
26
27
  - bin/console
27
28
  - bin/setup
28
29
  - johntheyoung_palindrome.gemspec
30
+ - lib/.DS_Store
29
31
  - lib/johntheyoung_palindrome.rb
30
32
  - lib/johntheyoung_palindrome/version.rb
31
33
  homepage: https://github.com/johntheyoung/palindrome