horario 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/horario +45 -0
- metadata +62 -0
data/bin/horario
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'colorize'
|
4
|
+
|
5
|
+
# first_number = ARGV[0].to_i
|
6
|
+
# second_number = ARGV[1].to_i
|
7
|
+
|
8
|
+
puts
|
9
|
+
puts
|
10
|
+
print ' Digite a hora de entrada: '.green
|
11
|
+
hour = gets.chomp
|
12
|
+
|
13
|
+
puts
|
14
|
+
print ' Digite os minutos de entrada: '.green
|
15
|
+
minutes = gets.chomp
|
16
|
+
|
17
|
+
puts
|
18
|
+
print ' Digite as horas adicionais: '.green
|
19
|
+
hours_add = gets.chomp
|
20
|
+
|
21
|
+
puts
|
22
|
+
print ' Digite os minutos adicionais: '.green
|
23
|
+
minutes_add = gets.chomp
|
24
|
+
|
25
|
+
now = Time.now
|
26
|
+
year = now.year
|
27
|
+
month = now.month
|
28
|
+
day = now.day
|
29
|
+
hour = Integer(hour)
|
30
|
+
minutes = Integer(minutes)
|
31
|
+
hours_add = Integer(hours_add)
|
32
|
+
hours_add = (60 * 60 * hours_add)
|
33
|
+
minutes_add = Integer(minutes_add)
|
34
|
+
minutes_add = (60 * 60 * (100/60.0*minutes_add/100))
|
35
|
+
|
36
|
+
|
37
|
+
time = Time.new(year, month, day, hour, minutes, 0)
|
38
|
+
interval = (60 * 60 * (9 + (100/60.0*48/100)))
|
39
|
+
result = (time+interval+hours_add+minutes_add).strftime('%H:%M')
|
40
|
+
|
41
|
+
puts
|
42
|
+
puts " Seu horario de saida e #{result}".yellow
|
43
|
+
puts
|
44
|
+
puts
|
45
|
+
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: horario
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Madson Cardoso
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: colorize
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.5.8
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.5.8
|
30
|
+
description: A simple ruby tool to calculate time to go, based on CLT laws
|
31
|
+
email: madsonmac@gmail.com
|
32
|
+
executables:
|
33
|
+
- horario
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- bin/horario
|
38
|
+
homepage: http://madson.github.com/
|
39
|
+
licenses: []
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- bin
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.8.7
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
requirements: []
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.8.24
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: Ruby tool to calculate time to go
|
62
|
+
test_files: []
|