seju_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: 8547ee43cea609770e49c98e7d5a0a14d43377de99ebc38aae7c42991fbd9d75
4
+ data.tar.gz: a7a52f4fae9cf9413cc69130c6d82f47a21d6c5d441fffb7bacf683c1116345d
5
+ SHA512:
6
+ metadata.gz: 55fbaad69a8d797771688cf87c76e7f65742b02243fdbdfa5038e3d451d0fc48c50a912b97973da6c7cd7a7a6f03d9fc4534b54727a0b418f07064a9c6e1f691
7
+ data.tar.gz: 6f95b8396131b0ccfa817ff72cab8d6c8f1978f7731463f2b6b84c402a9ad3f7b2076fe0488f64e280c0a6d351107b0d07b64f3dd42ffd6dd9477a8d1207b0b8
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ edu-letbd7ruby
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-3.0.0
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 seju_palindrome.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+ gem "minitest-reporters"
12
+ gem 'guard'
13
+ gem 'guard-minitest'
14
+ gem 'terminal-notifier-guard'
data/Gemfile.lock ADDED
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ seju_palindrome (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ansi (1.5.0)
10
+ builder (3.2.4)
11
+ coderay (1.1.3)
12
+ ffi (1.15.5)
13
+ formatador (1.1.0)
14
+ guard (2.18.0)
15
+ formatador (>= 0.2.4)
16
+ listen (>= 2.7, < 4.0)
17
+ lumberjack (>= 1.0.12, < 2.0)
18
+ nenv (~> 0.1)
19
+ notiffany (~> 0.0)
20
+ pry (>= 0.13.0)
21
+ shellany (~> 0.0)
22
+ thor (>= 0.18.1)
23
+ guard-compat (1.2.1)
24
+ guard-minitest (2.4.6)
25
+ guard-compat (~> 1.2)
26
+ minitest (>= 3.0)
27
+ listen (3.7.1)
28
+ rb-fsevent (~> 0.10, >= 0.10.3)
29
+ rb-inotify (~> 0.9, >= 0.9.10)
30
+ lumberjack (1.2.8)
31
+ method_source (1.0.0)
32
+ minitest (5.15.0)
33
+ minitest-reporters (1.2.0)
34
+ ansi
35
+ builder
36
+ minitest (>= 5.0)
37
+ ruby-progressbar
38
+ nenv (0.3.0)
39
+ notiffany (0.1.3)
40
+ nenv (~> 0.1)
41
+ shellany (~> 0.0)
42
+ pry (0.14.1)
43
+ coderay (~> 1.1)
44
+ method_source (~> 1.0)
45
+ rake (13.0.6)
46
+ rb-fsevent (0.11.1)
47
+ rb-inotify (0.10.1)
48
+ ffi (~> 1.0)
49
+ ruby-progressbar (1.11.0)
50
+ shellany (0.0.1)
51
+ terminal-notifier-guard (1.7.0)
52
+ thor (1.2.1)
53
+
54
+ PLATFORMS
55
+ x86_64-darwin-21
56
+
57
+ DEPENDENCIES
58
+ guard
59
+ guard-minitest
60
+ minitest (~> 5.0)
61
+ minitest-reporters
62
+ rake (~> 13.0)
63
+ seju_palindrome!
64
+ terminal-notifier-guard
65
+
66
+ BUNDLED WITH
67
+ 2.3.11
data/Guardfile ADDED
@@ -0,0 +1,45 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Guardfile
19
+ notification :terminal_notifier, app_name: "MyApp :: seju_alindrome", activate: 'com.googlecode.iTerm2' if `uname` =~ /Darwin/
20
+
21
+ guard :minitest do
22
+ # with Minitest::Unit
23
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
24
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
25
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
26
+
27
+ # with Minitest::Spec
28
+ # watch(%r{^spec/(.*)_spec\.rb$})
29
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
30
+ # watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
31
+
32
+ # Rails 4
33
+ # watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
34
+ # watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
35
+ # watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
36
+ # watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
37
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
38
+ # watch(%r{^test/.+_test\.rb$})
39
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
40
+
41
+ # Rails < 4
42
+ # watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
43
+ # watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
44
+ # watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
45
+ end
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # Palindrome detector
2
+
3
+ `seju_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 `seju_palindrome`, add this line to your application's `Gemfile`:
8
+
9
+ ```
10
+ gem 'seju_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 seju_palindrome
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ `seju_palindrome` adds a `palindrome?` method to the `String` class, and can be used as follows:
28
+
29
+ ```
30
+ $ irb
31
+ >> require 'seju_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,12 @@
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
+ task default: :test
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SejuPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "seju_palindrome/version"
4
+
5
+ class String
6
+
7
+ # Returns true for a palindorme, false otherwise.
8
+ def palindrome?
9
+ processed_content == processed_content.reverse
10
+ end
11
+
12
+ private
13
+
14
+ # Returns content for palindorme testing.
15
+ def processed_content
16
+ self.scan(/[a-z]/i).join.downcase
17
+
18
+ end
19
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/seju_palindrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "seju_palindrome"
7
+ spec.version = SejuPalindrome::VERSION
8
+ spec.authors = ["KONSTRUKTEUR"]
9
+ spec.email = ["raumerkunder@gmail.com"]
10
+
11
+ spec.summary = %q{Palindrome detector}
12
+ spec.description = %q{Learn Enough Ruby palindrome detector}
13
+ spec.homepage = "https://github.com/KONSTRUKTEUR/seju_palindrome"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+
16
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = "https://github.com/KONSTRUKTEUR/seju_palindrome/"
20
+ spec.metadata["changelog_uri"] = "https://github.com/KONSTRUKTEUR/seju_palindrome/blob/master/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
+ end
@@ -0,0 +1,4 @@
1
+ module SejuPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: seju_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - KONSTRUKTEUR
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-04-28 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Learn Enough Ruby palindrome detector
14
+ email:
15
+ - raumerkunder@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".ruby-gemset"
21
+ - ".ruby-version"
22
+ - Gemfile
23
+ - Gemfile.lock
24
+ - Guardfile
25
+ - README.md
26
+ - Rakefile
27
+ - lib/seju_palindrome.rb
28
+ - lib/seju_palindrome/version.rb
29
+ - seju_palindrome.gemspec
30
+ - sig/seju_palindrome.rbs
31
+ homepage: https://github.com/KONSTRUKTEUR/seju_palindrome
32
+ licenses: []
33
+ metadata:
34
+ homepage_uri: https://github.com/KONSTRUKTEUR/seju_palindrome
35
+ source_code_uri: https://github.com/KONSTRUKTEUR/seju_palindrome/
36
+ changelog_uri: https://github.com/KONSTRUKTEUR/seju_palindrome/blob/master/CHANGELOG.md
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 2.6.0
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubygems_version: 3.2.3
53
+ signing_key:
54
+ specification_version: 4
55
+ summary: Palindrome detector
56
+ test_files: []