earned_value_calculator 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/.rubocop.yml +13 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +127 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/earned_value_calculator.gemspec +39 -0
- data/lib/earned_value_calculator/validator.rb +48 -0
- data/lib/earned_value_calculator/version.rb +5 -0
- data/lib/earned_value_calculator.rb +68 -0
- data/sig/earned_value_calculator.rbs +9 -0
- metadata +172 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 330504253931327d34a2e358c12a958680eec52b63ed6395eab5a9c532ec11ab
|
4
|
+
data.tar.gz: a8a3abfe8c1b4b0e0d0e20422128017cbcd12da31742c82f2de4979e96ce2d54
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dc26c4d2e667e13778163800fb59a61c80c3a303055284a993b16a0d180edf41da8a8b2c08a74fb69f6288fb5fbd15b609723482b772b38ce1a94514fb59a4ed
|
7
|
+
data.tar.gz: d3a96490d4bf0b9eb577d8457fa60c7d985dd14e8d05b089e2fc33a0bf5f81c016894b33def101333d0312e4e00b0f1d4166b752cb69182d21ff1f3733bda2a0
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
6
|
+
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
8
|
+
|
9
|
+
## Our Standards
|
10
|
+
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
12
|
+
|
13
|
+
* Demonstrating empathy and kindness toward other people
|
14
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
15
|
+
* Giving and gracefully accepting constructive feedback
|
16
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
17
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
18
|
+
|
19
|
+
Examples of unacceptable behavior include:
|
20
|
+
|
21
|
+
* The use of sexualized language or imagery, and sexual attention or
|
22
|
+
advances of any kind
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
24
|
+
* Public or private harassment
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
27
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
28
|
+
professional setting
|
29
|
+
|
30
|
+
## Enforcement Responsibilities
|
31
|
+
|
32
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
33
|
+
|
34
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
35
|
+
|
36
|
+
## Scope
|
37
|
+
|
38
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
39
|
+
|
40
|
+
## Enforcement
|
41
|
+
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at smapira@routeflags.com. All complaints will be reviewed and investigated promptly and fairly.
|
43
|
+
|
44
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
45
|
+
|
46
|
+
## Enforcement Guidelines
|
47
|
+
|
48
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
49
|
+
|
50
|
+
### 1. Correction
|
51
|
+
|
52
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
53
|
+
|
54
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
55
|
+
|
56
|
+
### 2. Warning
|
57
|
+
|
58
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
59
|
+
|
60
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
61
|
+
|
62
|
+
### 3. Temporary Ban
|
63
|
+
|
64
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
65
|
+
|
66
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
67
|
+
|
68
|
+
### 4. Permanent Ban
|
69
|
+
|
70
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
71
|
+
|
72
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
73
|
+
|
74
|
+
## Attribution
|
75
|
+
|
76
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
77
|
+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
78
|
+
|
79
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
80
|
+
|
81
|
+
[homepage]: https://www.contributor-covenant.org
|
82
|
+
|
83
|
+
For answers to common questions about this code of conduct, see the FAQ at
|
84
|
+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2022 smapira
|
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,127 @@
|
|
1
|
+
# EarnedValueCalculator
|
2
|
+
|
3
|
+
![Ruby](https://img.shields.io/badge/Ruby-CC342D?style=for-the-badge&logo=ruby&logoColor=white)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/earned_value_calculator.svg)](https://badge.fury.io/rb/earned_value_calculator)
|
5
|
+
![](https://ruby-gem-downloads-badge.herokuapp.com/earned_value_calculator)
|
6
|
+
[![Ruby Style Guide](https://img.shields.io/badge/code_style-rubocop-brightgreen.svg)](https://github.com/rubocop-hq/rubocop)
|
7
|
+
[![CircleCI](https://circleci.com/bb/routeflags/earned_value_calculator.svg?style=svg)](https://circleci.com/bb/routeflags/earned_value_calculator)
|
8
|
+
|
9
|
+
Calculates the earned value of a project to indicate a diagnosis result.
|
10
|
+
|
11
|
+
## What is Earned value management ?
|
12
|
+
|
13
|
+
Earned value management (EVM),is a project management technique for measuring project performance and progress in an objective manner from [Earned value management - Wikipedia](https://en.wikipedia.org/wiki/Earned_value_management).
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Add this line to your application's Gemfile:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'earned_value_calculator'
|
21
|
+
```
|
22
|
+
|
23
|
+
And then execute:
|
24
|
+
|
25
|
+
$ bundle install
|
26
|
+
|
27
|
+
Or install it yourself as:
|
28
|
+
|
29
|
+
$ gem install earned_value_calculator
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
Given a project parameters, the calculator output the earned value of the project.
|
34
|
+
Start date, end date, current date, budget, progress rate and actual total cost are required.
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
project = EarnedValueCalculator.call(Date.today - 3,
|
38
|
+
Date.today + 3,
|
39
|
+
Date.today,
|
40
|
+
100,
|
41
|
+
10,
|
42
|
+
10)
|
43
|
+
project.planned_value
|
44
|
+
#=> 50
|
45
|
+
```
|
46
|
+
|
47
|
+
### Features
|
48
|
+
|
49
|
+
Calculates these metrics of a project:
|
50
|
+
|
51
|
+
* earned_value
|
52
|
+
* planned_value
|
53
|
+
* schedule_variance
|
54
|
+
* actual_cost_variance
|
55
|
+
* cost_performance_index
|
56
|
+
* schedule_performance_index
|
57
|
+
|
58
|
+
#### earned_value (EV)
|
59
|
+
EV is calculated by multiplying %complete of each task (completed or in progress) by its planned value.
|
60
|
+
It is based on the formula:
|
61
|
+
|
62
|
+
<img src="https://latex.codecogs.com/svg.image?EV&space;=&space;\sum_{Start}^{Current}PV(Completed)" />
|
63
|
+
|
64
|
+
#### planned_value (PV)
|
65
|
+
|
66
|
+
#### schedule_variance (SV)
|
67
|
+
It is based on the formula:
|
68
|
+
|
69
|
+
SV = EV - PV
|
70
|
+
|
71
|
+
#### actual_cost_variance (CV)
|
72
|
+
It is based on the formula:
|
73
|
+
|
74
|
+
CV = EV - AC
|
75
|
+
|
76
|
+
#### cost_performance_index (CPI)
|
77
|
+
It is based on the formula:
|
78
|
+
|
79
|
+
CPI = EV ÷ AC
|
80
|
+
|
81
|
+
#### schedule_performance_index (SPI)
|
82
|
+
It is based on the formula:
|
83
|
+
|
84
|
+
SPI = EV ÷ PV
|
85
|
+
|
86
|
+
|
87
|
+
## Development
|
88
|
+
|
89
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
90
|
+
|
91
|
+
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).
|
92
|
+
|
93
|
+
### Test
|
94
|
+
|
95
|
+
```bash
|
96
|
+
rspec spec
|
97
|
+
```
|
98
|
+
|
99
|
+
## Contributing
|
100
|
+
|
101
|
+
Bug reports and pull requests are welcome on BitBucket at https://github.com/routeflags/earned_value_calculator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/routeflags/earned_value_calculator/blob/main/CODE_OF_CONDUCT.md).
|
102
|
+
|
103
|
+
## License
|
104
|
+
|
105
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
106
|
+
|
107
|
+
## Code of Conduct
|
108
|
+
|
109
|
+
Everyone interacting in the EarnedValueCalculator project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/routeflags/earned_value_calculator/blob/main/CODE_OF_CONDUCT.md).
|
110
|
+
|
111
|
+
|
112
|
+
## You may enjoy owning other libraries and my company.
|
113
|
+
|
114
|
+
* [routeflagsinc / jma — Bitbucket](https://bitbucket.org/routeflagsinc/jma/src/main/)
|
115
|
+
- for the Japan Meteorological Agency (気象庁) for searching new information simplifies.
|
116
|
+
* [smapira / punch_time — Bitbucket](https://bitbucket.org/smapira/punch_time/src/master/)
|
117
|
+
- Work time calculations using punch clock.
|
118
|
+
* [smapira / rspec-css — Bitbucket](https://bitbucket.org/smapira/rspec-css/src/master/)
|
119
|
+
- Record your test suite's computed CSS during future test runs for deterministic and accurate tests.
|
120
|
+
* [smapira/timeline_rails_helper: The TimelineRailsHelper provides a timeline_molecules_tag helper to draw a vertical time line usable with vanilla CSS.](https://github.com/smapira/timeline_rails_helper)
|
121
|
+
* [smapira/acts_as_tree_diagram: ActsAsTreeDiagram extends ActsAsTree to add simple function for draw tree diagram with html.](https://github.com/smapira/acts_as_tree_diagram)
|
122
|
+
* [株式会社旗指物](https://blog.routeflags.com/)
|
123
|
+
|
124
|
+
## Аcknowledgments
|
125
|
+
|
126
|
+
* [Earned value management - Wikipedia](https://en.wikipedia.org/wiki/Earned_value_management)
|
127
|
+
* [Online Equation Editor - standalone](https://www.codecogs.com/latex/eqneditor.php)
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "earned_value_calculator"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/earned_value_calculator/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "earned_value_calculator"
|
7
|
+
spec.version = EarnedValueCalculator::VERSION
|
8
|
+
spec.authors = ["smapira"]
|
9
|
+
spec.email = ["25024587+smapira@users.noreply.github.com"]
|
10
|
+
|
11
|
+
spec.summary = "Calculate the earned value of a project"
|
12
|
+
spec.description = "Calculate the earned value of a project"
|
13
|
+
spec.homepage = "https://bitbucket.org/smapira/earned_value_calculator"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.required_ruby_version = ">= 2.6.0"
|
16
|
+
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = "https://bitbucket.org/smapira/earned_value_calculator/commits/main"
|
19
|
+
spec.metadata["changelog_uri"] = "https://bitbucket.org/smapira/earned_value_calculator"
|
20
|
+
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
24
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
25
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
26
|
+
end
|
27
|
+
end
|
28
|
+
spec.bindir = "exe"
|
29
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ["lib"]
|
31
|
+
spec.add_runtime_dependency "activemodel"
|
32
|
+
spec.add_runtime_dependency "business_time"
|
33
|
+
spec.add_development_dependency "bundler"
|
34
|
+
spec.add_development_dependency "rake"
|
35
|
+
spec.add_development_dependency "rbs"
|
36
|
+
spec.add_development_dependency "rspec"
|
37
|
+
spec.add_development_dependency "rubocop"
|
38
|
+
spec.add_development_dependency "typeprof"
|
39
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "active_model"
|
5
|
+
|
6
|
+
module EarnedValueCalculator
|
7
|
+
class Validator
|
8
|
+
include ActiveModel::Validations
|
9
|
+
|
10
|
+
attr_accessor :start_date, :end_date, :current_date, :budget, :rate, :actual_cost
|
11
|
+
|
12
|
+
validates :start_date, presence: true
|
13
|
+
validates :end_date, presence: true
|
14
|
+
validates :current_date, presence: true
|
15
|
+
validates :budget, presence: true
|
16
|
+
validates :rate, presence: true
|
17
|
+
validates :actual_cost, presence: true
|
18
|
+
validate :un_permit_format
|
19
|
+
|
20
|
+
# @param [Date] start_date The project start date.
|
21
|
+
# @param [Date] end_date The project deadline.
|
22
|
+
# @param [Date] current_date The current date.
|
23
|
+
# @param [Integer] budget The Budget At Completion of the project.
|
24
|
+
# @param [Integer] rate The actual rate of progression.
|
25
|
+
# @param [Integer] actual_cost The actual full actual_cost of the project.
|
26
|
+
def initialize(start_date, end_date, current_date, budget, rate, actual_cost)
|
27
|
+
self.start_date = start_date
|
28
|
+
self.end_date = end_date
|
29
|
+
self.current_date = current_date
|
30
|
+
self.budget = budget
|
31
|
+
self.rate = rate
|
32
|
+
self.actual_cost = actual_cost
|
33
|
+
|
34
|
+
raise ArgumentError, errors.messages unless valid?
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def un_permit_format
|
40
|
+
%i[start_date end_date current_date].map do |x|
|
41
|
+
errors.add(x, "Allow only DateTime format") unless public_send(x).is_a?(Date)
|
42
|
+
end
|
43
|
+
%i[budget rate actual_cost].map do |x|
|
44
|
+
errors.add(x, "Allow only Integer format") unless public_send(x).is_a?(Integer)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "earned_value_calculator/version"
|
4
|
+
require_relative "earned_value_calculator/validator"
|
5
|
+
require "business_time"
|
6
|
+
|
7
|
+
##
|
8
|
+
# This module represents a project metric with Earned Value Management.
|
9
|
+
module EarnedValueCalculator
|
10
|
+
##
|
11
|
+
# This class calculates the earned value of a project.
|
12
|
+
class << self
|
13
|
+
include ActiveModel::Validations
|
14
|
+
|
15
|
+
attr_accessor :project_length,
|
16
|
+
:current_length,
|
17
|
+
:budget,
|
18
|
+
:rate,
|
19
|
+
:actual_cost,
|
20
|
+
# It is based on the formula:
|
21
|
+
# EV = BAC × Actual complete %
|
22
|
+
:earned_value,
|
23
|
+
# @return [Integer] The value.
|
24
|
+
# It is based on the formula:
|
25
|
+
# SV = EV - PV
|
26
|
+
:schedule_variance,
|
27
|
+
:planned_value,
|
28
|
+
# It is based on the formula:
|
29
|
+
# CV = EV - AC
|
30
|
+
:actual_cost_variance,
|
31
|
+
# It is based on the formula:
|
32
|
+
# CPI = EV ÷ AC
|
33
|
+
:cost_performance_index,
|
34
|
+
# It is based on the formula:
|
35
|
+
# SPI = EV ÷ PV
|
36
|
+
:schedule_performance_index
|
37
|
+
|
38
|
+
# @param [Date] start_date The project start date.
|
39
|
+
# @param [Date] end_date The project deadline.
|
40
|
+
# @param [Date] current_date The current date.
|
41
|
+
# @param [Integer] budget The Budget At Completion of the project.
|
42
|
+
# @param [Integer] rate The actual rate of progression.
|
43
|
+
# @param [Integer] actual_cost The actual full actual_cost of the project.
|
44
|
+
# @return [EarnedValueCalculator] The object.
|
45
|
+
def call(start_date, end_date, current_date, budget, rate, actual_cost)
|
46
|
+
validator = EarnedValueCalculator::Validator
|
47
|
+
.new(start_date, end_date, current_date, budget, rate, actual_cost)
|
48
|
+
raise ArgumentError, validator.errors.messages unless validator.valid?
|
49
|
+
|
50
|
+
@project_length = (start_date..end_date).select(&:workday?).size
|
51
|
+
@current_length = (start_date..current_date).select(&:workday?).size
|
52
|
+
@budget = budget
|
53
|
+
@rate = rate
|
54
|
+
@actual_cost = actual_cost
|
55
|
+
calculate_earned_values
|
56
|
+
self
|
57
|
+
end
|
58
|
+
|
59
|
+
def calculate_earned_values
|
60
|
+
@earned_value = (@budget * (@rate.to_f / 100)).to_i
|
61
|
+
@planned_value = (@budget * @current_length / @project_length.to_f).to_i
|
62
|
+
@schedule_variance = @planned_value - @earned_value
|
63
|
+
@actual_cost_variance = @actual_cost - @earned_value
|
64
|
+
@cost_performance_index = @earned_value.to_f / @actual_cost
|
65
|
+
@schedule_performance_index = @earned_value.to_f / @planned_value
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module EarnedValueCalculator
|
2
|
+
VERSION: String
|
3
|
+
attr_accessor project_length: Integer
|
4
|
+
attr_accessor current_length: Integer
|
5
|
+
attr_accessor budget: Integer
|
6
|
+
attr_accessor rate: Float
|
7
|
+
attr_accessor actual_cost: Integer
|
8
|
+
def call: (start_date: Date, end_date: Date, current_date: Date, budget: Integer, rate: Integer, actual_cost: Integer) -> EarnedValueCalculator
|
9
|
+
end
|
metadata
ADDED
@@ -0,0 +1,172 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: earned_value_calculator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- smapira
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-04-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activemodel
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: business_time
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rbs
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: typeprof
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: Calculate the earned value of a project
|
126
|
+
email:
|
127
|
+
- 25024587+smapira@users.noreply.github.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- ".rubocop.yml"
|
133
|
+
- CHANGELOG.md
|
134
|
+
- CODE_OF_CONDUCT.md
|
135
|
+
- Gemfile
|
136
|
+
- LICENSE.txt
|
137
|
+
- README.md
|
138
|
+
- Rakefile
|
139
|
+
- bin/console
|
140
|
+
- bin/setup
|
141
|
+
- earned_value_calculator.gemspec
|
142
|
+
- lib/earned_value_calculator.rb
|
143
|
+
- lib/earned_value_calculator/validator.rb
|
144
|
+
- lib/earned_value_calculator/version.rb
|
145
|
+
- sig/earned_value_calculator.rbs
|
146
|
+
homepage: https://bitbucket.org/smapira/earned_value_calculator
|
147
|
+
licenses:
|
148
|
+
- MIT
|
149
|
+
metadata:
|
150
|
+
homepage_uri: https://bitbucket.org/smapira/earned_value_calculator
|
151
|
+
source_code_uri: https://bitbucket.org/smapira/earned_value_calculator/commits/main
|
152
|
+
changelog_uri: https://bitbucket.org/smapira/earned_value_calculator
|
153
|
+
post_install_message:
|
154
|
+
rdoc_options: []
|
155
|
+
require_paths:
|
156
|
+
- lib
|
157
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: 2.6.0
|
162
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
requirements: []
|
168
|
+
rubygems_version: 3.3.3
|
169
|
+
signing_key:
|
170
|
+
specification_version: 4
|
171
|
+
summary: Calculate the earned value of a project
|
172
|
+
test_files: []
|