palindrome_catcher 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +13 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +55 -0
- data/README.md +45 -0
- data/Rakefile +16 -0
- data/agustin_palindrome.gemspec +40 -0
- data/lib/agustin_palindrome/version.rb +5 -0
- data/lib/agustin_palindrome.rb +19 -0
- data/sig/agustin_palindrome.rbs +4 -0
- metadata +96 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c2d7c9a3c7130793b092a2484e625eeebbd31266a005684f8c7857d6582ff7b1
|
4
|
+
data.tar.gz: '07687eecd440988d0cdc95549639e2b6277b8788ba39011753530fa454564456'
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6e16141df7eb94e5da7eeaab954c830d18bc54836bf7cbcc96c789b3edccd0135cf3191104cae67f1e13d38478afb9d92345922006a58e2bdb02cd452ac195f9
|
7
|
+
data.tar.gz: 9317b2d7f2750c6fd7c80bacec0946e8d9536d975ba826e6fe2432ed1c81b827366497c5cebd1c3e1f023e028db211da6730d49cf7510b5a1f6a6d99968f19a5
|
data/.rubocop.yml
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in agustin_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"
|
15
|
+
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
palindrome_catcher (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.18.0)
|
14
|
+
minitest-reporters (1.2.0)
|
15
|
+
ansi
|
16
|
+
builder
|
17
|
+
minitest (>= 5.0)
|
18
|
+
ruby-progressbar
|
19
|
+
parallel (1.23.0)
|
20
|
+
parser (3.2.2.3)
|
21
|
+
ast (~> 2.4.1)
|
22
|
+
racc
|
23
|
+
racc (1.7.0)
|
24
|
+
rainbow (3.1.1)
|
25
|
+
rake (13.0.6)
|
26
|
+
regexp_parser (2.8.1)
|
27
|
+
rexml (3.2.5)
|
28
|
+
rubocop (1.52.1)
|
29
|
+
json (~> 2.3)
|
30
|
+
parallel (~> 1.10)
|
31
|
+
parser (>= 3.2.2.3)
|
32
|
+
rainbow (>= 2.2.2, < 4.0)
|
33
|
+
regexp_parser (>= 1.8, < 3.0)
|
34
|
+
rexml (>= 3.2.5, < 4.0)
|
35
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
36
|
+
ruby-progressbar (~> 1.7)
|
37
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
38
|
+
rubocop-ast (1.29.0)
|
39
|
+
parser (>= 3.2.1.0)
|
40
|
+
ruby-progressbar (1.13.0)
|
41
|
+
unicode-display_width (2.4.2)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
x86_64-linux
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
bundler (~> 2.3.7)
|
48
|
+
minitest (~> 5.0)
|
49
|
+
minitest-reporters (= 1.2.0)
|
50
|
+
palindrome_catcher!
|
51
|
+
rake (~> 13.0)
|
52
|
+
rubocop (~> 1.21)
|
53
|
+
|
54
|
+
BUNDLED WITH
|
55
|
+
2.3.7
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# Palindrome detector
|
2
|
+
|
3
|
+
`agustin_palindrome` is a sample Ruby gem created in [*Ruby Palindrome Detector*](https://github.com/AgustinPalmaM/ruby_gem) by Agustin Palma - software development student as part of the ruby course from Michael Hartl - Learn enough ruby to be dangerous.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
To install `agustin_palindrome`, add this line to your application's `Gemfile`:
|
8
|
+
|
9
|
+
```
|
10
|
+
gem 'agustin_palindrome'
|
11
|
+
```
|
12
|
+
|
13
|
+
Then install as follows:
|
14
|
+
|
15
|
+
```
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it directly using `gem`:
|
20
|
+
|
21
|
+
```
|
22
|
+
$ gem install agustin_palindrome
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
`agustin_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
|
28
|
+
|
29
|
+
```
|
30
|
+
$ irb
|
31
|
+
>> require 'agustin_palindrome'
|
32
|
+
>> "honey badger".palindrome?
|
33
|
+
=> false
|
34
|
+
>> "deified".palindrome?
|
35
|
+
=> true
|
36
|
+
>> "Able was I, ere I saw Elba.".palindrome?
|
37
|
+
=> true
|
38
|
+
>> phrase = "Madam, I'm Adam."
|
39
|
+
>> phrase.palindrome?
|
40
|
+
=> true
|
41
|
+
```
|
42
|
+
|
43
|
+
## License
|
44
|
+
|
45
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
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,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/agustin_palindrome/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "palindrome_catcher"
|
7
|
+
spec.version = AgustinPalindrome::VERSION
|
8
|
+
spec.authors = ["AgustinPalmaM"]
|
9
|
+
spec.email = ["palma.agustin7@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "Palindrome detector."
|
12
|
+
spec.description = "This is a palindrome detector maded to learn how to create a ruby gem."
|
13
|
+
spec.homepage = "https://github.com/AgustinPalmaM/ruby_gem"
|
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/AgustinPalmaM/ruby_gem"
|
20
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
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(File.expand_path(__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_development_dependency "bundler", "~> 2.3.7"
|
35
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
36
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
37
|
+
|
38
|
+
# For more information and examples about making a new gem, check out our
|
39
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
40
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "agustin_palindrome/version"
|
4
|
+
|
5
|
+
class String
|
6
|
+
def palindrome?
|
7
|
+
processed_content == processed_content.reverse
|
8
|
+
end
|
9
|
+
|
10
|
+
def letters
|
11
|
+
scan(/[a-z]/i).join
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def processed_content
|
17
|
+
letters.downcase
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: palindrome_catcher
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- AgustinPalmaM
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-06-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.3.7
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.3.7
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
description: This is a palindrome detector maded to learn how to create a ruby gem.
|
56
|
+
email:
|
57
|
+
- palma.agustin7@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".rubocop.yml"
|
63
|
+
- Gemfile
|
64
|
+
- Gemfile.lock
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- agustin_palindrome.gemspec
|
68
|
+
- lib/agustin_palindrome.rb
|
69
|
+
- lib/agustin_palindrome/version.rb
|
70
|
+
- sig/agustin_palindrome.rbs
|
71
|
+
homepage: https://github.com/AgustinPalmaM/ruby_gem
|
72
|
+
licenses: []
|
73
|
+
metadata:
|
74
|
+
allowed_push_host: https://rubygems.org/
|
75
|
+
homepage_uri: https://github.com/AgustinPalmaM/ruby_gem
|
76
|
+
source_code_uri: https://github.com/AgustinPalmaM/ruby_gem
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 2.6.0
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubygems_version: 3.3.7
|
93
|
+
signing_key:
|
94
|
+
specification_version: 4
|
95
|
+
summary: Palindrome detector.
|
96
|
+
test_files: []
|