a1425bt 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +48 -0
- data/Rakefile +2 -0
- data/a1425bt.gemspec +23 -0
- data/bin/a1425bt +16 -0
- data/lib/a1425bt.rb +46 -0
- data/lib/a1425bt/version.rb +3 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 449bd66aa3d0eb7aaeb44cdc3feeaa9df2f4e893
|
4
|
+
data.tar.gz: bf7b3605f9339debe16549744129418fed822ba3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ab071ebf28a1532057b55674c0f4b1165e9eca4420badf6436bb5088dbf7222dfffbc63222348990c39bff3e9ed72802087b1e154474d1d415148e92caaad86e
|
7
|
+
data.tar.gz: 2331a760ad1f8245bdf51846e9f08d83a049f48965a18e04a3ded9c14ec2a01c77bbe2b673ec7bcf9dac04d9b4675bac6371371f8c0c5c533bf07590720df6c7
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 佟必超
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
# A1425bt
|
2
|
+
|
3
|
+
A calculaton of age!
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'a1425bt'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install a1425bt
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
Enter your birthday!
|
24
|
+
|
25
|
+
An Example:
|
26
|
+
|
27
|
+
Please enter your birthday!
|
28
|
+
|
29
|
+
(Input the No. such as 1,10,1960.After the end of the inputting,please press the ENTERKEY!)
|
30
|
+
|
31
|
+
Day:1
|
32
|
+
|
33
|
+
Month:10
|
34
|
+
|
35
|
+
Year:1960
|
36
|
+
|
37
|
+
(The current age will be found!)
|
38
|
+
|
39
|
+
Your birthday is:1960 Year 7 Month 8 Day
|
40
|
+
|
41
|
+
Current Time is:2014-11-02 21:58:07 +0000
|
42
|
+
|
43
|
+
Your current age is:54 Years 3 Months 24 Days
|
44
|
+
|
45
|
+
##Gem information
|
46
|
+
|
47
|
+
1. Git Hub ( https://github.com/Olivia-tou/a1425bt )
|
48
|
+
2. Gem on RubyOrg (https://rubygems.org/gems/a1425bt)
|
data/Rakefile
ADDED
data/a1425bt.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'a1425bt/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "a1425bt"
|
8
|
+
spec.version = A1425bt::VERSION
|
9
|
+
spec.authors = ["Olivia-tou"]
|
10
|
+
spec.email = ["olivia_tou@yahoo.co.jp"]
|
11
|
+
spec.summary = %q(Find AGE!)
|
12
|
+
spec.description = %q(A simple calculation of age gem.)
|
13
|
+
spec.homepage = "https://rubygems.org/gems/a1425bt"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
end
|
data/bin/a1425bt
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'a1425bt' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('a1425bt', 'a1425bt')
|
data/lib/a1425bt.rb
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "a1425bt/version"
|
3
|
+
|
4
|
+
module A1425bt
|
5
|
+
#!/usr/bin/ruby
|
6
|
+
#a function to find your age
|
7
|
+
|
8
|
+
#Input Birthday
|
9
|
+
puts "Please enter your birthday!"
|
10
|
+
print "Day:"
|
11
|
+
d = gets.chomp.to_i
|
12
|
+
print "Month:"
|
13
|
+
m = gets.chomp.to_i
|
14
|
+
print"Year:"
|
15
|
+
y = gets.chomp.to_i
|
16
|
+
|
17
|
+
#Get the current time
|
18
|
+
now = Time.now
|
19
|
+
|
20
|
+
#differences in time
|
21
|
+
dd = now.day - d
|
22
|
+
dm = now.month - m
|
23
|
+
dy = now.year - y
|
24
|
+
|
25
|
+
#checks if differences is negative or not
|
26
|
+
if dd < 0
|
27
|
+
dd += 30
|
28
|
+
dm -= 1
|
29
|
+
if dm < 0
|
30
|
+
dm += 12
|
31
|
+
dy -= 1
|
32
|
+
end
|
33
|
+
else dm < 0
|
34
|
+
dm +=12
|
35
|
+
dy -=1
|
36
|
+
end
|
37
|
+
|
38
|
+
#Print inputed Birthday
|
39
|
+
printf'%s%d%s%d%s%d%s','Your birthday is:',y,' Year ',m,' Month ',d,' Day'
|
40
|
+
puts "\n\n"
|
41
|
+
#Print calculated age
|
42
|
+
puts "Current Time is:" + now.to_s + "\n\n"
|
43
|
+
printf '%s%d%s%d%s%d%s','Your current age is:',dy,' Years ',dm,' Months ',dd,\
|
44
|
+
' Days'
|
45
|
+
puts"\n"
|
46
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: a1425bt
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.1.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Olivia-tou
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-11-04 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.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
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
|
+
description: A simple calculation of age gem.
|
42
|
+
email:
|
43
|
+
- olivia_tou@yahoo.co.jp
|
44
|
+
executables:
|
45
|
+
- a1425bt
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- a1425bt.gemspec
|
55
|
+
- bin/a1425bt
|
56
|
+
- lib/a1425bt.rb
|
57
|
+
- lib/a1425bt/version.rb
|
58
|
+
homepage: https://rubygems.org/gems/a1425bt
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.2.2
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Find AGE!
|
82
|
+
test_files: []
|