bt_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: b4d5154460a750887834c7e9c1c2ffcb70debbaca1a0390afaf60743c9e662ea
4
+ data.tar.gz: 3153ab64f222cdab0b2bfc72c4431e6891a342e2f2389f91503ab8695585a404
5
+ SHA512:
6
+ metadata.gz: 615a3430b5014229ebb9d051a9524e61b6c69906de2e4313ff8309f0dbbba95225ef8b68cb96ee503cf51aea523f8862bacf2a46246a2eda9715d963d1a91422
7
+ data.tar.gz: 12e194286ec0bf3bef1a60033e39e6f678ef7b301840f02afb83d01a235c7d25f662335f8773cbfb8b7a354b4b733e35abba718b676d079c69f85fbec4a92c33
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 2.6
4
+
5
+ Style/StringLiterals:
6
+ Enabled: true
7
+ EnforcedStyle: double_quotes
8
+
9
+ Style/StringLiteralsInInterpolation:
10
+ Enabled: true
11
+ EnforcedStyle: double_quotes
12
+
13
+ Layout/LineLength:
14
+ Max: 120
15
+
16
+ Lint/ScriptPermission:
17
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2023-03-15
4
+
5
+ - Initial release
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 bt_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,53 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ bt_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.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.22.1)
20
+ parser (3.2.1.1)
21
+ ast (~> 2.4.1)
22
+ rainbow (3.1.1)
23
+ rake (13.0.6)
24
+ regexp_parser (2.7.0)
25
+ rexml (3.2.5)
26
+ rubocop (1.48.1)
27
+ json (~> 2.3)
28
+ parallel (~> 1.10)
29
+ parser (>= 3.2.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.26.0, < 2.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (>= 2.4.0, < 3.0)
36
+ rubocop-ast (1.27.0)
37
+ parser (>= 3.2.1.0)
38
+ ruby-progressbar (1.13.0)
39
+ unicode-display_width (2.4.2)
40
+
41
+ PLATFORMS
42
+ x64-mingw-ucrt
43
+ x86_64-linux
44
+
45
+ DEPENDENCIES
46
+ bt_palindrome!
47
+ minitest (~> 5.0)
48
+ minitest-reporters (= 1.2.0)
49
+ rake (~> 13.0)
50
+ rubocop (~> 1.21)
51
+
52
+ BUNDLED WITH
53
+ 2.4.8
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # Palindrome
2
+
3
+ A simple Palindrome detector gem created based on `Learn enough Ruby to be Dangerous`
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add bt_palindrome
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install bt_palindrome
14
+
15
+ ## Usage
16
+
17
+ TODO: Write usage instructions here
18
+
19
+ ## Development
20
+
21
+ 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.
22
+
23
+ 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).
24
+
25
+ ## Contributing
26
+
27
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/bt_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,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/bt_palindrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "bt_palindrome"
7
+ spec.version = BtPalindrome::VERSION
8
+ spec.authors = ["Bilal Tariq"]
9
+ spec.email = ["bilaltariq690@gmail.com"]
10
+
11
+ spec.summary = "Palindrome detector"
12
+ spec.description = "Ruby palindrome detector"
13
+ spec.homepage = "https://github.com/Bilaltariq98/bt_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"] = spec.homepage
20
+ spec.metadata["changelog_uri"] = "https://github.com/Bilaltariq98/bt_palindrome/blob/main/CHANGELOG.md"
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(__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
+ spec.metadata["rubygems_mfa_required"] = "true"
39
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BtPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "bt_palindrome/version"
4
+
5
+ # Extend String to have a palindrome function
6
+ class String
7
+ def palindrome?
8
+ processed_string == processed_string.reverse
9
+ end
10
+
11
+ private
12
+
13
+ def processed_string
14
+ downcase.split(/\W/).join
15
+ end
16
+ end
@@ -0,0 +1,4 @@
1
+ module BtPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bt_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Bilal Tariq
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-03-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby palindrome detector
14
+ email:
15
+ - bilaltariq690@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rubocop.yml"
21
+ - CHANGELOG.md
22
+ - Gemfile
23
+ - Gemfile.lock
24
+ - README.md
25
+ - Rakefile
26
+ - bt_palindrome.gemspec
27
+ - lib/bt_palindrome.rb
28
+ - lib/bt_palindrome/version.rb
29
+ - sig/bt_palindrome.rbs
30
+ homepage: https://github.com/Bilaltariq98/bt_palindrome
31
+ licenses: []
32
+ metadata:
33
+ allowed_push_host: https://rubygems.org
34
+ homepage_uri: https://github.com/Bilaltariq98/bt_palindrome
35
+ source_code_uri: https://github.com/Bilaltariq98/bt_palindrome
36
+ changelog_uri: https://github.com/Bilaltariq98/bt_palindrome/blob/main/CHANGELOG.md
37
+ rubygems_mfa_required: 'true'
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 2.6.0
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubygems_version: 3.3.26
54
+ signing_key:
55
+ specification_version: 4
56
+ summary: Palindrome detector
57
+ test_files: []