target_weight 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in target_weight.gemspec
4
+
4
5
  gemspec
6
+ gem 'rspec'
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # TargetWeight
2
2
 
3
- TODO: Write a gem description
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: Write usage instructions here
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
@@ -1 +1,3 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+ RSpec::Core::RakeTask.new('spec')
@@ -2,46 +2,54 @@ require "target_weight/version"
2
2
 
3
3
  class TargetWeight
4
4
  #class CalcWeight
5
- # Base height for both sex is 5ft == 60inches
5
+ # Base height for both sex is 5ft == 60inches
6
6
 
7
- #Target Weight Formula for Male
8
- # 110.23lbs + 5.07058lbs * additional inches above base of 60 inches (5ft)
7
+ #Target Weight Formula for Male
8
+ # 110.23lbs + 5.07058lbs * additional inches above base of 60 inches (5ft)
9
9
 
10
- #Target Weight Formula for Female
11
- # 100.31lbs + 5.07058lbs * additional inches above base of 60 inches (5ft)
10
+ #Target Weight Formula for Female
11
+ # 100.31lbs + 5.07058lbs * additional inches above base of 60 inches (5ft)
12
12
 
13
- attr_accessor :name, :height, :weight, :sex
13
+ attr_accessor :name, :height, :weight, :sex
14
14
 
15
- def name
16
- puts = "Please enter your name"
17
- @name = gets.chomp
18
- end
15
+ def initialize(name, height, weight, sex)
16
+ @name = name
17
+ @height = height
18
+ @weight = weight
19
+ @sex = sex
20
+ end
19
21
 
20
- def height
21
- puts = "Please enter your height in inches (i.e. 5ft = 60inches)"
22
- @height = gets.chomp
23
- end
22
+ def greetings
23
+ "Hi #{name}"
24
+ #puts = "Please enter your name"
25
+ #@name = gets.chomp
26
+ end
24
27
 
25
- def weight
26
- puts = "Please enter your weight in lbs with out symbol (i.e. 150, 160)"
27
- @weight = gets.chomp
28
- end
28
+ #def height
29
+ #puts = "Please enter your height in inches (i.e. 5ft = 60inches)"
30
+ #@height = gets.chomp
31
+ # end
29
32
 
30
- def sex
31
- puts = "Please enter your sex (M/F)"
32
- @sex = gets.chomp
33
- end
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
- def user_weight()
37
- if sex == "M"
38
- target = 110.23 +(5.0705 *((@height.to_i) - 60))
39
- puts "Your weight is #{@weight.to_i - target}lbs from your target of #{target}lbs"
40
- else
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
- puts "Your weight is #{@weight.to_i - target}lbs from your target of #{target}lbs"
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
@@ -1,3 +1,3 @@
1
1
  module TargetWeight
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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.5
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: []