mikef_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: faea461cf4139a9270158deb098c892c27e1538933ec74f3401155048ea4e61b
4
- data.tar.gz: 127f528dd4e3f886d41ca66c21957fd0bd96b0f1c16f84e9618af32405b2aac1
3
+ metadata.gz: 9c5585d0640302a756db4341a9d808ed2461efd7dfa2f5e4446dd078b568301b
4
+ data.tar.gz: df8283a6354fa01cd364658f1e5bb3f5119243c2bb8e0944c0a3be78b5b0dbc8
5
5
  SHA512:
6
- metadata.gz: 56f664205ae99c9eccc6725badb6e11cc679a477ed5ff1dd0bb293430803d1eae84df3f041b52c578f2a2815cfb3a2fe60d3836437c1757ad170f273d32d05bc
7
- data.tar.gz: e8cb907d2cfcc08bcba4a9412381ba42181964b6acf6163d58fe74af77fe7a057ed4862aa830423dffac7036a26d373b174324c3666abbf0adf1bff292374677
6
+ metadata.gz: 853d126a0fe795b53d99d68aea964d4ace311c7f76f8287a811494b8701d600540ac77ff3e4b92bd6321258073cd2e75fd984192ccb8a5d3d45d8a479013cf51
7
+ data.tar.gz: 5b32fc2ea1d00f572abd724a9aac05c62f1ac2de07a4963f03306bc257356afefee25b8d137130af459158f767d63a61f4b21aaccc52055e6d5142f069c19341
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mikef_palindrome (0.1.0)
4
+ mikef_palindrome (0.2.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MikefPalindrome
2
2
 
3
- Checks whether a `String` is a palindrome or not.
3
+ Checks whether a `String` or `Integer` is a palindrome or not.
4
4
  Returns a boolean.
5
5
 
6
6
  ## Installation
@@ -29,14 +29,12 @@ Or install it yourself as:
29
29
  "This isn't a palindrome".palindrome?
30
30
  >> false
31
31
 
32
- p = "Madam, I'm Adam"
33
- p.palindrome?
34
- >> true
35
-
36
- np = "This isn't a palindrome"
37
- np.palindrome?
32
+ 12345.palindrome?
38
33
  >> false
39
34
 
35
+ 12321.palindrome?
36
+ >> true
37
+
40
38
  ## Development
41
39
 
42
40
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,3 +1,3 @@
1
1
  module MikefPalindrome
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'.freeze
3
3
  end
@@ -1,6 +1,6 @@
1
1
  require 'mikef_palindrome/version'
2
2
 
3
- class String
3
+ module MikefPalindrome
4
4
  # returns true for a palindrome, false otherwise
5
5
  def palindrome?
6
6
  processed_content == processed_content.reverse
@@ -10,6 +10,14 @@ class String
10
10
 
11
11
  # returns content for palindrome testing
12
12
  def processed_content
13
- scan(/[a-z]/i).join.downcase
13
+ to_s.scan(/[a-z\d]/i).join.downcase
14
14
  end
15
15
  end
16
+
17
+ class String
18
+ include MikefPalindrome
19
+ end
20
+
21
+ class Integer
22
+ include MikefPalindrome
23
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mikef_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
  - Michael Farwell