drjprogramming_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/.DS_Store +0 -0
- data/.gitignore +8 -0
- data/Gemfile +12 -0
- data/Gemfile.lock +52 -0
- data/README.md +35 -0
- data/Rakefile +8 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/drjprogramming_palindrome.gemspec +38 -0
- data/lib/.DS_Store +0 -0
- data/lib/drjprogramming_palindrome/version.rb +5 -0
- data/lib/drjprogramming_palindrome.rb +23 -0
- data/sig/drjprogramming_palindrome.rbs +4 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 99cd45459e392c13d81b13b7907be90200304c9cc95b9bf7be078a726f1a69bc
|
4
|
+
data.tar.gz: 28605d72cf78e27a1455ae2116b82e8799d544192942791a817e622eb431a137
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5f7495f4c7c89ea0c3bd2fd5057453fee81d65c75113ce53f26b9da74094e47f4b920b31ed4e402d621a7753c513b56df48b6601d4885dd2c121a031154cd1a5
|
7
|
+
data.tar.gz: 3507515ba438e2bd6f9b8c139ef33b68b92d999f59e2eecf6451461c0b9d73620b9803d3b4a380947d6b88c64142f21736777d30a4dbfe6dec23b7de3140adc3
|
data/.DS_Store
ADDED
Binary file
|
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
git_source(:github) {|repo_name| "https://github.com/drjprogramming/drjprogramming_palindrome" }
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in drjprogramming_palindrome.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "irb"
|
9
|
+
gem "rake", "~> 13.0"
|
10
|
+
|
11
|
+
gem "minitest", "~> 5.16"
|
12
|
+
gem 'minitest-reporters', '1.7.1'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
drjprogramming_palindrome (0.1.0)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
ansi (1.5.0)
|
10
|
+
builder (3.3.0)
|
11
|
+
date (3.4.1)
|
12
|
+
erb (5.0.1)
|
13
|
+
io-console (0.8.0)
|
14
|
+
irb (1.15.2)
|
15
|
+
pp (>= 0.6.0)
|
16
|
+
rdoc (>= 4.0.0)
|
17
|
+
reline (>= 0.4.2)
|
18
|
+
minitest (5.25.5)
|
19
|
+
minitest-reporters (1.7.1)
|
20
|
+
ansi
|
21
|
+
builder
|
22
|
+
minitest (>= 5.0)
|
23
|
+
ruby-progressbar
|
24
|
+
pp (0.6.2)
|
25
|
+
prettyprint
|
26
|
+
prettyprint (0.2.0)
|
27
|
+
psych (5.2.6)
|
28
|
+
date
|
29
|
+
stringio
|
30
|
+
rake (13.2.1)
|
31
|
+
rdoc (6.14.0)
|
32
|
+
erb
|
33
|
+
psych (>= 4.0.0)
|
34
|
+
reline (0.6.1)
|
35
|
+
io-console (~> 0.5)
|
36
|
+
ruby-progressbar (1.13.0)
|
37
|
+
stringio (3.1.7)
|
38
|
+
|
39
|
+
PLATFORMS
|
40
|
+
arm64-darwin-22
|
41
|
+
ruby
|
42
|
+
|
43
|
+
DEPENDENCIES
|
44
|
+
bundler (> 1.16)
|
45
|
+
drjprogramming_palindrome!
|
46
|
+
irb
|
47
|
+
minitest (~> 5.16)
|
48
|
+
minitest-reporters (= 1.7.1)
|
49
|
+
rake (~> 13.0)
|
50
|
+
|
51
|
+
BUNDLED WITH
|
52
|
+
2.6.9
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# DrjprogrammingPalindrome
|
2
|
+
|
3
|
+
TODO: Delete this and the text below, and describe your gem
|
4
|
+
|
5
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/drjprogramming_palindrome`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
+
|
11
|
+
Install the gem and add to the application's Gemfile by executing:
|
12
|
+
|
13
|
+
```bash
|
14
|
+
bundle add UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
15
|
+
```
|
16
|
+
|
17
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
18
|
+
|
19
|
+
```bash
|
20
|
+
gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
|
21
|
+
```
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
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.
|
30
|
+
|
31
|
+
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).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/drjprogramming_palindrome.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "drjprogramming_palindrome"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
require "irb"
|
11
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "drjprogramming_palindrome/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "drjprogramming_palindrome"
|
7
|
+
spec.version = DrjprogrammingPalindrome::VERSION
|
8
|
+
spec.authors = ["Daniel Joiner"]
|
9
|
+
spec.email = ["danielrjoiner@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Palindrome detector}
|
12
|
+
spec.description = %q{Learn Enough Ruby palindrome detector}
|
13
|
+
spec.homepage = "https://github.com/drjprogramming/drjprogramming_palindrome"
|
14
|
+
spec.required_ruby_version = ">= 3.1.0"
|
15
|
+
|
16
|
+
if spec.respond_to?(:metadata)
|
17
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org/"
|
18
|
+
else
|
19
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
20
|
+
"public gem pushes."
|
21
|
+
end
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem
|
25
|
+
# that have been added into git.
|
26
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
27
|
+
`git ls-files -z`.split("\x0").reject do
|
28
|
+
|f| f.match(%r{^(test|spec|features)/})
|
29
|
+
end
|
30
|
+
end
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
|
+
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "> 1.16"
|
36
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
37
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
38
|
+
end
|
data/lib/.DS_Store
ADDED
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "drjprogramming_palindrome/version"
|
4
|
+
|
5
|
+
class String
|
6
|
+
|
7
|
+
# Returns true for a palindrome, false otherwise.
|
8
|
+
def palindrome?
|
9
|
+
processed_content == processed_content.reverse
|
10
|
+
end
|
11
|
+
|
12
|
+
# Returns the letters in the string.
|
13
|
+
def letters
|
14
|
+
self.chars.select { |c| c.match(/[a-z]/i) }.join
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
# Returns content for palindrome testing.
|
20
|
+
def processed_content
|
21
|
+
scan(/[a-z]/i).join.downcase
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: drjprogramming_palindrome
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Joiner
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-05-27 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: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
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: Learn Enough Ruby palindrome detector
|
56
|
+
email:
|
57
|
+
- danielrjoiner@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".DS_Store"
|
63
|
+
- ".gitignore"
|
64
|
+
- Gemfile
|
65
|
+
- Gemfile.lock
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/console
|
69
|
+
- bin/setup
|
70
|
+
- drjprogramming_palindrome.gemspec
|
71
|
+
- lib/.DS_Store
|
72
|
+
- lib/drjprogramming_palindrome.rb
|
73
|
+
- lib/drjprogramming_palindrome/version.rb
|
74
|
+
- sig/drjprogramming_palindrome.rbs
|
75
|
+
homepage: https://github.com/drjprogramming/drjprogramming_palindrome
|
76
|
+
licenses: []
|
77
|
+
metadata:
|
78
|
+
allowed_push_host: https://rubygems.org/
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 3.1.0
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '0'
|
93
|
+
requirements: []
|
94
|
+
rubygems_version: 3.4.19
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Palindrome detector
|
98
|
+
test_files: []
|