ccromer_palindrome 0.1.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 +7 -0
- data/.rubocop.yml +13 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +52 -0
- data/README.md +53 -0
- data/Rakefile +16 -0
- data/ccromer_palindrome.gemspec +38 -0
- data/lib/ccromer_palindrome/version.rb +5 -0
- data/lib/ccromer_palindrome.rb +22 -0
- data/sig/ccromer_palindrome.rbs +4 -0
- metadata +55 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 815e7588cd230986d413b31e9b1441c5e0e25c79ef128bf116c0977f9a564f0d
|
4
|
+
data.tar.gz: 86c8ac7f9a3db3beb547df0c30ca63765791c4af3d0f8b912652d4e32e96a716
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ac55ec11db318b3722eada915a8702bce738beddd63ec17d1da3e7d0f8704a42ed1b2d4a2af0474a65f8ef02d89660f5288677353a27c0510dfef2f6eef75a0b
|
7
|
+
data.tar.gz: 2179d471566a5d1d6a21eb221d636e4954bd835ded62b5dd6d7340548e915bea63255daf6ad20320fbe34d9529c1ba1a0269f8b10fd8e99dd19a0ab408b7baef
|
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in ccromer_palindrome.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
|
10
|
+
gem "minitest", "~> 5.0"
|
11
|
+
|
12
|
+
gem "rubocop", "~> 1.21"
|
13
|
+
|
14
|
+
gem "minitest-reporters", "~> 1.2.0"
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ccromer_palindrome (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ansi (1.5.0)
|
10
|
+
ast (2.4.2)
|
11
|
+
builder (3.2.4)
|
12
|
+
json (2.6.3)
|
13
|
+
minitest (5.17.0)
|
14
|
+
minitest-reporters (1.2.0)
|
15
|
+
ansi
|
16
|
+
builder
|
17
|
+
minitest (>= 5.0)
|
18
|
+
ruby-progressbar
|
19
|
+
parallel (1.22.1)
|
20
|
+
parser (3.2.0.0)
|
21
|
+
ast (~> 2.4.1)
|
22
|
+
rainbow (3.1.1)
|
23
|
+
rake (13.0.6)
|
24
|
+
regexp_parser (2.6.1)
|
25
|
+
rexml (3.2.5)
|
26
|
+
rubocop (1.43.0)
|
27
|
+
json (~> 2.3)
|
28
|
+
parallel (~> 1.10)
|
29
|
+
parser (>= 3.2.0.0)
|
30
|
+
rainbow (>= 2.2.2, < 4.0)
|
31
|
+
regexp_parser (>= 1.8, < 3.0)
|
32
|
+
rexml (>= 3.2.5, < 4.0)
|
33
|
+
rubocop-ast (>= 1.24.1, < 2.0)
|
34
|
+
ruby-progressbar (~> 1.7)
|
35
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
36
|
+
rubocop-ast (1.24.1)
|
37
|
+
parser (>= 3.1.1.0)
|
38
|
+
ruby-progressbar (1.11.0)
|
39
|
+
unicode-display_width (2.4.2)
|
40
|
+
|
41
|
+
PLATFORMS
|
42
|
+
arm64-darwin-21
|
43
|
+
|
44
|
+
DEPENDENCIES
|
45
|
+
ccromer_palindrome!
|
46
|
+
minitest (~> 5.0)
|
47
|
+
minitest-reporters (~> 1.2.0)
|
48
|
+
rake (~> 13.0)
|
49
|
+
rubocop (~> 1.21)
|
50
|
+
|
51
|
+
BUNDLED WITH
|
52
|
+
2.3.26
|
data/README.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# Palindrome Detector
|
2
|
+
|
3
|
+
`ccromer_palindrome` is a sample Ruby gem created while following the [*Learn Enough Ruby to Be Dangerous*](https://www.learnenough.com/ruby-tutorial) by Michael Hartl.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
To install `ccromer_palindrome`, add this line directly to your application's `Gemfile`:
|
8
|
+
|
9
|
+
```
|
10
|
+
gem 'ccromer_palindrome'
|
11
|
+
```
|
12
|
+
|
13
|
+
Then install as follows:
|
14
|
+
|
15
|
+
```
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install the gem and add to the application's Gemfile in one step by executing:
|
20
|
+
|
21
|
+
```
|
22
|
+
$ bundle add ccromer_palindrome
|
23
|
+
```
|
24
|
+
|
25
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
26
|
+
|
27
|
+
```
|
28
|
+
$ gem install ccromer_palindrome
|
29
|
+
```
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
`ccromer_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
|
34
|
+
|
35
|
+
```
|
36
|
+
$ irb
|
37
|
+
>> require 'ccromer_palindrome'
|
38
|
+
>> "honey badger".palindrome?
|
39
|
+
=> false
|
40
|
+
>> "deified".palindrome?
|
41
|
+
=> true
|
42
|
+
>> "Able was I, ere I saw Elba.".palindrome?
|
43
|
+
=> true
|
44
|
+
>> phrase = "Madam, I'm Adam."
|
45
|
+
>> phrase.palindrome?
|
46
|
+
=> true
|
47
|
+
```
|
48
|
+
|
49
|
+
## Development
|
50
|
+
|
51
|
+
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.
|
52
|
+
|
53
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.libs << "test"
|
8
|
+
t.libs << "lib"
|
9
|
+
t.test_files = FileList["test/**/test_*.rb"]
|
10
|
+
end
|
11
|
+
|
12
|
+
require "rubocop/rake_task"
|
13
|
+
|
14
|
+
RuboCop::RakeTask.new
|
15
|
+
|
16
|
+
task default: %i[test rubocop]
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/ccromer_palindrome/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "ccromer_palindrome"
|
7
|
+
spec.version = CcromerPalindrome::VERSION
|
8
|
+
spec.authors = ["Caleb Cromer"]
|
9
|
+
spec.email = ["calebccromer@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Palindrome detector"
|
12
|
+
spec.description = "Learn Enough Ruby palindrome detector"
|
13
|
+
spec.homepage = "https://github.com/phantomofdevopsera/ccromer_palindrome"
|
14
|
+
spec.required_ruby_version = ">= 2.6.0"
|
15
|
+
|
16
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
17
|
+
|
18
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
19
|
+
spec.metadata["source_code_uri"] = "https://github.com/phantomofdevopsera/ccromer_palindrome.git"
|
20
|
+
spec.metadata["changelog_uri"] = "https://github.com/phantomofdevopsera/ccromer_palindrome.git"
|
21
|
+
|
22
|
+
# Specify which files should be added to the gem when it is released.
|
23
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
24
|
+
spec.files = Dir.chdir(__dir__) do
|
25
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
26
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
27
|
+
end
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
# Uncomment to register a new dependency of your gem
|
34
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
35
|
+
|
36
|
+
# For more information and examples about making a new gem, check out our
|
37
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
38
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "ccromer_palindrome/version"
|
4
|
+
|
5
|
+
# module CcromerPalindrome
|
6
|
+
# class Error < StandardError; end
|
7
|
+
# # Your code goes here...
|
8
|
+
# end
|
9
|
+
|
10
|
+
class String
|
11
|
+
|
12
|
+
def palindrome?
|
13
|
+
processed_content == processed_content.reverse
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def processed_content
|
19
|
+
self.scan(/[a-z]/i).join.downcase
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ccromer_palindrome
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Caleb Cromer
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-01-11 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Learn Enough Ruby palindrome detector
|
14
|
+
email:
|
15
|
+
- calebccromer@gmail.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".rubocop.yml"
|
21
|
+
- Gemfile
|
22
|
+
- Gemfile.lock
|
23
|
+
- README.md
|
24
|
+
- Rakefile
|
25
|
+
- ccromer_palindrome.gemspec
|
26
|
+
- lib/ccromer_palindrome.rb
|
27
|
+
- lib/ccromer_palindrome/version.rb
|
28
|
+
- sig/ccromer_palindrome.rbs
|
29
|
+
homepage: https://github.com/phantomofdevopsera/ccromer_palindrome
|
30
|
+
licenses: []
|
31
|
+
metadata:
|
32
|
+
allowed_push_host: https://rubygems.org
|
33
|
+
homepage_uri: https://github.com/phantomofdevopsera/ccromer_palindrome
|
34
|
+
source_code_uri: https://github.com/phantomofdevopsera/ccromer_palindrome.git
|
35
|
+
changelog_uri: https://github.com/phantomofdevopsera/ccromer_palindrome.git
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: 2.6.0
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
requirements: []
|
51
|
+
rubygems_version: 3.3.7
|
52
|
+
signing_key:
|
53
|
+
specification_version: 4
|
54
|
+
summary: Palindrome detector
|
55
|
+
test_files: []
|