jugoya 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 +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/Gemfile +11 -0
- data/README.md +39 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/jugoya.gemspec +24 -0
- data/lib/jugoya.rb +5 -0
- data/lib/jugoya/moon.rb +55 -0
- data/lib/jugoya/version.rb +3 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2afcfa6bbbed9f51e814f3e74f74c1c88d9fc862
|
4
|
+
data.tar.gz: 077bb5fa5bb06a1939dcec0ba91288bc8fc227ee
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fd8f6dac8c24cdbb7accc32c492240fddda2f342446f46b1ae1536d4506bcf1e828ef924d09ca6a08c25849b10599cb43b65b63fabdfddab2cfc88c0274be0d7
|
7
|
+
data.tar.gz: 17d8d3a80577b5582d9ef4e3a43310662729d13a2a5b65bb6987804c2ad8b6fbbd1c5b86c1074208d9bbf3a693b5f34a29f49cebd6dc66654cfd93cc5d7ae0c3
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Jugoya
|
2
|
+
|
3
|
+
[](http://travis-ci.org/ikea-dless/jugoya)
|
4
|
+
[](https://coveralls.io/github/ikea-dless/jugoya?branch=master)
|
5
|
+
|
6
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jugoya`. To experiment with that code, run `bin/console` for an interactive prompt.
|
7
|
+
|
8
|
+
TODO: Delete this and the text above, and describe your gem
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'jugoya'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install jugoya
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
TODO: Write usage instructions here
|
29
|
+
|
30
|
+
## Development
|
31
|
+
|
32
|
+
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.
|
33
|
+
|
34
|
+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jugoya.
|
39
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "jugoya"
|
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
|
data/bin/setup
ADDED
data/jugoya.gemspec
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jugoya/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "jugoya"
|
8
|
+
spec.version = Jugoya::VERSION
|
9
|
+
spec.authors = ["Takahiro Ikeda"]
|
10
|
+
spec.email = ["ikeadless@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Today of the moon.}
|
13
|
+
spec.description = %q{You can know phase of the moon on today.}
|
14
|
+
spec.homepage = "https://github.com/ikea-dless/jugoya"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
24
|
+
end
|
data/lib/jugoya.rb
ADDED
data/lib/jugoya/moon.rb
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
module Jugoya
|
2
|
+
class Moon
|
3
|
+
@@full_phase = 180
|
4
|
+
@@half_phase = 90
|
5
|
+
@@crescent_phase = 27
|
6
|
+
attr_accessor :phase
|
7
|
+
|
8
|
+
def initialize(phase = nil)
|
9
|
+
@phase = phase.to_i
|
10
|
+
end
|
11
|
+
|
12
|
+
def full?
|
13
|
+
@phase == @@full_phase
|
14
|
+
end
|
15
|
+
|
16
|
+
def half?
|
17
|
+
@phase == @@half_phase
|
18
|
+
end
|
19
|
+
|
20
|
+
def crescent?
|
21
|
+
@phase == @@crescent_phase
|
22
|
+
end
|
23
|
+
|
24
|
+
def almost_full?
|
25
|
+
(@@full_phase - 10..@@full_phase + 10).include?(@phase)
|
26
|
+
end
|
27
|
+
|
28
|
+
def almost_half?
|
29
|
+
(@@half_phase - 5..@@half_phase + 5).include?(@phase)
|
30
|
+
end
|
31
|
+
|
32
|
+
def almost_crescent?
|
33
|
+
(@@crescent_phase - 5..@@crescent_phase + 5).include?(@phase)
|
34
|
+
end
|
35
|
+
|
36
|
+
def status
|
37
|
+
case
|
38
|
+
when full?
|
39
|
+
'full_moon'
|
40
|
+
when half?
|
41
|
+
'half_moon'
|
42
|
+
when crescent?
|
43
|
+
'crescent_moon'
|
44
|
+
when almost_full?
|
45
|
+
'almost_full_moon'
|
46
|
+
when almost_half?
|
47
|
+
'almost_half_moon'
|
48
|
+
when almost_crescent?
|
49
|
+
'almost_crescent_moon'
|
50
|
+
else
|
51
|
+
'oops.. you will not to be able to worship the beautiful moon.'
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jugoya
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Takahiro Ikeda
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-19 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: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
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: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: You can know phase of the moon on today.
|
56
|
+
email:
|
57
|
+
- ikeadless@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- bin/console
|
69
|
+
- bin/setup
|
70
|
+
- jugoya.gemspec
|
71
|
+
- lib/jugoya.rb
|
72
|
+
- lib/jugoya/moon.rb
|
73
|
+
- lib/jugoya/version.rb
|
74
|
+
homepage: https://github.com/ikea-dless/jugoya
|
75
|
+
licenses: []
|
76
|
+
metadata: {}
|
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: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.5.1
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Today of the moon.
|
97
|
+
test_files: []
|