mycoins 0.2.7 → 0.2.8

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: b8c33d039b936cfe61a4e29a73747d922f97947a
4
- data.tar.gz: 1b302ae8333e53073695606e24194e000fa943c7
3
+ metadata.gz: 0de68ec33574a524691136fb578f4cbb1fb6da40
4
+ data.tar.gz: 76d834c23b04e3684fd97ea251b62aadc1aaaa35
5
5
  SHA512:
6
- metadata.gz: e0511114a5f1f14f5e3bc4fa3c0382a04cdc41c74704f6d62f135b4bbe0fc5afbe11f5f110337f4d46560185cdf47c127888020a747522a0c2551d1b625d7ce4
7
- data.tar.gz: e30fd3f9cabb2ae49b12c6a7fd1cf5138139191f9ff54114caf261f4f9b805e87bb72042039b950866577365424803c93b4934bf851b87f570501e8e5cb3a6bf
6
+ metadata.gz: 77284f5d25b3086518f58dac39d3600d45e904145fc24c06ded0f8202123cd54c8673f0886055927f946a4283f0b034df937c2112a9730afd69994575516e578
7
+ data.tar.gz: '04085ac00af0dcb7244c5a6b053cbf91f7dd96abc77fb309fbda9817188072f00fd32f1388fcfc84c25348b9b0da3f6de4d3a049e61afe0d33b2d31fda5f4513'
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -122,9 +122,9 @@ class MyCoins
122
122
  a = build_records()
123
123
 
124
124
  invested = sum(a, :paid)
125
- gross_profit_list, losses_list = a.partition {|x| x[:profit].to_f > 0}
125
+ gross_profit_list, losses_list = a.partition {|x| x[:roi].to_f > 0}
126
126
  gross_profit, losses = [gross_profit_list, losses_list]\
127
- .map{|x| sum(x, :profit)}
127
+ .map{|x| sum(x, :roi)}
128
128
  pct_gross_profit = (100 / (invested / gross_profit)).round(2)
129
129
  pct_losses = (100 / (invested / losses)).round(2)
130
130
 
@@ -138,7 +138,7 @@ class MyCoins
138
138
  gross_profit: gross_profit.round(2), losses: losses.round(2),
139
139
  pct_gross_profit: pct_gross_profit,
140
140
  pct_losses: pct_losses,
141
- net_profit: sum(a, :profit).round(2),
141
+ net_profit: sum(a, :roi).round(2),
142
142
  pct_net_profit: pct_gross_profit + pct_losses
143
143
  }
144
144
 
@@ -189,8 +189,8 @@ class MyCoins
189
189
  value = (local_value || value_usd)
190
190
 
191
191
  h2 = {
192
- profit: "%.2f" % (value - paid).round(2),
193
- pct_profit: "%.2f" % (((value - paid) / value) * 100).round(2)
192
+ roi: "%.2f" % (value - paid).round(2),
193
+ pct_roi: "%.2f" % (100 / (paid / (value - paid))).round(2)
194
194
  }
195
195
 
196
196
  r << h.merge!(h2)
@@ -244,7 +244,7 @@ class MyCoins
244
244
  labels = %w(Name Rank Qty btc_price) \
245
245
  + ["paid(#{@mycurrency}):", 'value(USD):']
246
246
  labels << "value(#{@mycurrency}):" if @mycurrency
247
- labels += ['Profit:', 'Profit (%):']
247
+ labels += ['ROI:', 'ROI (%):']
248
248
 
249
249
  puts 'labels: ' + labels.inspect if @debug
250
250
 
@@ -267,4 +267,4 @@ class MyCoins
267
267
  a.inject(0) {|r, x| r + x[field].to_f }
268
268
  end
269
269
 
270
- end
270
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mycoins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -30,7 +30,7 @@ cert_chain:
30
30
  sCz5KsiHA9vj8OfrxhYrEb+ML4+J28Umdki7V1vgnQWmnI+Ok2SWlkScgzcmGXF6
31
31
  TJ4=
32
32
  -----END CERTIFICATE-----
33
- date: 2018-01-16 00:00:00.000000000 Z
33
+ date: 2018-02-10 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: dynarex
@@ -41,7 +41,7 @@ dependencies:
41
41
  version: '1.7'
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- version: 1.7.27
44
+ version: 1.7.28
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
@@ -51,7 +51,7 @@ dependencies:
51
51
  version: '1.7'
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.7.27
54
+ version: 1.7.28
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: justexchangerates
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -78,20 +78,20 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.2'
81
+ version: '0.3'
82
82
  - - ">="
83
83
  - !ruby/object:Gem::Version
84
- version: 0.2.4
84
+ version: 0.3.4
85
85
  type: :runtime
86
86
  prerelease: false
87
87
  version_requirements: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: '0.2'
91
+ version: '0.3'
92
92
  - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: 0.2.4
94
+ version: 0.3.4
95
95
  description:
96
96
  email: james@jamesrobertson.eu
97
97
  executables: []
metadata.gz.sig CHANGED
Binary file