miles200_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: ee875670f642884b971ba4d50eda510dca093a7a13afb22bbc3478903bb8a35b
4
+ data.tar.gz: 0ffccfea0ee260709ee95707e527acb46d61e2dd40b437652ae6a79998de5309
5
+ SHA512:
6
+ metadata.gz: e7733b8758408c9a116de128e355dabb49df440f1b2ccd7ea6af4d50e1e1baa2066ca8e8c01758862535b1a0d43925bbd36ea128b09fd33c2bb5af91b83960aa
7
+ data.tar.gz: b5879471744eed831b1d09841f2b9438a607115f5f9264b97d6f41beb1ffe40aade7c2aa3038e9869749b3a01e85a11bdbc6f9aa1b81c2b446a37a65e4423903
@@ -0,0 +1,56 @@
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
+ <orderEntry type="jdk" jdkName="Remote: ruby-3.2.0 (-p0" jdkType="RUBY_SDK" />
9
+ <orderEntry type="sourceFolder" forTests="false" />
10
+ <orderEntry type="library" scope="PROVIDED" name="bundler (v2.4.4, Remote: ruby-3.2.0 (-p0) [gem]" level="application" />
11
+ <orderEntry type="library" scope="PROVIDED" name="json (v2.6.3, Remote: ruby-3.2.0 (-p0) [gem]" level="application" />
12
+ <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, Remote: ruby-3.2.0 (-p0) [gem]" level="application" />
13
+ <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, Remote: ruby-3.2.0 (-p0) [gem]" level="application" />
14
+ </component>
15
+ <component name="RakeTasksCache">
16
+ <option name="myRootTask">
17
+ <RakeTaskImpl id="rake">
18
+ <subtasks>
19
+ <RakeTaskImpl description="Build miles200_palindrome-0.1.0.gem into the pkg directory" fullCommand="build" id="build" />
20
+ <RakeTaskImpl id="build">
21
+ <subtasks>
22
+ <RakeTaskImpl description="Generate SHA512 checksum if miles200_palindrome-0.1.0.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
23
+ </subtasks>
24
+ </RakeTaskImpl>
25
+ <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
26
+ <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
27
+ <RakeTaskImpl description="Build and install miles200_palindrome-0.1.0.gem into system gems" fullCommand="install" id="install" />
28
+ <RakeTaskImpl id="install">
29
+ <subtasks>
30
+ <RakeTaskImpl description="Build and install miles200_palindrome-0.1.0.gem into system gems without network access" fullCommand="install:local" id="local" />
31
+ </subtasks>
32
+ </RakeTaskImpl>
33
+ <RakeTaskImpl description="Create tag v0.1.0 and build and push miles200_palindrome-0.1.0.gem to https://rubygems.org" fullCommand="release[remote]" id="release[remote]" />
34
+ <RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
35
+ <RakeTaskImpl id="rubocop">
36
+ <subtasks>
37
+ <RakeTaskImpl description="Autocorrect RuboCop offenses (only when it's safe)" fullCommand="rubocop:autocorrect" id="autocorrect" />
38
+ <RakeTaskImpl description="Autocorrect RuboCop offenses (safe and unsafe)" fullCommand="rubocop:autocorrect_all" id="autocorrect_all" />
39
+ <RakeTaskImpl description="" fullCommand="rubocop:auto_correct" id="auto_correct" />
40
+ </subtasks>
41
+ </RakeTaskImpl>
42
+ <RakeTaskImpl description="Run tests" fullCommand="test" id="test" />
43
+ <RakeTaskImpl description="" fullCommand="default" id="default" />
44
+ <RakeTaskImpl description="" fullCommand="release" id="release" />
45
+ <RakeTaskImpl id="release">
46
+ <subtasks>
47
+ <RakeTaskImpl description="" fullCommand="release:guard_clean" id="guard_clean" />
48
+ <RakeTaskImpl description="" fullCommand="release:rubygem_push" id="rubygem_push" />
49
+ <RakeTaskImpl description="" fullCommand="release:source_control_push" id="source_control_push" />
50
+ </subtasks>
51
+ </RakeTaskImpl>
52
+ </subtasks>
53
+ </RakeTaskImpl>
54
+ </option>
55
+ </component>
56
+ </module>
data/.idea/modules.xml ADDED
@@ -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/miles200_palindrome.iml" filepath="$PROJECT_DIR$/.idea/miles200_palindrome.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
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 miles200_palindrome.gemspec
6
+ gemspec
7
+
8
+ gem 'minitest-reporters', '1.2.0'
9
+
10
+ gem "rake", "~> 13.0"
11
+
12
+ gem "minitest", "~> 5.17"
13
+
14
+ gem "rubocop", "~> 1.24"
data/Gemfile.lock ADDED
@@ -0,0 +1,53 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ miles200_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.17.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.0.0)
21
+ ast (~> 2.4.1)
22
+ rainbow (3.1.1)
23
+ rake (13.0.6)
24
+ regexp_parser (2.6.1)
25
+ rexml (3.2.5)
26
+ rubocop (1.43.0)
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.24.1, < 2.0)
34
+ ruby-progressbar (~> 1.7)
35
+ unicode-display_width (>= 2.4.0, < 3.0)
36
+ rubocop-ast (1.24.1)
37
+ parser (>= 3.1.1.0)
38
+ ruby-progressbar (1.11.0)
39
+ unicode-display_width (2.4.2)
40
+
41
+ PLATFORMS
42
+ x86_64-linux
43
+
44
+ DEPENDENCIES
45
+ bundler (~> 2.4.4)
46
+ miles200_palindrome!
47
+ minitest (~> 5.17)
48
+ minitest-reporters (= 1.2.0)
49
+ rake (~> 13.0)
50
+ rubocop (~> 1.24)
51
+
52
+ BUNDLED WITH
53
+ 2.4.4
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Palindrome detector
2
+
3
+ `miles200_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
+ To install `miles200_palindrome`, add this line to your application's `Gemfile`:
8
+
9
+ ```
10
+ gem 'miles200_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 miles200_palindrome
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ `miles200_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
28
+
29
+ ```
30
+ $ irb
31
+ >> require 'miles200_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,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Miles200Palindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "miles200_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
+ scan(/[a-z]/i).join.downcase
17
+ end
18
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/miles200_palindrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "miles200_palindrome"
7
+ spec.version = Miles200Palindrome::VERSION
8
+ spec.authors = ["Miles Saunders"]
9
+ spec.email = ["saundersmiles@gmail.com"]
10
+
11
+ spec.summary = %q{Palindrome detector}
12
+ spec.description = %q{Learn Enough Ruby palindrome detector}
13
+ spec.homepage = "https://github.com/miles200/miles200_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/miles200/miles200_palindrome"
20
+
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|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_development_dependency "bundler", "~> 2.4.4"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "minitest", "~> 5.0"
37
+
38
+ # For more information and examples about making a new gem, check out our
39
+ # guide at: https://bundler.io/guides/creating_gem.html
40
+ end
@@ -0,0 +1,4 @@
1
+ module Miles200Palindrome
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: miles200_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Miles Saunders
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-01-21 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.4.4
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.4.4
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
+ - saundersmiles@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".idea/miles200_palindrome.iml"
63
+ - ".idea/modules.xml"
64
+ - ".rubocop.yml"
65
+ - Gemfile
66
+ - Gemfile.lock
67
+ - README.md
68
+ - Rakefile
69
+ - lib/miles200_palindrome.rb
70
+ - lib/miles200_palindrome/version.rb
71
+ - miles200_palindrome.gemspec
72
+ - sig/miles200_palindrome.rbs
73
+ homepage: https://github.com/miles200/miles200_palindrome
74
+ licenses: []
75
+ metadata:
76
+ allowed_push_host: https://rubygems.org
77
+ homepage_uri: https://github.com/miles200/miles200_palindrome
78
+ source_code_uri: https://github.com/miles200/miles200_palindrome
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.4.4
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Palindrome detector
98
+ test_files: []