sibit 0.19.4 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sibit/bestof.rb +3 -2
- data/lib/sibit/firstof.rb +3 -2
- data/lib/sibit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b0e095b8a42b4036cc160bf0c7cd2d8d80801fb4aa609c34846fe42e711a9a8
|
4
|
+
data.tar.gz: 5da2b30520ff7ac48783d6a264c501b8b26dbbcf4934a2927e1b9252803f5666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b60bbbaf728cc95fc71078096d850f675f2d933ee889a1edb38798f21267ad4e22b7904f786853bcb8c1507aac7a29c3fa195a56d7be5da41d067a6832983c69
|
7
|
+
data.tar.gz: fa7e0c793d4e21d151c1e5758b2c2c8f98fdd1aaa92368bf3c70527083185b85a6b2a769a51f56b9a5a24e6105e0fb6eac0cb0d78470d8de7f1eb236b0f46423
|
data/lib/sibit/bestof.rb
CHANGED
@@ -32,9 +32,10 @@ class Sibit
|
|
32
32
|
# Best of API.
|
33
33
|
class BestOf
|
34
34
|
# Constructor.
|
35
|
-
def initialize(list, log: Sibit::Log.new)
|
35
|
+
def initialize(list, log: Sibit::Log.new, verbose: false)
|
36
36
|
@list = list
|
37
37
|
@log = log
|
38
|
+
@verbose = verbose
|
38
39
|
end
|
39
40
|
|
40
41
|
# Current price of BTC in USD (float returned).
|
@@ -106,7 +107,7 @@ class Sibit
|
|
106
107
|
begin
|
107
108
|
results << yield(api)
|
108
109
|
rescue Sibit::Error => e
|
109
|
-
@log.info("The API #{api.class.name} failed at #{method}(): #{e.message}")
|
110
|
+
@log.info("The API #{api.class.name} failed at #{method}(): #{e.message}") if @verbose
|
110
111
|
end
|
111
112
|
end
|
112
113
|
if results.empty?
|
data/lib/sibit/firstof.rb
CHANGED
@@ -32,9 +32,10 @@ class Sibit
|
|
32
32
|
# First of API.
|
33
33
|
class FirstOf
|
34
34
|
# Constructor.
|
35
|
-
def initialize(list, log: Sibit::Log.new)
|
35
|
+
def initialize(list, log: Sibit::Log.new, verbose: false)
|
36
36
|
@list = list
|
37
37
|
@log = log
|
38
|
+
@verbose = verbose
|
38
39
|
end
|
39
40
|
|
40
41
|
# Current price of BTC in USD (float returned).
|
@@ -109,7 +110,7 @@ class Sibit
|
|
109
110
|
done = true
|
110
111
|
break
|
111
112
|
rescue Sibit::Error => e
|
112
|
-
@log.info("The API #{api.class.name} failed at #{method}(): #{e.message}")
|
113
|
+
@log.info("The API #{api.class.name} failed at #{method}(): #{e.message}") if @verbose
|
113
114
|
end
|
114
115
|
end
|
115
116
|
unless done
|
data/lib/sibit/version.rb
CHANGED