target_weight 0.0.5 → 0.0.6
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.
- data/.idea/target_weight.iml +5 -0
- data/Gemfile +2 -0
- data/README.md +5 -2
- data/Rakefile +2 -0
- data/lib/target_weight.rb +37 -29
- data/lib/target_weight/version.rb +1 -1
- data/target_weight.gemspec +1 -1
- metadata +2 -2
data/.idea/target_weight.iml
CHANGED
@@ -5,6 +5,11 @@
|
|
5
5
|
<orderEntry type="inheritedJdk" />
|
6
6
|
<orderEntry type="sourceFolder" forTests="false" />
|
7
7
|
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.1.3, RVM: ruby-1.9.3-p125) [gem]" level="application" />
|
8
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.1.3, RVM: ruby-1.9.3-p125) [gem]" level="application" />
|
9
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v2.11.0, RVM: ruby-1.9.3-p125) [gem]" level="application" />
|
10
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v2.11.1, RVM: ruby-1.9.3-p125) [gem]" level="application" />
|
11
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v2.11.3, RVM: ruby-1.9.3-p125) [gem]" level="application" />
|
12
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v2.11.3, RVM: ruby-1.9.3-p125) [gem]" level="application" />
|
8
13
|
</component>
|
9
14
|
</module>
|
10
15
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# TargetWeight
|
2
2
|
|
3
|
-
TODO:
|
3
|
+
TODO: This gem will take your sex, height, and determine your target
|
4
|
+
weight and based on this information calculate how far you're off
|
5
|
+
your target
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -18,7 +20,8 @@ Or install it yourself as:
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
TODO:
|
23
|
+
TODO: Please enter your name, height in inches, weight in integer, and sex in M/F when instantiating the class
|
24
|
+
|
22
25
|
|
23
26
|
## Contributing
|
24
27
|
|
data/Rakefile
CHANGED
data/lib/target_weight.rb
CHANGED
@@ -2,46 +2,54 @@ require "target_weight/version"
|
|
2
2
|
|
3
3
|
class TargetWeight
|
4
4
|
#class CalcWeight
|
5
|
-
|
5
|
+
# Base height for both sex is 5ft == 60inches
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
#Target Weight Formula for Male
|
8
|
+
# 110.23lbs + 5.07058lbs * additional inches above base of 60 inches (5ft)
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
#Target Weight Formula for Female
|
11
|
+
# 100.31lbs + 5.07058lbs * additional inches above base of 60 inches (5ft)
|
12
12
|
|
13
|
-
|
13
|
+
attr_accessor :name, :height, :weight, :sex
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
def initialize(name, height, weight, sex)
|
16
|
+
@name = name
|
17
|
+
@height = height
|
18
|
+
@weight = weight
|
19
|
+
@sex = sex
|
20
|
+
end
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
def greetings
|
23
|
+
"Hi #{name}"
|
24
|
+
#puts = "Please enter your name"
|
25
|
+
#@name = gets.chomp
|
26
|
+
end
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
#def height
|
29
|
+
#puts = "Please enter your height in inches (i.e. 5ft = 60inches)"
|
30
|
+
#@height = gets.chomp
|
31
|
+
# end
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
33
|
+
#def weight
|
34
|
+
# puts = "Please enter your weight in lbs with out symbol (i.e. 150, 160)"
|
35
|
+
#@weight = gets.chomp
|
36
|
+
#end
|
37
|
+
|
38
|
+
#def sex
|
39
|
+
#puts = "Please enter your sex (M/F)"
|
40
|
+
#@sex = gets.chomp
|
41
|
+
#end
|
34
42
|
|
35
43
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
44
|
+
def user_weight()
|
45
|
+
if sex == "M"
|
46
|
+
target = 110.23 +(5.0705 *((@height.to_i) - 60))
|
47
|
+
"Your weight is #{@weight.to_i - target}lbs from your target of #{target}lbs"
|
48
|
+
else
|
41
49
|
target = 100.31 +(5.0705 *((@height.to_i) - 60))
|
42
|
-
|
43
|
-
end
|
50
|
+
"Your weight is #{@weight.to_i - target}lbs from your target of #{target}lbs"
|
44
51
|
end
|
52
|
+
end
|
45
53
|
|
46
54
|
#end
|
47
55
|
end
|
data/target_weight.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
|
|
10
10
|
gem.email = ["mick26soum@gmail.com"]
|
11
11
|
gem.description = %q{Enter height, weight, sex to calculate IBW}
|
12
12
|
gem.summary = %q{Target Weight Calculator}
|
13
|
-
gem.homepage = ""
|
13
|
+
gem.homepage = "http://rubylearning.org"
|
14
14
|
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: target_weight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -33,7 +33,7 @@ files:
|
|
33
33
|
- lib/target_weight.rb
|
34
34
|
- lib/target_weight/version.rb
|
35
35
|
- target_weight.gemspec
|
36
|
-
homepage:
|
36
|
+
homepage: http://rubylearning.org
|
37
37
|
licenses: []
|
38
38
|
post_install_message:
|
39
39
|
rdoc_options: []
|