edgar_palindrome 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 2e6b2e159f922efe2a6f94233d7ce1014cab9a0e9e4d2e9e4e58a486a77f7866
4
+ data.tar.gz: '09a694f7791387f612dbe572c77dc5e3a554f0004e07ae3f8d3caafac278b79e'
5
+ SHA512:
6
+ metadata.gz: 5ba352be3e0f9f595e6fb2a1af6537c3ddeaceba48745fe3d27ef868abdc1f60df9a7914ef43817bd6c07ecd1c5e386b57efab23a300b45399181ef5e3cf3ceb
7
+ data.tar.gz: '08d99ff7fcf37fba2603be69e1a7de510b017d1fee55d1489851a3b367136b3b80e391da5d693b5b8a6d6390543227f33c854aa5ea4849d31fc596b1a62b9220'
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in edgar_palindrome.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
11
+
12
+ gem "minitest-reporters", "1.2.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,33 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ edgar_palindrome (0.1.0)
5
+ bundler (~> 2.4.1)
6
+ minitest (~> 5.0)
7
+ rake (~> 13.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ ansi (1.5.0)
13
+ builder (3.2.4)
14
+ minitest (5.17.0)
15
+ minitest-reporters (1.2.0)
16
+ ansi
17
+ builder
18
+ minitest (>= 5.0)
19
+ ruby-progressbar
20
+ rake (13.0.6)
21
+ ruby-progressbar (1.11.0)
22
+
23
+ PLATFORMS
24
+ x86_64-darwin-21
25
+
26
+ DEPENDENCIES
27
+ edgar_palindrome!
28
+ minitest (~> 5.0)
29
+ minitest-reporters (= 1.2.0)
30
+ rake (~> 13.0)
31
+
32
+ BUNDLED WITH
33
+ 2.4.1
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # EdgarPalindrome
2
+
3
+ Palindrome detector created by Edgar Markevicius on January 4th, 2023 as part of learn enough ruby to be dangerous course
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add edgar_palindrome
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install edgar_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/cl0udmaker/edgar_palindrome.
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,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/edgar_palindrome/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "edgar_palindrome"
7
+ spec.version = EdgarPalindrome::VERSION
8
+ spec.authors = ["Edgar Markevicius"]
9
+ spec.email = ["edgar@labas.app"]
10
+
11
+ spec.summary = %(Palindrome detector)
12
+ spec.description = %(Learn enough Ruby to implement palindrome detector)
13
+ spec.homepage = "https://github.com/cl0udmaker/ruby-palindrome-gem"
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"] = spec.homepage
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
+ spec.add_dependency "bundler", "~> 2.4.1"
34
+ spec.add_dependency "rake", "~> 13.0"
35
+ spec.add_dependency "minitest", "~> 5.0"
36
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EdgarPalindrome
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,20 @@
1
+ require "edgar_palindrome/version"
2
+
3
+ class String
4
+
5
+ # Returns true for a palindrome, false otherwise.
6
+ def palindrome?
7
+ processed_content == processed_content.reverse
8
+ end
9
+
10
+ def letters
11
+ self.scan(/[a-zA-Z]/).join
12
+ end
13
+
14
+ private
15
+
16
+ # Returns content for palindrome testing.
17
+ def processed_content
18
+ self.downcase.letters
19
+ end
20
+ end
@@ -0,0 +1,4 @@
1
+ module EdgarPalindrome
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: edgar_palindrome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Edgar Markevicius
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-01-05 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.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.4.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '13.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '13.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: :runtime
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 to implement palindrome detector
56
+ email:
57
+ - edgar@labas.app
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - Gemfile
63
+ - Gemfile.lock
64
+ - README.md
65
+ - Rakefile
66
+ - edgar_palindrome.gemspec
67
+ - lib/edgar_palindrome.rb
68
+ - lib/edgar_palindrome/version.rb
69
+ - sig/edgar_palindrome.rbs
70
+ homepage: https://github.com/cl0udmaker/ruby-palindrome-gem
71
+ licenses: []
72
+ metadata:
73
+ allowed_push_host: https://rubygems.org/
74
+ homepage_uri: https://github.com/cl0udmaker/ruby-palindrome-gem
75
+ source_code_uri: https://github.com/cl0udmaker/ruby-palindrome-gem
76
+ changelog_uri: https://github.com/cl0udmaker/ruby-palindrome-gem
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: 2.6.0
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubygems_version: 3.4.1
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Palindrome detector
96
+ test_files: []