mycoins 0.3.8 → 0.3.9
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/mycoins.rb +11 -8
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8c3b6ad517346a66eb22247c7f58416d7f06474
|
|
4
|
+
data.tar.gz: 8c5cd9e4c74a34d5979b4445318be350431079b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8409b53528a443585d7b151413a458e91b551dc24b65badb0d5879f4dced906318dc7fb75418357de73497061dc6f14245471cb3d0eed38675c63c31d33bd6b
|
|
7
|
+
data.tar.gz: 1ed009d0dd7a3d034d7dba75de76de55a9411a713798be3977a6c432af369ab9d4b78dc0661e0601366bf17af517e241a2312ec883b91db9564667a212ba3328
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/mycoins.rb
CHANGED
|
@@ -12,12 +12,14 @@ class MyCoins
|
|
|
12
12
|
attr_reader :ccf
|
|
13
13
|
attr_accessor :mycurrency
|
|
14
14
|
|
|
15
|
-
def initialize(source, date: nil, debug: false,
|
|
16
|
-
|
|
15
|
+
def initialize(source, date: nil, debug: false, mycurrency: 'USD',
|
|
16
|
+
filepath: 'mycoins', colored: true, exchangerate_key: nil)
|
|
17
17
|
|
|
18
18
|
@debug, @filepath, @colored = debug, filepath, colored
|
|
19
|
+
@exchangerate_key = exchangerate_key
|
|
19
20
|
|
|
20
|
-
@jer = JustExchangeRates.new(base: 'USD'
|
|
21
|
+
@jer = JustExchangeRates.new(base: 'USD', debug: @debug,
|
|
22
|
+
app_id: exchangerate_key)
|
|
21
23
|
|
|
22
24
|
s = RXFHelper.read(source).first
|
|
23
25
|
|
|
@@ -58,7 +60,8 @@ class MyCoins
|
|
|
58
60
|
mycoins = h.values
|
|
59
61
|
|
|
60
62
|
puts 'mycoins: ' + mycoins.inspect if @debug
|
|
61
|
-
@ccf = CryptocoinFanboi.new(watch: mycoins, debug: debug
|
|
63
|
+
@ccf = CryptocoinFanboi.new(watch: mycoins, debug: debug,
|
|
64
|
+
exchangerate_key: exchangerate_key)
|
|
62
65
|
|
|
63
66
|
end
|
|
64
67
|
|
|
@@ -137,8 +140,8 @@ class MyCoins
|
|
|
137
140
|
|
|
138
141
|
end
|
|
139
142
|
|
|
140
|
-
# returns a Hash object containing the value as well as the percentage
|
|
141
|
-
# total value of the portfolio for each cryptocurrency
|
|
143
|
+
# returns a Hash object containing the value as well as the percentage
|
|
144
|
+
# relative to the total value of the portfolio for each cryptocurrency
|
|
142
145
|
#
|
|
143
146
|
def to_values()
|
|
144
147
|
|
|
@@ -175,7 +178,7 @@ class MyCoins
|
|
|
175
178
|
pct_gross_profit = (100 / (invested / gross_profit)).round(2)
|
|
176
179
|
pct_losses = (100 / (invested / losses)).round(2)
|
|
177
180
|
total_value = sum(a, ('value_' + @mycurrency.downcase).to_sym)
|
|
178
|
-
rate = JustExchangeRates.new(base: 'GBP').rate('USD')
|
|
181
|
+
rate = JustExchangeRates.new(base: 'GBP', app_id: @exchangerate_key).rate('USD')
|
|
179
182
|
|
|
180
183
|
btc = @ccf.price('bitcoin')
|
|
181
184
|
|
|
@@ -276,7 +279,7 @@ class MyCoins
|
|
|
276
279
|
|
|
277
280
|
def fetch_symbols(coin_names)
|
|
278
281
|
|
|
279
|
-
c = CryptocoinFanboi.new
|
|
282
|
+
c = CryptocoinFanboi.new debug: @debug
|
|
280
283
|
|
|
281
284
|
h = coin_names.inject({}) do |r, name|
|
|
282
285
|
|
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.3.
|
|
4
|
+
version: 0.3.9
|
|
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-
|
|
33
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
|
34
34
|
dependencies:
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: dynarex
|
|
@@ -61,7 +61,7 @@ dependencies:
|
|
|
61
61
|
version: '0.5'
|
|
62
62
|
- - ">="
|
|
63
63
|
- !ruby/object:Gem::Version
|
|
64
|
-
version: 0.5.
|
|
64
|
+
version: 0.5.5
|
|
65
65
|
type: :runtime
|
|
66
66
|
prerelease: false
|
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -71,7 +71,7 @@ dependencies:
|
|
|
71
71
|
version: '0.5'
|
|
72
72
|
- - ">="
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: 0.5.
|
|
74
|
+
version: 0.5.5
|
|
75
75
|
description:
|
|
76
76
|
email: james@jamesrobertson.eu
|
|
77
77
|
executables: []
|
metadata.gz.sig
CHANGED
|
Binary file
|