rob_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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: f0aba0175241694fc6c7943fc6d7f877c6b855342a7c38209424d860a0c61429
4
+ data.tar.gz: 661fe2dc1a018198054003aed61690806339e8086667b3c4f9e686adc64cf1ba
5
+ SHA512:
6
+ metadata.gz: befda22ccdd116a80dade1cd31027513a75041bb1d80ef4591d48effc3c87b02f5a237b0dc9b5a2d61c5a2525c7ac85a83556ddf31c7d9b4d4b391dd91c0f1c6
7
+ data.tar.gz: 4d3126820a57acb5a105a23c925805cefe6c850fad5817fbb9b7eedf63a748c4430870da5550b63333b798ba57ae34a5e8dd26f273fd5dffc079bfdc68ee57c9
data/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ @changelog
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # Specify your gem's dependencies in rob_palindrome.gemspec
8
+ gemspec
9
+
10
+ gem "rake", "~> 13.0"
11
+
12
+ gem "minitest", "~> 5.0"
13
+ gem 'minitest-reporters', '1.2.0'
14
+
data/Gemfile.lock ADDED
@@ -0,0 +1,31 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rob_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.15.0)
12
+ minitest-reporters (1.2.0)
13
+ ansi
14
+ builder
15
+ minitest (>= 5.0)
16
+ ruby-progressbar
17
+ rake (13.0.6)
18
+ ruby-progressbar (1.11.0)
19
+
20
+ PLATFORMS
21
+ x86_64-darwin-20
22
+
23
+ DEPENDENCIES
24
+ bundler (~> 2.3)
25
+ minitest (~> 5.0)
26
+ minitest-reporters (= 1.2.0)
27
+ rake (~> 13.0)
28
+ rob_palindrome!
29
+
30
+ BUNDLED WITH
31
+ 2.3.9
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Rob Hill
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # RobPalindrome
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library
4
+ into a gem. Put your Ruby code in the file `lib/rob_palindrome`. To experiment with that code, run `bin/console` for an
5
+ interactive prompt.
6
+
7
+ `rob_palindrome` is a sample Ruby gem created in [*Learn Enough Ruby to Be
8
+ Dangerous*](https://www.learnenough.com/ruby-tutorial) by Michael Hartl.
9
+
10
+ ## Installation
11
+
12
+ Install the gem and add to the application's Gemfile by executing:
13
+
14
+ $ bundle add rob_palindrome
15
+
16
+ If bundler is not being used to manage dependencies, install the gem by executing:
17
+
18
+ $ gem install rob_palindrome
19
+
20
+ ## Usage
21
+
22
+ `rob_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
23
+
24
+ ```
25
+ $ irb
26
+ >> require 'rob_palindrome'
27
+ >> "honey badger".palindrome?
28
+ => false
29
+ >> "deified".palindrome?
30
+ => true
31
+ >> "Able was I, ere I saw Elba.".palindrome?
32
+ => true
33
+ >> phrase = "Madam, I'm Adam."
34
+ >> phrase.palindrome?
35
+ => true
36
+ ```
37
+
38
+ ## Development
39
+
40
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can
41
+ also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+
43
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the
44
+ version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version,
45
+ push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
46
+
47
+ ## Contributing
48
+
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rob_palindrome.
50
+
51
+ ## Licence
52
+
53
+ 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,12 @@
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
+ task default: :test
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RobPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "rob_palindrome/version"
4
+
5
+ module RobPalindrome
6
+ class Error < StandardError; end
7
+
8
+ # Your code goes here...
9
+ end
10
+
11
+ class String
12
+ # Returns true for a palindrom, false otherwise
13
+ def palindrome?
14
+ processed_content == processed_content.reverse
15
+ end
16
+
17
+ private
18
+
19
+ # Returns content for palindrome testing
20
+ def processed_content
21
+ # self.scan(/[a-zA-Z]/).join.downcase
22
+ # eliminate "self" as Ruby applies it to the Sting
23
+ scan(/[a-zA-Z]/).join.downcase
24
+ end
25
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/rob_palindrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "rob_palindrome"
7
+ spec.version = RobPalindrome::VERSION
8
+ spec.authors = ["Rob Hill"]
9
+ spec.email = ["rob@zotech.com"]
10
+
11
+ spec.summary = %q{Palindrome detector}
12
+ spec.description = %q{Learn Enough Ruby palindrome detector}
13
+ spec.homepage = "https://github.com/IndigoHomme/palindrome"
14
+ spec.required_ruby_version = ">= 2.6.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
+ spec.metadata["homepage_uri"] = spec.homepage
24
+ spec.metadata["source_code_uri"] = spec.homepage
25
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/CHANGELOG.md"
26
+
27
+ # Specify which files should be added to the gem when it is released.
28
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
30
+ `git ls-files -z`.split("\x0").reject do |f|
31
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
32
+ end
33
+ end
34
+ spec.bindir = "exe"
35
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
36
+ spec.require_paths = ["lib"]
37
+
38
+ spec.add_development_dependency "bundler", "~> 2.3"
39
+ spec.add_development_dependency "rake", "~> 10.0"
40
+ spec.add_development_dependency "minitest", "~> 5.0"
41
+
42
+ # Uncomment to register a new dependency of your gem
43
+ # spec.add_dependency "example-gem", "~> 1.0"
44
+
45
+ # For more information and examples about making a new gem, check out our
46
+ # guide at: https://bundler.io/guides/creating_gem.html
47
+ end
@@ -0,0 +1,4 @@
1
+ module RobPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rob_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Rob Hill
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-03-29 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'
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'
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
+ - rob@zotech.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - CHANGELOG.md
63
+ - Gemfile
64
+ - Gemfile.lock
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - lib/rob_palindrome.rb
69
+ - lib/rob_palindrome/version.rb
70
+ - rob_palindrome.gemspec
71
+ - sig/rob_palindrome.rbs
72
+ homepage: https://github.com/IndigoHomme/palindrome
73
+ licenses: []
74
+ metadata:
75
+ allowed_push_host: https://rubygems.org
76
+ homepage_uri: https://github.com/IndigoHomme/palindrome
77
+ source_code_uri: https://github.com/IndigoHomme/palindrome
78
+ changelog_uri: https://github.com/IndigoHomme/palindrome/CHANGELOG.md
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: 2.6.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.3.7
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Palindrome detector
98
+ test_files: []