goatatwork_palindrome 0.1.0 → 0.1.1
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 +4 -4
- data/.gitignore +1 -0
- data/lib/goatatwork_palindrome.rb +10 -3
- data/lib/goatatwork_palindrome/version.rb +1 -1
- metadata +1 -2
- data/Gemfile.lock +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e297386ce38adb34bc95e0b5c892fe8a627e16fa76277524d7a93a49d2c21a2
|
4
|
+
data.tar.gz: c3bb57bd1eb2545f58d9a50fe6e6fdcb126c704c4bf51c15b7bf236d335efc4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2c098c013f090b42972e88ec6b60f0a063eae8eb2a3f10b88f67554c01fac8606d3ed28a59b65abec443af5ca294e95ed37e3a14a97e0901a85c39b6bb6496a
|
7
|
+
data.tar.gz: 3b6003e4c571a44b71f7b0c995f84fabfdf5bd750f9cda326013e4c05f5797d21aa42e3d59a425c98db374555c7b9cec8ba0310cd2aa31f4faeafb30f806d3f9
|
data/.gitignore
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require "goatatwork_palindrome/version"
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module GoatatworkPalindrome
|
5
4
|
# Returns true for a palindrome, false otherwise.
|
6
5
|
def palindrome?
|
7
6
|
processed_content == processed_content.reverse
|
@@ -16,6 +15,14 @@ class String
|
|
16
15
|
|
17
16
|
# Returns content for palindrome testing.
|
18
17
|
def processed_content
|
19
|
-
scan(/[a-
|
18
|
+
self.to_s.scan(/[a-z0-9]/i).join.downcase
|
20
19
|
end
|
21
20
|
end
|
21
|
+
|
22
|
+
class String
|
23
|
+
include GoatatworkPalindrome
|
24
|
+
end
|
25
|
+
|
26
|
+
class Integer
|
27
|
+
include GoatatworkPalindrome
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goatatwork_palindrome
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goat
|
@@ -63,7 +63,6 @@ files:
|
|
63
63
|
- ".travis.yml"
|
64
64
|
- CODE_OF_CONDUCT.md
|
65
65
|
- Gemfile
|
66
|
-
- Gemfile.lock
|
67
66
|
- LICENSE.txt
|
68
67
|
- README.md
|
69
68
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
goatatwork_palindrome (0.1.0)
|
5
|
-
|
6
|
-
GEM
|
7
|
-
remote: https://rubygems.org/
|
8
|
-
specs:
|
9
|
-
ansi (1.5.0)
|
10
|
-
builder (3.2.4)
|
11
|
-
minitest (5.14.2)
|
12
|
-
minitest-reporters (1.4.2)
|
13
|
-
ansi
|
14
|
-
builder
|
15
|
-
minitest (>= 5.0)
|
16
|
-
ruby-progressbar
|
17
|
-
rake (10.5.0)
|
18
|
-
ruby-progressbar (1.10.1)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
bundler (~> 1.17)
|
25
|
-
goatatwork_palindrome!
|
26
|
-
minitest (~> 5.0)
|
27
|
-
minitest-reporters
|
28
|
-
rake (~> 10.0)
|
29
|
-
|
30
|
-
BUNDLED WITH
|
31
|
-
1.17.2
|