cryptocoin_fanboi 0.3.3 → 0.3.4
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/lib/cryptocoin_fanboi.rb +33 -9
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4d0586059b2ab0c8b0fa2abda300d833adb226b
|
4
|
+
data.tar.gz: 4b7ac8129600bfe1f177adf0553b0371184efbd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68790d09fe735761208287acec338c937a2aa2104f4de7e0630e96b6be2a241f1cc90876afd943c0c12fef7ee26e956ff4a3650c8f3a03e2ae10336224699f87
|
7
|
+
data.tar.gz: 20db6e780174264c57495341c5269a03a944293ef4d460c9f3d1c50f80d5644463c1b25ac11eab79cb7ca6352df29f2270a0a8c990132fdc82136d541f7731da
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/cryptocoin_fanboi.rb
CHANGED
@@ -63,6 +63,7 @@ class CryptocoinFanboi
|
|
63
63
|
# prices from the start of the year
|
64
64
|
|
65
65
|
cache_filename = File.join(@filepath, 'cryptocoin_fanboi.yaml')
|
66
|
+
puts 'cache_filename: ' + cache_filename.inspect if @debug
|
66
67
|
@historic_prices_file = File.join(@filepath, 'ccf_historic.yaml')
|
67
68
|
|
68
69
|
@history_prices = if File.exists? @historic_prices_file then
|
@@ -75,8 +76,12 @@ class CryptocoinFanboi
|
|
75
76
|
|
76
77
|
#load the file
|
77
78
|
h = Psych.load File.read(cache_filename)
|
78
|
-
|
79
|
-
|
79
|
+
|
80
|
+
if @debug then
|
81
|
+
puts 'h.key.first: ' + h.keys.first.inspect
|
82
|
+
puts '@year: ' + @year.inspect
|
83
|
+
end
|
84
|
+
|
80
85
|
@coin_prices = (h.keys.first == @year) ? h[@year] : \
|
81
86
|
fetch_year_start_prices(@all_coins)
|
82
87
|
|
@@ -182,7 +187,7 @@ class CryptocoinFanboi
|
|
182
187
|
def to_s(limit: 5, markdown: false)
|
183
188
|
|
184
189
|
coins = fetch_coinlist(limit: limit).map do |coin|
|
185
|
-
|
190
|
+
puts 'coin: ' + coin.inspect if @debug
|
186
191
|
@fields.map {|x| coin[x] }
|
187
192
|
|
188
193
|
end
|
@@ -197,10 +202,21 @@ class CryptocoinFanboi
|
|
197
202
|
|
198
203
|
def build_table(a, markdown: markdown, labels: @labels)
|
199
204
|
|
205
|
+
if @debug then
|
206
|
+
puts 'inside build_table'
|
207
|
+
puts 'a : ' + a.inspect
|
208
|
+
puts '@growth: ' + @growth.inspect
|
209
|
+
end
|
210
|
+
|
200
211
|
coins = a.map do |x|
|
201
|
-
@growth.has_key?(x[1]) ? x + [@growth[x[1]].to_s] : x
|
202
|
-
end
|
203
|
-
|
212
|
+
@growth.has_key?(x[1]) ? x + [@growth[x[1]].to_s] : x + ['-']
|
213
|
+
end
|
214
|
+
|
215
|
+
if @debug then
|
216
|
+
puts 'coins+growth: ' + coins.inspect
|
217
|
+
puts 'before format_table'
|
218
|
+
end
|
219
|
+
|
204
220
|
format_table(coins, markdown: markdown, labels: @labels)
|
205
221
|
end
|
206
222
|
|
@@ -211,6 +227,12 @@ class CryptocoinFanboi
|
|
211
227
|
end
|
212
228
|
|
213
229
|
def format_table(source, markdown: markdown, labels: @labels)
|
230
|
+
|
231
|
+
if @debug then
|
232
|
+
puts 'source: ' + source.inspect
|
233
|
+
puts 'labels: ' + labels.inspect
|
234
|
+
end
|
235
|
+
|
214
236
|
s = TableFormatter.new(source: source, labels: labels, markdown: markdown)\
|
215
237
|
.display
|
216
238
|
|
@@ -280,8 +302,10 @@ class CryptocoinFanboi
|
|
280
302
|
#
|
281
303
|
def fetch_growth(coins, coin_prices)
|
282
304
|
|
283
|
-
|
284
|
-
|
305
|
+
if @debug then
|
306
|
+
puts 'fetching growth ...'
|
307
|
+
puts 'coin_prices: ' + coin_prices.inspect
|
308
|
+
end
|
285
309
|
|
286
310
|
coins.inject({}) do |r, coin|
|
287
311
|
|
@@ -318,4 +342,4 @@ if __FILE__ == $0 then
|
|
318
342
|
ccf = CryptocoinFanboi.new
|
319
343
|
puts ccf.to_s
|
320
344
|
|
321
|
-
end
|
345
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptocoin_fanboi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
NgmsFfw10oaD3PWQ7UPxWJP14au2LUL+NGHkLrGHOMPphsZhYeXKugGO8NfcKukq
|
31
31
|
fps=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2018-01-
|
33
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: colored
|
metadata.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
�
|
1
|
+
3����u�l��A6�^�Sq����Hx�O���HsV�z�}P2�E�(O/�G����w�&itm�3���dO%��I��IYR+�9�����{�A���7��;c.�m��`�^��K�+�y���:m�*�X�?W�?7�{��C�_�U ��QdVq�r{��gI�Br� Y����KM��i�_Ȕ,�{
|
2
|
+
��Ӽ�''�::Ou53�� ) 풘����E"e�v:�\����W�QU�L���No��y�d
|