kpietrzk_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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b014b077381e95c8993411221688ec6888cf288b463f83542b7f21102d36204c
4
+ data.tar.gz: 7a339d063e687caa7c64e5cf44e989afd128fff3ebc4a9b2e5e66c02bdd65a90
5
+ SHA512:
6
+ metadata.gz: 17bd97ae0114ba6b604ddc7da32747d2195c804663082fba72ff883b2f6111d108d6423a68ea4ebcbacfb9a101a607b57f5a777b4ff0af8b97d29645fbe2fda4
7
+ data.tar.gz: eb27df1fc66ad9c182effef9d83cadcfd266cc5ceb81a07b54c98337fcf330f0645b675cd3e1b3205f183be3a18309d2a2294906c6cfe7e51736f9094910f239
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,8 @@
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Datasource local storage ignored files
5
+ /dataSources/
6
+ /dataSources.local.xml
7
+ # Editor-based HTTP Client requests
8
+ /httpRequests/
@@ -0,0 +1,22 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="RUBY_MODULE" version="4">
3
+ <component name="ModuleRunConfigurationManager">
4
+ <shared />
5
+ </component>
6
+ <component name="NewModuleRootManager">
7
+ <content url="file://$MODULE_DIR$">
8
+ <sourceFolder url="file://$MODULE_DIR$/features" isTestSource="true" />
9
+ <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
10
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
11
+ </content>
12
+ <orderEntry type="inheritedJdk" />
13
+ <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="ansi (v1.5.0, rbenv: 2.7.1) [gem]" level="application" />
15
+ <orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, rbenv: 2.7.1) [gem]" level="application" />
16
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, rbenv: 2.7.1) [gem]" level="application" />
17
+ <orderEntry type="library" scope="PROVIDED" name="minitest (v5.14.1, rbenv: 2.7.1) [gem]" level="application" />
18
+ <orderEntry type="library" scope="PROVIDED" name="minitest-reporters (v1.2.0, rbenv: 2.7.1) [gem]" level="application" />
19
+ <orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, rbenv: 2.7.1) [gem]" level="application" />
20
+ <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, rbenv: 2.7.1) [gem]" level="application" />
21
+ </component>
22
+ </module>
@@ -0,0 +1,4 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.7.1" project-jdk-type="RUBY_SDK" />
4
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/kpietrzk_palindrome.iml" filepath="$PROJECT_DIR$/.idea/kpietrzk_palindrome.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,6 @@
1
+ ---
2
+ language: ruby
3
+ cache: bundler
4
+ rvm:
5
+ - 2.7.1
6
+ before_install: gem install bundler -v 2.1.4
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in kpietrzk_palindrome.gemspec
6
+ gemspec
7
+
8
+ gem 'minitest', '~> 5.0'
9
+ gem 'minitest-reporters', '~> 1.2.0'
10
+ gem 'rake', '~> 12.0'
@@ -0,0 +1,46 @@
1
+ # Palindrome detector
2
+
3
+ `kpietrzyk_palindrome` is a simple Ruby gem created in [Learn Enough to Be Dangerous](https://www.learnenough.com/) by Michael Hartl.
4
+
5
+ ### Installation
6
+ To Install `kpietrzyk_palindrome`, add this line to your application's Gemfile:
7
+
8
+ ```ruby
9
+ gem 'kpietrzyk_palindrome'
10
+ ```
11
+
12
+
13
+
14
+ Then install as follows:
15
+ ```bash
16
+ $ bundle install
17
+ ```
18
+
19
+
20
+
21
+ Or install it directly using `gem`:
22
+ ```bash
23
+ $ gem install kpietrzyk_palindrome
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ `kpietrzyk_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
29
+
30
+ ```
31
+ $ irb
32
+ >> require 'kpietrzyk_palindrome'
33
+ >> "honey badger".palindrome?
34
+ => false
35
+ >> "deified".palindrome?
36
+ => true
37
+ >> "Able was I, ere I saw Elba.".palindrome?
38
+ => true
39
+ >> phrase = "Madam, I'm Adam."
40
+ >> phrase.palindrome?
41
+ => true
42
+ ```
43
+
44
+ ## License
45
+
46
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "kpietrzk_palindrome"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/kpietrzk_palindrome/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'kpietrzk_palindrome'
7
+ spec.version = KpietrzkPalindrome::VERSION
8
+ spec.authors = ['kpietrzyk']
9
+ spec.email = ['krzysztof.pietrzyk@hotmail.com']
10
+
11
+ spec.summary = 'Palindrome detector'
12
+ spec.description = 'Learn Enough Ruby palindrome detector'
13
+ spec.homepage = 'https://github.com/kpietrzyk/my_first_ruby_gem'
14
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.3.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/kpietrzyk/my_first_ruby_gem'
20
+ spec.metadata['changelog_uri'] = 'https://github.com/kpietrzyk/my_first_ruby_gem'
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 { |f| f.match(%r{^(test|spec|features)/}) }
26
+ end
27
+ spec.bindir = 'exe'
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ['lib']
30
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'kpietrzk_palindrome/version'
4
+ # Documentation comments
5
+ class String
6
+ # Returns true for a palindrome, false otherwise.
7
+ def palindrome?
8
+ processed_content == processed_content.reverse
9
+ end
10
+
11
+ # Returns the letters in the string.
12
+ def letters
13
+
14
+ end
15
+
16
+ private
17
+
18
+ # Returns content for palindrome testing.
19
+ def processed_content
20
+ scan(/[a-z]/i).join('').downcase
21
+ end
22
+
23
+
24
+ end
@@ -0,0 +1,3 @@
1
+ module KpietrzkPalindrome
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kpietrzk_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - kpietrzyk
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-08-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby palindrome detector
14
+ email:
15
+ - krzysztof.pietrzyk@hotmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".gitignore"
21
+ - ".idea/.gitignore"
22
+ - ".idea/kpietrzk_palindrome.iml"
23
+ - ".idea/misc.xml"
24
+ - ".idea/modules.xml"
25
+ - ".idea/vcs.xml"
26
+ - ".travis.yml"
27
+ - Gemfile
28
+ - README.md
29
+ - Rakefile
30
+ - bin/console
31
+ - bin/setup
32
+ - kpietrzk_palindrome.gemspec
33
+ - lib/kpietrzk_palindrome.rb
34
+ - lib/kpietrzk_palindrome/version.rb
35
+ homepage: https://github.com/kpietrzyk/my_first_ruby_gem
36
+ licenses: []
37
+ metadata:
38
+ allowed_push_host: https://rubygems.org/
39
+ homepage_uri: https://github.com/kpietrzyk/my_first_ruby_gem
40
+ source_code_uri: https://github.com/kpietrzyk/my_first_ruby_gem
41
+ changelog_uri: https://github.com/kpietrzyk/my_first_ruby_gem
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: 2.3.0
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubygems_version: 3.1.2
58
+ signing_key:
59
+ specification_version: 4
60
+ summary: Palindrome detector
61
+ test_files: []