seiza 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: 2d31885a311f18784cd81142c8a5ff7f719cc58b75fbe25daa597c758e587c8b
4
+ data.tar.gz: b77d3043c6eb3e854fd552c911fc6be43a875e486cb0a936655241a193f43757
5
+ SHA512:
6
+ metadata.gz: bf3433f0b746dd6624a89127e502cbeac6c0896c8a38345dd613b6525da1a360034de236f62eed4ef9913f48b9e68f6b3c668046cb7e81079c3d0783a624c18a
7
+ data.tar.gz: af630b1be1b9d84723443d701381a806194100cfe238c2e3577e81cb62bd30a1bbd6dae991f970ec658be9afe6537007dd348daee343503ae30fa25ff435e8b6
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
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,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in seiza.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Risa Harada
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # Seiza
2
+
3
+ This gem shows zodiac sign from Time object.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add seiza
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install seiza
14
+
15
+ ## Usage
16
+
17
+ ```ruby
18
+ Time.new(1991, 07, 02).seiza # => "cancer"
19
+ Time.new(1991, 07, 02).zodiac_sign # => "cancer"
20
+ ```
21
+
22
+ ## Zodiac sign list
23
+
24
+ |sign|name|date|
25
+ |---|---|---|
26
+ |♈️|aries|3/21-4/19|
27
+ |♉️|taurus|4/20-5/20|
28
+ |♊️|gemini|5/21-6/21|
29
+ |♋️|cancer|6/22-7/22|
30
+ |♌️|leo|7/23-8/22|
31
+ |♍️|vergo|8/23-9/22|
32
+ |♎️|libra|9/23-10-23|
33
+ |♏️|scorpio|10/24-11/22|
34
+ |♐️|sagittarius|11/23-12/21|
35
+ |♑️|capricorn|12/22-1/19|
36
+ |♒️|aquarius|1/20-2/18|
37
+ |♓️|pisces|2/19-3/20|
38
+
39
+ ## Development
40
+
41
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
42
+
43
+ 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).
44
+
45
+ ## Contributing
46
+
47
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/seiza.
48
+
49
+ ## License
50
+
51
+ 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 "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Seiza
4
+ VERSION = "0.1.0"
5
+ end
data/lib/seiza.rb ADDED
@@ -0,0 +1,58 @@
1
+ #frozen_string_literal:true
2
+
3
+ require_relative"seiza/version"
4
+
5
+ module Seiza
6
+ class Error < StandardError; end
7
+
8
+ def seiza
9
+ month = self.month
10
+ day = self.day
11
+
12
+ seiza = if month == 1
13
+ return "capricorn" if day <= 19
14
+ return "aquarius" if day >= 20
15
+ elsif month == 2
16
+ return "aquarius" if day <= 18
17
+ return "pisces" if day >= 19
18
+ elsif month == 3
19
+ return "pisces" if day <= 20
20
+ return "aries" if day >= 21
21
+ elsif month == 4
22
+ return "aries" if day <= 19
23
+ return "taurus" if day >= 20
24
+ elsif month == 5
25
+ return "taurus" if day <= 20
26
+ return "gemini" if day <= 21
27
+ elsif month == 6
28
+ return "gemini" if day <= 21
29
+ return "cancer" if day >= 22
30
+ elsif month == 7
31
+ return "cancer" if day <= 22
32
+ return "leo" if day >= 23
33
+ elsif month == 8
34
+ return "leo" if day <= 22
35
+ return "virgo" if day >= 23
36
+ elsif month == 9
37
+ return "virgo" if day <= 22
38
+ return "libra" if day >= 23
39
+ elsif month == 10
40
+ return "libra" if day <= 23
41
+ return "scorpio" if day >= 24
42
+ elsif month == 11
43
+ return "scorpio" if day <= 22
44
+ return "sagittarius" if day >= 23
45
+ elsif month == 12
46
+ return "sagittarius" if day <= 23
47
+ return "capricorn" if day >= 22
48
+ end
49
+ end
50
+
51
+ def zodiac_sign
52
+ seiza
53
+ end
54
+ end
55
+
56
+ class Time
57
+ include Seiza
58
+ end
data/seiza.gemspec ADDED
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/seiza/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "seiza"
7
+ spec.version = Seiza::VERSION
8
+ spec.authors = ["Risa Harada"]
9
+ spec.email = ["supikateriburu@gmail.com"]
10
+
11
+ spec.summary = "Return seiza."
12
+ spec.description = "Return seiza."
13
+ spec.homepage = "https://github.com/risacan/seiza"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ spec.metadata["allowed_push_host"] = "https://rubygems.org/"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = "https://github.com/risacan/seiza"
21
+ spec.metadata["changelog_uri"] = "https://github.com/risacan/seiza/releases"
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
28
+ end
29
+ end
30
+ spec.bindir = "exe"
31
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
+ spec.require_paths = ["lib"]
33
+
34
+ # Uncomment to register a new dependency of your gem
35
+ # spec.add_dependency "example-gem", "~> 1.0"
36
+
37
+ # For more information and examples about making a new gem, check out our
38
+ # guide at: https://bundler.io/guides/creating_gem.html
39
+ end
data/sig/seiza.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Seiza
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: seiza
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Risa Harada
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2022-12-23 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Return seiza.
14
+ email:
15
+ - supikateriburu@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rspec"
21
+ - ".rubocop.yml"
22
+ - Gemfile
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - lib/seiza.rb
27
+ - lib/seiza/version.rb
28
+ - seiza.gemspec
29
+ - sig/seiza.rbs
30
+ homepage: https://github.com/risacan/seiza
31
+ licenses:
32
+ - MIT
33
+ metadata:
34
+ allowed_push_host: https://rubygems.org/
35
+ homepage_uri: https://github.com/risacan/seiza
36
+ source_code_uri: https://github.com/risacan/seiza
37
+ changelog_uri: https://github.com/risacan/seiza/releases
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.7
54
+ signing_key:
55
+ specification_version: 4
56
+ summary: Return seiza.
57
+ test_files: []