imc_zica 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +8 -0
- data/README.md +31 -0
- data/Rakefile +4 -0
- data/imc_zica.gemspec +31 -0
- data/lib/imc_zica/version.rb +5 -0
- data/lib/imc_zica.rb +19 -0
- data/sig/imc_zica.rbs +4 -0
- metadata +48 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3800710a3774260992d986a3886a1806574161a091b70a8101893c2e6458209a
|
4
|
+
data.tar.gz: 1302c1d9a4bcb0a563eea5d0a182ff6fc31336667ef1f87e811dd86a573e54a2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 975cac26f4b0f1ed4e0f9c77a9b3a7d8d983e51f03d34262e8d9d5a6b4c4e45440f9bf15df8b6fa86509fd563588e2f65c29b096a93e24da0ea99a4a7bd3bc2f
|
7
|
+
data.tar.gz: a7cf19d2bf3a92a0b368137ff94404842d4e3b0527428a52054ace8a81018e0966a167733015e86abff376d3b7f2d3c43bb39b1b212397db0b9691b424c45ac2
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# ImcZica
|
2
|
+
|
3
|
+
TODO: Delete this and the text below, and describe your gem
|
4
|
+
|
5
|
+
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/imc_zica`. To experiment with that code, run `bin/console` for an interactive prompt.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
10
|
+
|
11
|
+
Install the gem and add to the application's Gemfile by executing:
|
12
|
+
|
13
|
+
$ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
14
|
+
|
15
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
16
|
+
|
17
|
+
$ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Development
|
24
|
+
|
25
|
+
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.
|
26
|
+
|
27
|
+
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 the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
28
|
+
|
29
|
+
## Contributing
|
30
|
+
|
31
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/imc_zica.
|
data/Rakefile
ADDED
data/imc_zica.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/imc_zica/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "imc_zica"
|
7
|
+
spec.version = ImcZica::VERSION
|
8
|
+
spec.authors = ["IsaacZica"]
|
9
|
+
|
10
|
+
spec.summary = "Calculates the IMC of a person"
|
11
|
+
spec.description = "Calculates the IMC by passing the weight and height of a person"
|
12
|
+
spec.required_ruby_version = ">= 2.6.0"
|
13
|
+
|
14
|
+
|
15
|
+
# Specify which files should be added to the gem when it is released.
|
16
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
17
|
+
spec.files = Dir.chdir(__dir__) do
|
18
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
19
|
+
(File.expand_path(f) == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|circleci)|appveyor)})
|
20
|
+
end
|
21
|
+
end
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
# Uncomment to register a new dependency of your gem
|
27
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
28
|
+
|
29
|
+
# For more information and examples about making a new gem, check out our
|
30
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
31
|
+
end
|
data/lib/imc_zica.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "imc_zica/version"
|
4
|
+
|
5
|
+
module ImcZica
|
6
|
+
class Error < StandardError; end
|
7
|
+
# Your code goes here...
|
8
|
+
class Pessoa
|
9
|
+
def initialize(height, weight)
|
10
|
+
@height = height
|
11
|
+
@weight = weight
|
12
|
+
end
|
13
|
+
|
14
|
+
def imc
|
15
|
+
(@weight / (@height**2)).round(2)
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
data/sig/imc_zica.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: imc_zica
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- IsaacZica
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Calculates the IMC by passing the weight and height of a person
|
14
|
+
email:
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- Gemfile
|
20
|
+
- README.md
|
21
|
+
- Rakefile
|
22
|
+
- imc_zica.gemspec
|
23
|
+
- lib/imc_zica.rb
|
24
|
+
- lib/imc_zica/version.rb
|
25
|
+
- sig/imc_zica.rbs
|
26
|
+
homepage:
|
27
|
+
licenses: []
|
28
|
+
metadata: {}
|
29
|
+
post_install_message:
|
30
|
+
rdoc_options: []
|
31
|
+
require_paths:
|
32
|
+
- lib
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.6.0
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
requirements: []
|
44
|
+
rubygems_version: 3.4.7
|
45
|
+
signing_key:
|
46
|
+
specification_version: 4
|
47
|
+
summary: Calculates the IMC of a person
|
48
|
+
test_files: []
|