BmiCalculator 11.0.1
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/README.md +52 -0
- data/bmi.rb +42 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7350d68d05c7ef43f3ded64beb8b61ee15db8c5d
|
4
|
+
data.tar.gz: 12e22b7e15496a95b920468b8216dc846e333c32
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6e4dd216c41b121db180a0fc5b2b3dea3dee68cf8dccd4d7206612ee725daafdf40bfb8eb99b75b3187499412c56629079b21490f54d2a968d841d5b19bc1687
|
7
|
+
data.tar.gz: 57ae9f3f4636061ecedc72ae5fdaf2972a0c6b1c038bfb0c07ffcd850a74a1fa61c9650fb6ba11d2b6efd2470acdcbfb0d4050b9edd0eb2b713cdf217a73778c
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# Welcome to the lerolero, the ultimate random phrase generator.
|
2
|
+
|
3
|
+
## Getting Started
|
4
|
+
|
5
|
+
1. Instale o gem assim:
|
6
|
+
|
7
|
+
$ gem install bm
|
8
|
+
|
9
|
+
2. Abra o arquivo Gem file que fica no root do seu site dessa maneira:
|
10
|
+
|
11
|
+
$ sudo nano Gemfile
|
12
|
+
|
13
|
+
e adicione a seguinte linha:
|
14
|
+
|
15
|
+
$ gem 'lerolero'
|
16
|
+
|
17
|
+
|
18
|
+
3. Rode o bundle install:
|
19
|
+
|
20
|
+
$ sudo bundle install
|
21
|
+
|
22
|
+
|
23
|
+
4. Use assim dentro do seu código ruby on rails:
|
24
|
+
|
25
|
+
$ puts Lerolero.produzirfraselerolero
|
26
|
+
$ puts Lerolero.produzirfraselerolero(3)
|
27
|
+
|
28
|
+
A glamorous and smart totally random phrase will be generated.
|
29
|
+
Output example:
|
30
|
+
|
31
|
+
$ Por conseguinte, a necessidade de renovação processual garante a contribuição de um grupo importante na determinação das condições financeiras e administrativas exigidas. A nível organizacional, a adoção de políticas descentralizadoras estimula a padronização das direções preferenciais no sentido do progresso.
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
[](https://www.codetriage.com/rails/rails)
|
36
|
+
|
37
|
+
We encourage you to contribute to Ruby on Rails! Please check out the
|
38
|
+
[Contributing to Ruby on Rails guide](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html) for guidelines about how to proceed. [Join us!](http://contributors.rubyonrails.org)
|
39
|
+
|
40
|
+
Trying to report a possible security vulnerability in Rails? Please
|
41
|
+
check out our [security policy](http://rubyonrails.org/security/) for
|
42
|
+
guidelines about how to proceed.
|
43
|
+
|
44
|
+
Everyone interacting in Rails and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the Rails [code of conduct](http://rubyonrails.org/conduct/).
|
45
|
+
|
46
|
+
## Code Status
|
47
|
+
|
48
|
+
[](https://travis-ci.org/rails/rails)
|
49
|
+
|
50
|
+
## License
|
51
|
+
|
52
|
+
Ruby on Rails is released under the [MIT License](http://www.opensource.org/licenses/MIT).
|
data/bmi.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
class Bmi
|
2
|
+
def self.calc(*args)
|
3
|
+
case args.size
|
4
|
+
when 2
|
5
|
+
htc=args[0]
|
6
|
+
kg=args[1]
|
7
|
+
m=htc.to_f/100
|
8
|
+
h2=m.to_f*m
|
9
|
+
bmi=kg.to_f/h2
|
10
|
+
f_bmi = bmi.floor
|
11
|
+
diff=bmi.to_f-f_bmi.to_f
|
12
|
+
diff=diff.to_f*10
|
13
|
+
diff=diff.round
|
14
|
+
if (diff == 10)
|
15
|
+
#Need to bump up the whole thing instead
|
16
|
+
f_bmi += 1;
|
17
|
+
diff = 0;
|
18
|
+
end
|
19
|
+
bmi = f_bmi + diff.to_f/10;
|
20
|
+
when 3
|
21
|
+
w=args[0]
|
22
|
+
v=args[1]
|
23
|
+
u=args[2]
|
24
|
+
i = (v.to_f * 12).to_i + u.to_f;
|
25
|
+
ins=i
|
26
|
+
lbs=w
|
27
|
+
h2=ins.to_f*ins.to_f
|
28
|
+
bmi=(lbs.to_f/h2)*703
|
29
|
+
f_bmi=bmi.floor
|
30
|
+
diff=bmi-f_bmi
|
31
|
+
diff=diff*10
|
32
|
+
diff=diff.round
|
33
|
+
if (diff == 10) # Need to bump up the whole thing instead
|
34
|
+
|
35
|
+
f_bmi += 1;
|
36
|
+
diff = 0;
|
37
|
+
end
|
38
|
+
bmi = f_bmi + diff.to_f/10;
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: BmiCalculator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 11.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Milton Yukio
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-04-28 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: 'Índice de massa corporal, IMC, ou ingles: BMI'
|
14
|
+
email: miltonyukio2@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- README.md
|
20
|
+
- bmi.rb
|
21
|
+
homepage: http://rubygems.org/gems/bmiCalculator
|
22
|
+
licenses:
|
23
|
+
- MIT
|
24
|
+
metadata: {}
|
25
|
+
post_install_message:
|
26
|
+
rdoc_options: []
|
27
|
+
require_paths:
|
28
|
+
- lib
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
requirements: []
|
40
|
+
rubyforge_project:
|
41
|
+
rubygems_version: 2.6.8
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: bmi!
|
45
|
+
test_files: []
|