CryptoPriceFinder 0.6.1 → 0.6.3

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
  SHA256:
3
- metadata.gz: e6405b08fa49e388d97bb81881ff2dd70e0773ff1716be77a204725d03ede3da
4
- data.tar.gz: 0b42580ffc8c61b628f06faf7e640aa6738ab046f063f7025e696898c2115fa6
3
+ metadata.gz: b3750ab23943d7c13ae3c444c0f94375694be62d662c0566f8477e0a880acee7
4
+ data.tar.gz: d2f4efc7e7a284834d0ed58e181f79f2e7f110f429f13d1740f7067f729ab82a
5
5
  SHA512:
6
- metadata.gz: 30ed7a48ff5e9e35c26d3d63273423d8840c4a7462793e0c18d5953e2567410da90e49fba27a3c9954207591e8cf6420f95458f8f72b02d7a7a39d35286f0b65
7
- data.tar.gz: c8f3febfb03580fcdf736597f43a2172740837a1895838e9d13b11c922f1b35ead1a784eb584f6ce8475a6899d602760808a4395ca38c96b9759200c7ea849c0
6
+ metadata.gz: e0856bfc941b1105406882bbfa48f071e8a41a29c2fea881cf545ef61f720f3e331aa61ec50b15380b84b16e49dc6a224fe9e918c611d585f76468446c970662
7
+ data.tar.gz: fc8ed2a4da10e351e5016c3252409edef6942e4ba4bdd42a3ba1616b637c66a8f6e17cbfc68c5f8df960b27f22a1ce3dd3e01c36f17b5d1c506a219eba6ee56b
@@ -18,11 +18,18 @@ module CryptoPriceFinder
18
18
  end
19
19
 
20
20
  def http(crypto, fiat, amount)
21
- r = HTTParty.get(File.join(URL, crypto, fiat, amount.to_s)).body
22
- r_clean = clean(r)
23
- json = JSON.parse(r_clean)['data']['quote']
24
- q = json.keys.shift.to_s
25
- json[q]['price'].round(4)
21
+ begin
22
+ r = HTTParty.get(File.join(URL, crypto, fiat, amount.to_s)).body
23
+ r_clean = clean(r)
24
+ json = JSON.parse(r_clean)
25
+ #if json.has_key?("data")
26
+ json_p = json['data']['quote']
27
+ q = json_p.keys.shift.to_s
28
+ json_p[q]['price'].round(4)
29
+ rescue
30
+ retry
31
+ end
32
+ #end
26
33
  end
27
34
 
28
35
  public
@@ -105,7 +112,7 @@ module CryptoPriceFinder
105
112
 
106
113
  def ravencoin(amount)
107
114
  http('rvn', 'usd', amount)
108
- endg
115
+ end
109
116
 
110
117
  def usdc(amount)
111
118
  http('usdc', 'usd', amount)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CryptoPriceFinder
4
- VERSION = '0.6.1'
4
+ VERSION = '0.6.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CryptoPriceFinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael-Meade
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-24 00:00:00.000000000 Z
11
+ date: 2025-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty