kenbak_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: 1b7f408058e379a56bfc0645405bb255c754a3e4bd1350ad3ce272ead587205f
4
+ data.tar.gz: cea7e05afafd8fdf689f4432dc104efb1704e84334af1514c8255b2756340a44
5
+ SHA512:
6
+ metadata.gz: f505f1b71359a09b7fe2cf2319d2665cabd753b497f39c1469639a0e1567c5cce1666c813431026b9f24d326313079bbd31d685f57c95bdff99ef5a1b93e81fb
7
+ data.tar.gz: '08b7ba6285003187a624430d71881f3e3a30a22be2b1325be24e3b008eb8f71fa55072feeb3d4b4dc7af5d99ba52ff96ba0505f17e6f20b8b3a99d9555a21210'
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 kenbak_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
+ kenbak_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.2)
13
+ minitest (5.16.2)
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.1.2.0)
21
+ ast (~> 2.4.1)
22
+ rainbow (3.1.1)
23
+ rake (13.0.6)
24
+ regexp_parser (2.5.0)
25
+ rexml (3.2.5)
26
+ rubocop (1.32.0)
27
+ json (~> 2.3)
28
+ parallel (~> 1.10)
29
+ parser (>= 3.1.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.19.1, < 2.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (>= 1.4.0, < 3.0)
36
+ rubocop-ast (1.19.1)
37
+ parser (>= 3.1.1.0)
38
+ ruby-progressbar (1.11.0)
39
+ unicode-display_width (2.2.0)
40
+
41
+ PLATFORMS
42
+ x86_64-darwin-21
43
+
44
+ DEPENDENCIES
45
+ kenbak_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.7
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # KenbakPalindrome
2
+
3
+ `kenbak_palindrome` is a sample Ruby gem created in [*Learn Enough Ruby to Be Dangerous*](https://www.learnenough.com/ruby-tutorial) by Michael Hartl.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'kenbak_palindrome'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install kenbak_palindrome
20
+
21
+ ## Usage
22
+
23
+ `kenbak_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
24
+
25
+ ```
26
+ $ irb
27
+ >> require 'kenbak_palindrome'
28
+ >> "honey badger".palindrome?
29
+ => false
30
+ >> "deified".palindrome?
31
+ => true
32
+ >> "Able was I, ere I saw Elba.".palindrome?
33
+ => true
34
+ >> phrase = "Madam, I'm Adam."
35
+ >> phrase.palindrome?
36
+ => true
37
+ ```
38
+
39
+ ## Development
40
+
41
+ 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.
42
+
43
+ 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).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/kenbak/kenbak_palindrome.
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/kenbak_palindrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "kenbak_palindrome"
7
+ spec.version = KenbakPalindrome::VERSION
8
+ spec.authors = ["Antoine Serval"]
9
+ spec.email = ["k6nb4k@gmail.com"]
10
+
11
+ spec.summary = "Palindrome detector"
12
+ spec.description = "Learn Enough Ruby palindrome detector"
13
+ spec.homepage = "https://github.com/kenbak/kenbak_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/kenbak/kenbak_palindrome"
20
+ spec.metadata["changelog_uri"] = "https://github.com/kenbak/kenbak_palindrome"
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_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,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KenbakPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "kenbak_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
+ private
13
+
14
+ # Returns content for palindrome testing.
15
+ def processed_content
16
+ self.scan(/[a-z]/i).join.downcase
17
+ end
18
+ end
@@ -0,0 +1,4 @@
1
+ module KenbakPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kenbak_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Antoine Serval
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-07-31 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby palindrome detector
14
+ email:
15
+ - k6nb4k@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
+ - kenbak_palindrome.gemspec
26
+ - lib/kenbak_palindrome.rb
27
+ - lib/kenbak_palindrome/version.rb
28
+ - sig/kenbak_palindrome.rbs
29
+ homepage: https://github.com/kenbak/kenbak_palindrome
30
+ licenses: []
31
+ metadata:
32
+ allowed_push_host: https://rubygems.org
33
+ homepage_uri: https://github.com/kenbak/kenbak_palindrome
34
+ source_code_uri: https://github.com/kenbak/kenbak_palindrome
35
+ changelog_uri: https://github.com/kenbak/kenbak_palindrome
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: []