ExerciseAdvice 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 55638ce9cb39d6d42d3271d264b6ae2a94da00df2f1e11ec48afe6a6f7c2d603
4
+ data.tar.gz: 26e00526540584d9ab5fb40982bacecc39b6bba3883094e6956ce9457acd5405
5
+ SHA512:
6
+ metadata.gz: 1fe8b80f1b4e2d61c05de5410cb4257e7c4236a7d7412762fe05c261a685fe33387973c6740d464fac08c74be632eaea8b758cf71891622f2154e49b7d1016fb
7
+ data.tar.gz: 696183ea5452e221e3dae272848ca0d2c2e2f5510efa08354da804990b4481d937450f13751a2ae2bb48f257520e34504bfe2298863f746fc31f60972c6c8bba
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
@@ -0,0 +1,41 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "ExerciseAdvice/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "ExerciseAdvice"
8
+ spec.version = ExerciseAdvice::VERSION
9
+ spec.authors = ["hiteshw"]
10
+ spec.email = ["hiteshwadhwa95@gmail.com"]
11
+
12
+ spec.summary = %q{This gem can be used to determine appropriate exercise as per weight range.}
13
+ spec.description = %q{ This gem takes the weight status of the user whether if he or she is underweight, normal weight, overweight or obese and advices them exercises.}
14
+ spec.homepage = ""
15
+ spec.license ="MIT"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org/"
21
+
22
+ #spec.metadata["homepage_uri"] = spec.homepage
23
+ #spec.metadata["source_code_uri"] = "There is no URL."
24
+ #spec.metadata["changelog_uri"] = "Put your gem's CHANGELOG.md URL here."
25
+ else
26
+ raise "RubyGems 2.0 or newer is required to protect against " \
27
+ "public gem pushes."
28
+ end
29
+
30
+ # Specify which files should be added to the gem when it is released.
31
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
32
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
33
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
34
+ end
35
+ spec.bindir = "exe"
36
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
+ spec.require_paths = ["lib"]
38
+
39
+ spec.add_development_dependency "bundler", "~> 1.17"
40
+ spec.add_development_dependency "rake", "~> 10.0"
41
+ end
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in ExerciseAdvice.gemspec
6
+ gemspec
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # ExerciseAdvice
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ExerciseAdvice`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'ExerciseAdvice'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install ExerciseAdvice
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ExerciseAdvice.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ExerciseAdvice"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,112 @@
1
+ require "ExerciseAdvice/version"
2
+
3
+ module ExerciseAdvice
4
+ class Error < StandardError; end
5
+ # Your code goes here...
6
+
7
+
8
+ def self.exercise(weightstatus,preference)
9
+ if weightstatus == "underweight" && preference == "cardio"
10
+ cardio="walking",
11
+ cardiotime=45,
12
+ weights="leg press",
13
+ weightstime=30,
14
+ streching="yoga",
15
+ streching_time=30
16
+
17
+ elsif weightstatus == "underweight" && preference == "weights"
18
+ cardio="walking",
19
+ cardiotime=30,
20
+ weights="leg press",
21
+ weightstime=45,
22
+ streching="yoga",
23
+ strechingtime=30
24
+
25
+ elsif weightstatus == "underweight" && preference == "streching"
26
+ cardio="walking",
27
+ cardiotime=30,
28
+ weights="leg press",
29
+ weightstime=30,
30
+ streching="yoga",
31
+ strechingtime=45
32
+
33
+
34
+ elsif weightstatus == "Normal weight" && preference =="cardio"
35
+ cardio="walking",
36
+ cardiotime=45,
37
+ streching="crunches",
38
+ strechingtime=15,
39
+ weights="leg press",
40
+ weightstime=15
41
+
42
+ elsif weightstatus == "Normal weight" && preference =="streching"
43
+ cardio="walking",
44
+ cardiotime=15,
45
+ streching="crunches",
46
+ strechingtime=45,
47
+ weights="leg press",
48
+ weightstime=15
49
+
50
+
51
+ elsif weightstatus == "Normal weight" && preference =="weights"
52
+ cardio="walking",
53
+ cardiotime=15,
54
+ streching="crunches",
55
+ strechingtime=15,
56
+ weights="leg press",
57
+ weightstime=45
58
+
59
+
60
+ elsif weightstatus == "Over weight" && preference =="cardio"
61
+ cardio="walking",
62
+ cardiotime=45,
63
+ streching="yoga",
64
+ strechingtime=30,
65
+ weights="dead lifts",
66
+ weightstime=30
67
+
68
+ elsif weightstatus == "Over weight" && preference=="streching"
69
+ cardio="walking",
70
+ cardiotime=30,
71
+ streching="yoga",
72
+ strechingtime=45,
73
+ weights="dead lifts",
74
+ weightstime=30
75
+
76
+ elsif weightstatus == "Over weight" && preference=="weights"
77
+ cardio="walking",
78
+ cardiotime=45,
79
+ streching="yoga",
80
+ strechingtime=30,
81
+ weights="dead lifts",
82
+ weightstime=45
83
+
84
+
85
+ elsif weightstatus == "Obese" && preference=="cardio"
86
+ cardio="walking",
87
+ cardiotime=60,
88
+ streching="yoga",
89
+ strechingtime=45,
90
+ weights="military press",
91
+ weightstime=45
92
+
93
+ elsif weightstatus == "Obese" && preference=="streching"
94
+ cardio="walking",
95
+ cardiotime=45,
96
+ streching="yoga",
97
+ strechingtime=60,
98
+ weights="military press",
99
+ weightstime=45
100
+
101
+ elsif weightstatus == "Obese" && preference=="weights"
102
+ cardio="walking",
103
+ cardiotime=45,
104
+ streching="yoga",
105
+ strechingtime=45,
106
+ weights="military press",
107
+ weightstime=60
108
+
109
+ end
110
+ end
111
+
112
+ end
@@ -0,0 +1,3 @@
1
+ module ExerciseAdvice
2
+ VERSION = "0.3.0"
3
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ExerciseAdvice
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ platform: ruby
6
+ authors:
7
+ - hiteshw
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-12-09 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.17'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.17'
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: " This gem takes the weight status of the user whether if he or she is
42
+ underweight, normal weight, overweight or obese and advices them exercises."
43
+ email:
44
+ - hiteshwadhwa95@gmail.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - ExerciseAdvice.gemspec
51
+ - Gemfile
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - lib/ExerciseAdvice.rb
57
+ - lib/ExerciseAdvice/version.rb
58
+ homepage: ''
59
+ licenses:
60
+ - MIT
61
+ metadata:
62
+ allowed_push_host: https://rubygems.org/
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.7.8
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: This gem can be used to determine appropriate exercise as per weight range.
83
+ test_files: []