bkiarie_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: 49cb1da550dda8681e3fa7012db9f53bca25eedf15c4d8479c0b766a7ebd8654
4
+ data.tar.gz: 336c51057f2d7700ad44e13c056d3e05d0bcb1bc5638f5643b48bf4ec70641a9
5
+ SHA512:
6
+ metadata.gz: 7932da149c9ac9c07de8f2b72658722aec1a890f564bc87936d9f022d0742691d013a6e56f71067729e67ed5693082f9263bfea1851740b3c70c255803ae0b52
7
+ data.tar.gz: 7ab598932074a279926451ad02ca35eabed9757689e164ad338fc5363a53558dc9ba18d7be50da4669baa1631b8ea2383abe9af765904abbcaa60ba793b303ce
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Style/StringLiterals:
5
+ Enabled: true
6
+ EnforcedStyle: double_quotes
7
+
8
+ Style/StringLiteralsInInterpolation:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Layout/LineLength:
13
+ Max: 120
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 bkiarie_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,50 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bkiarie_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
+ minitest (5.15.0)
13
+ minitest-reporters (1.2.0)
14
+ ansi
15
+ builder
16
+ minitest (>= 5.0)
17
+ ruby-progressbar
18
+ parallel (1.22.1)
19
+ parser (3.1.2.0)
20
+ ast (~> 2.4.1)
21
+ rainbow (3.1.1)
22
+ rake (13.0.6)
23
+ regexp_parser (2.5.0)
24
+ rexml (3.2.5)
25
+ rubocop (1.30.1)
26
+ parallel (~> 1.10)
27
+ parser (>= 3.1.0.0)
28
+ rainbow (>= 2.2.2, < 4.0)
29
+ regexp_parser (>= 1.8, < 3.0)
30
+ rexml (>= 3.2.5, < 4.0)
31
+ rubocop-ast (>= 1.18.0, < 2.0)
32
+ ruby-progressbar (~> 1.7)
33
+ unicode-display_width (>= 1.4.0, < 3.0)
34
+ rubocop-ast (1.18.0)
35
+ parser (>= 3.1.1.0)
36
+ ruby-progressbar (1.11.0)
37
+ unicode-display_width (2.1.0)
38
+
39
+ PLATFORMS
40
+ x86_64-linux
41
+
42
+ DEPENDENCIES
43
+ bkiarie_palindrome!
44
+ minitest (~> 5.0)
45
+ minitest-reporters (= 1.2.0)
46
+ rake (~> 13.0)
47
+ rubocop (~> 1.21)
48
+
49
+ BUNDLED WITH
50
+ 2.3.15
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Palindrome detector
2
+
3
+ `bkiarie_palindrome` is a sample Ruby gem to test whether a given input is a sting.
4
+
5
+ ## Installation
6
+
7
+ To install `bkiarie_palindrome`, add this line to your application's `Gemfile`:
8
+
9
+ ```
10
+ gem 'bkiarie_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 bkiarie_palindrome
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ `bkiarie_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
28
+
29
+ ```
30
+ $ irb
31
+ >> require 'bkiarie_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,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/bkiarie_palindrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "bkiarie_palindrome"
7
+ spec.version = BkiariePalindrome::VERSION
8
+ spec.authors = ["Benmuiruri"]
9
+ spec.email = ["ben.muiruri13@gmail.com"]
10
+
11
+ spec.summary = %q{Palindrome detector}
12
+ spec.description = %{Ben Kiarie's Ruby palindrome detector}
13
+ spec.homepage = "https://github.com/Benmuiruri/ruby-palindrome-checker"
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/Benmuiruri/ruby-palindrome-checker"
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(__dir__) do
24
+ `git ls-files -z`.split("\x0").reject do |f|
25
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
26
+ end
27
+ end
28
+ spec.bindir = "exe"
29
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
30
+ spec.require_paths = ["lib"]
31
+
32
+ # Uncomment to register a new dependency of your gem
33
+ # spec.add_dependency "example-gem", "~> 1.0"
34
+
35
+ # For more information and examples about making a new gem, check out our
36
+ # guide at: https://bundler.io/guides/creating_gem.html
37
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BkiariePalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "bkiarie_palindrome/version"
4
+
5
+ class String
6
+ def palindrome?
7
+ processed_content == processed_content.reverse
8
+ end
9
+
10
+ private
11
+
12
+ def processed_content
13
+ scan(/[a-z]/i).join.downcase
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ module BkiariePalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,54 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bkiarie_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Benmuiruri
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ben Kiarie's Ruby palindrome detector
14
+ email:
15
+ - ben.muiruri13@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
+ - bkiarie_palindrome.gemspec
26
+ - lib/bkiarie_palindrome.rb
27
+ - lib/bkiarie_palindrome/version.rb
28
+ - sig/bkiarie_palindrome.rbs
29
+ homepage: https://github.com/Benmuiruri/ruby-palindrome-checker
30
+ licenses: []
31
+ metadata:
32
+ allowed_push_host: https://rubygems.org/
33
+ homepage_uri: https://github.com/Benmuiruri/ruby-palindrome-checker
34
+ source_code_uri: https://github.com/Benmuiruri/ruby-palindrome-checker
35
+ post_install_message:
36
+ rdoc_options: []
37
+ require_paths:
38
+ - lib
39
+ required_ruby_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.6.0
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ requirements: []
50
+ rubygems_version: 3.3.7
51
+ signing_key:
52
+ specification_version: 4
53
+ summary: Palindrome detector
54
+ test_files: []