cryptocoin_fanboi 0.4.0 → 0.4.1

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: 6647efad3d6df21445369ae23f75f0adae01e0d3
4
- data.tar.gz: 720d9e7412149fb090369c87907947cbc335e768
3
+ metadata.gz: bf1a8ad5d161f30013983f99a8d5a85a19092d6f
4
+ data.tar.gz: 70248b238934c7e1c2de48381a82635bb2298fd9
5
5
  SHA512:
6
- metadata.gz: 7228b523021fa1c781870f1b270318c8db457044b27944fe6ebf014ebb4978ab39b396f5054b90faa8b87ec5578c8faacabb9d7448d64c664b30789c7242df3a
7
- data.tar.gz: a426444e35bfe40e71a1245eb80254ae70674f2dda3288ab436be6ee6dabf371090df1126cf005b26d48a3f782a5a7fe0867e42c29bfac3fc45a17bee486f61a
6
+ metadata.gz: 3c903735f66caafbf30726bfa186f7a0529d76e212e16c6b47a32ce26869236f6d21ea4b50bcaa1e2014bafaf82cbadca780303bce5c660e799ec535a666234a
7
+ data.tar.gz: 7bfe0284e3bfe63cabee595be74ff1309c11e007a0e59820536928be02b44623aa78c54c6b128e7f2772ace54a7176e2ca30a9d54f7f240f7b132f989cf4ec86
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ��'��A���d�H��S'[��4x5u��ڧQE��Q=���e@�Hvڷ�i7̌�D��A�� Lwз����-�5x��Sb�+79��ʟ�v�jb>�.�| �M9e1�A&�_��)1�����k�ٮ'��">�)��(���ٸR����ѹ$�/�7؁�=�͜�&Jmٌ=�P�����=��C��:�
2
- aY� Mێ�k�1 +Č�e'"FN�Q�.�6ăW�h�� Ż2��)Mr]���AT�
1
+ E����ڮDކ�a���c�H�<:ȷ`��" �1}���:Wp��ӎ��}�A܂��8o$��IF�v(�����8_˾28����.�D�‘�3h�\��,���� �������_w΂Y���,{tmx6�}��Z@5����Y�Ӫ�Hl��ݖⷥ9J�5JrL&��:o �V٪~��c����]�Br}���>�E�+��tR�6�b��9N��Z�Q&��}o�ާ%��k��ɘ�<��1-�T��GV
data.tar.gz.sig CHANGED
Binary file
@@ -142,15 +142,30 @@ class CryptocoinFanboi
142
142
  # e.g. price('tron', '8th September 2017') #=> 0.001427
143
143
  #
144
144
  def price(coin, raw_date)
145
-
145
+
146
146
  date = Chronic.parse(raw_date.gsub('-',' ')).strftime("%Y%m%d")
147
147
  puts 'date: ' + date.inspect if @debug
148
+
149
+ # if date is today then return today's price
150
+
151
+ if date == Date.today.strftime("%Y%m%d")
152
+
153
+ r = Coinmarketcap.coin(coin)
154
+ return r.parsed_response.first['price_usd'].to_f
155
+
156
+ end
157
+
148
158
 
149
159
  if @history_prices[coin] and @history_prices[coin][date] then
150
160
  @history_prices[coin][date]
151
161
  else
152
162
  begin
153
163
 
164
+ if @debug then
165
+ puts 'coin: ' + coin.inspect
166
+ puts 'date: ' + date.inspect
167
+ end
168
+
154
169
  a = Coinmarketcap.get_historical_price(coin, date, date)
155
170
  puts 'a: ' + a.inspect if @debug
156
171
  r = a.first[:close]
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.4.0
4
+ version: 0.4.1
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-03-05 00:00:00.000000000 Z
33
+ date: 2018-03-07 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: colored
metadata.gz.sig CHANGED
Binary file