depreciationCalculator 0.1.0 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a3fc43c60817ce1baa99bd7319a8f0b35fe1707
4
- data.tar.gz: 4df873a9216fcd9497c2e13a3517ccb50ef118da
3
+ metadata.gz: b9ef56667168e95589804af715548371beca9a14
4
+ data.tar.gz: 571174df7fc92f166646d025de7d0e385cb21263
5
5
  SHA512:
6
- metadata.gz: 4d404853a93c43031bf25ed9c74152c04fa422e1d5583b74454689a8263460f75b1eac031f50f880e9fcec4cb16baf733f6f93ebc268993da32ff67b77ceb006
7
- data.tar.gz: 8cf3f0555fb314f6461336acf719f7a1cc4535cc41a8f52ea5721f0e8ee1a1b2769668e8cad5cd3baecfb3361899bfabcd03d39ec8f6b636e4e2900d81598bcb
6
+ metadata.gz: 0b7299600f93a240483f96be7498ea1ecdf450d9297cbdab41b08a35b288f5482257780cc70a43c5b392de8ca1aa2a47d75c1c60c6f08e86f017779c494ca10f
7
+ data.tar.gz: 363b8712c106cb9f82bc215239219c3939d9332b5313a9967e547b4ba5ffbd588d8cfd0c1321c33c49061f082bc428edc6d1aa3887d739256332b42207f38308
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ *.gem
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 depreciationCalculator.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,20 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ depreciationCalculator (0.1.1)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ rake (10.5.0)
10
+
11
+ PLATFORMS
12
+ x86-mingw32
13
+
14
+ DEPENDENCIES
15
+ bundler (~> 1.16)
16
+ depreciationCalculator!
17
+ rake (~> 10.0)
18
+
19
+ BUNDLED WITH
20
+ 1.16.1
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 DESKTOP-83C18M7\Mukul Gopinath
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # DepreciationCalculator
2
+
3
+ ## Installation
4
+
5
+ Add this line to your application's Gemfile:
6
+
7
+ ```ruby
8
+ gem 'depreciationCalculator'
9
+ ```
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install depreciationCalculator
18
+
19
+ ## Usage
20
+
21
+ @carDetails = '{"age":5, "mileage":5, "tyre":2, "owner":2, "price": 40000}'
22
+ age 5 years
23
+ mileage 5 (x 10000kms)
24
+ tyre condition (0-good., 1-average, 2-bad)
25
+ owner count - (0 to 4+)
26
+ price - Actual cost of new car
27
+
28
+ DepreciationCalculator.calculateDepreciatedValue(carDetails) #21900
29
+
30
+ ## Development
31
+
32
+ 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.
33
+
34
+ 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).
35
+
36
+ ## Contributing
37
+
38
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/depreciationCalculator.
39
+
40
+ ## License
41
+
42
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
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 "depreciationCalculator"
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,25 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "depreciationCalculator/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "depreciationCalculator"
8
+ spec.version = DepreciationCalculator::VERSION
9
+ spec.authors = ["Mukul Gopinath"]
10
+ spec.email = ["x17123739@student.ncirl.ie"]
11
+
12
+ spec.summary = %q{Calculate the depreciated value of the car based on the parameter}
13
+ spec.homepage = "https://github.com/x17123739/depreciationCalculator"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.16"
24
+ spec.add_development_dependency "rake", "~> 10.0"
25
+ end
@@ -0,0 +1,12 @@
1
+ require "depreciationCalculator/version"
2
+
3
+ module DepreciationCalculator
4
+ def self.calculateDepreciatedValue(carDetails)
5
+ age_dep = [100,75,65,60,50,45,35,28,22,20,18,15,12,10,8,8,7,7,6,6,5]
6
+ kms_dep = [100,80,75,70,67,65,60,55,53,50,48,44,40,36,34,30,28,26,24,22,20,19,18,17,16,15,14,13,12,11,10]
7
+ tyre_cond = [100,60,30]
8
+ owners = [100,80,75,70,65]
9
+ @estimated_value = ((age_dep[carDetails['age']] * 0.5) + (kms_dep[carDetails['mileage']] * 0.3) + (tyre_cond[carDetails['tyre']] * 0.05) + (owners[carDetails['owner']] * 0.15)) * carDetails['price'] /100
10
+ return @estimated_value
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ module DepreciationCalculator
2
+ VERSION = "0.1.1"
3
+ end
metadata CHANGED
@@ -1,23 +1,64 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: depreciationCalculator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mukul Gopinath
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-21 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Estimate the price of the used car based on the condition
14
- email: x17123739@student.ncirl.ie
11
+ date: 2018-04-22 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.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
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:
42
+ email:
43
+ - x17123739@student.ncirl.ie
15
44
  executables: []
16
45
  extensions: []
17
46
  extra_rdoc_files: []
18
- files: []
19
- homepage: http://rubygems.org/gems/depreciation
20
- licenses: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/console
55
+ - bin/setup
56
+ - depreciationCalculator.gemspec
57
+ - lib/depreciationCalculator.rb
58
+ - lib/depreciationCalculator/version.rb
59
+ homepage: https://github.com/x17123739/depreciationCalculator
60
+ licenses:
61
+ - MIT
21
62
  metadata: {}
22
63
  post_install_message:
23
64
  rdoc_options: []
@@ -38,5 +79,5 @@ rubyforge_project:
38
79
  rubygems_version: 2.5.2
39
80
  signing_key:
40
81
  specification_version: 4
41
- summary: Calculate the depreciated value of the car based on the parameters
82
+ summary: Calculate the depreciated value of the car based on the parameter
42
83
  test_files: []