roi_calculator 0.1.5 → 0.3.2
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 +5 -5
- data/.ruby-gemset +1 -0
- data/lib/roi/rentability.rb +2 -2
- data/lib/roi/rentability_periods.rb +2 -2
- data/lib/roi/version.rb +1 -1
- data/roi_calculator.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 2928abf9c33dd3a784c8e27343271293d13422d78ab2e2f154b74c4b5e65b408
|
|
4
|
+
data.tar.gz: 5095434c72d10e868a39611cf6f87e9000d06a568b242ee05f5b6c9b1211ae27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a05ffaf084494ed374380bd456f7697924fd660ac28030807f1080dca451ad52eb69b2933ced69b2adb09bafe81557e2d1e3f67fa6838bc00e734505c5e152b5
|
|
7
|
+
data.tar.gz: d6c47125bebbd9bb8ea01e1fe7f97b6d403ad973679693d79db125ad250b3a8580ce599b06ec8355ba89ca5f60f68df26995319c92d9662288a37022190d3f92
|
data/.ruby-gemset
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bigbang_services
|
data/lib/roi/rentability.rb
CHANGED
|
@@ -13,7 +13,7 @@ module ROI
|
|
|
13
13
|
attr_reader :id, :start_date, :end_date, :skip_on_gap
|
|
14
14
|
|
|
15
15
|
def initialize(options)
|
|
16
|
-
@id = options[:id]
|
|
16
|
+
@id = options[:id].try(:to_i)
|
|
17
17
|
@start_date = options[:start_date]
|
|
18
18
|
@end_date = options[:end_date] || Date.today - 1
|
|
19
19
|
@skip_on_gap = false
|
|
@@ -71,7 +71,7 @@ module ROI
|
|
|
71
71
|
def to_a
|
|
72
72
|
dates_with_position.map do |date|
|
|
73
73
|
if @rentabilities[date]
|
|
74
|
-
[date.
|
|
74
|
+
[date.strftime('%Y-%m-%d'), @rentabilities[date].share]
|
|
75
75
|
end
|
|
76
76
|
end.compact
|
|
77
77
|
end
|
|
@@ -13,8 +13,8 @@ module ROI
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def months(amount, date = end_date)
|
|
16
|
-
scoped_start = WorkDay.last_until((date - amount.month).end_of_month)
|
|
17
|
-
scoped_end = adjust_end_date(date)
|
|
16
|
+
scoped_start = WorkDay.last_until((date - (amount+1).month).end_of_month)
|
|
17
|
+
scoped_end = adjust_end_date((date - 1.month).end_of_month)
|
|
18
18
|
check_gaps_and_format(scoped_start, scoped_end)
|
|
19
19
|
end
|
|
20
20
|
|
data/lib/roi/version.rb
CHANGED
data/roi_calculator.gemspec
CHANGED
|
@@ -21,5 +21,5 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
22
22
|
spec.add_runtime_dependency "memoist", "~> 0.15"
|
|
23
23
|
spec.add_runtime_dependency "math_util", "~> 0.1.0"
|
|
24
|
-
spec.add_runtime_dependency "work_day", "~> 0.
|
|
24
|
+
spec.add_runtime_dependency "work_day", "~> 1.0.0"
|
|
25
25
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: roi_calculator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adriano Bacha
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -72,14 +72,14 @@ dependencies:
|
|
|
72
72
|
requirements:
|
|
73
73
|
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 0.
|
|
75
|
+
version: 1.0.0
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
80
|
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 0.
|
|
82
|
+
version: 1.0.0
|
|
83
83
|
description:
|
|
84
84
|
email:
|
|
85
85
|
- abacha@gmail.com
|
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
|
89
89
|
files:
|
|
90
90
|
- ".gitignore"
|
|
91
91
|
- ".rspec"
|
|
92
|
+
- ".ruby-gemset"
|
|
92
93
|
- ".ruby-version"
|
|
93
94
|
- ".travis.yml"
|
|
94
95
|
- Gemfile
|
|
@@ -122,8 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
122
123
|
- !ruby/object:Gem::Version
|
|
123
124
|
version: '0'
|
|
124
125
|
requirements: []
|
|
125
|
-
|
|
126
|
-
rubygems_version: 2.6.10
|
|
126
|
+
rubygems_version: 3.0.8
|
|
127
127
|
signing_key:
|
|
128
128
|
specification_version: 4
|
|
129
129
|
summary: Rentability and financial calculations
|