psmith_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
  SHA256:
3
- metadata.gz: c5bd71b4aab5a6ce0bcdf770df4f89c237c84d679c88318527a0d4cee6ceb576
4
- data.tar.gz: 2965c446ce69ae381e4aeec468a3cc27da4b5b90552d816b75964637eed6f5b8
3
+ metadata.gz: f42a204257ed633d0d025f8dea499d09e7cb69b22e94483c63f69dfdd3719d9a
4
+ data.tar.gz: f2d468c7e6369f8fb854046b0a06d9079d992100e10f0cbb9c3d9c22924dc556
5
5
  SHA512:
6
- metadata.gz: 2466d640fa9f930788b96daa3a996d3a6adff0872f3b233b376d884952b31a98b733aa61f2cd6eecc4e46efb43ac8ba0630bd1a2aab44037589884fd3689fbd8
7
- data.tar.gz: b8388cfe43929f51ba4cb717d422165f739fae7dd9b7ae20b2b800a9e11c575054722dce0aa4f2b6604dae41cdb7bb603124fae1cc7d1d2c8cda8672e8606dba
6
+ metadata.gz: ae4a245025da8b4fef3eb4e2d4f53677d9267b67f48f3dfa8fe003b9e52fcd594a7c2d2522851471fe9de374cf18c62533a0d51a7878281ae7f247e3c8a2148a
7
+ data.tar.gz: b205480a23ee57004b9a654385aa8f3bc09c003378d2745dde50eca744462af78600f4721aa1f7e7e030bfaa3d2b24d6f744fe6bf8934fdfa238fe04f40b46d0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- psmith_palindrome (0.1.0)
4
+ psmith_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PsmithPalindrome
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -2,22 +2,24 @@
2
2
 
3
3
  require_relative "psmith_palindrome/version"
4
4
 
5
- class String
5
+ module PsmithPalindrome
6
6
 
7
7
  # Returns true for a palindrome, false otherwise.
8
8
  def palindrome?()
9
9
  processed_content == processed_content.reverse
10
10
  end
11
11
 
12
- # Returns the letters in the string.
13
- def letters
14
- chars.select { |char| char.match(/[a-z]/i) }.join
15
- end
16
-
17
12
  private
18
13
 
19
14
  # Returns content for palindrome testing
20
15
  def processed_content
21
- scan(/[a-z]/i).join.downcase
16
+ to_s.scan(/[a-z]*\d*/i).join.downcase
22
17
  end
23
18
  end
19
+ class String
20
+ include PsmithPalindrome
21
+ end
22
+
23
+ class Integer
24
+ include PsmithPalindrome
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psmith_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
  - Pete Smith