rbtc_arbitrage 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rbtc_arbitrage/trader.rb +3 -1
- data/lib/rbtc_arbitrage/version.rb +1 -1
- data/spec/trader_spec.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 112350f3fa47387e9121793ced80616589108424
|
4
|
+
data.tar.gz: 17bd11be45829dc649d4b9ccced38c0e22bbc3f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caae825ddcbe47e7c4dd9fc730be9b905141dcf23528eb13d27fb75d19be390405fa24dea190ef5d51142d093fd24851369e162a847a50d4e3e2205ffe948ce6
|
7
|
+
data.tar.gz: 4048c8f3faa53366f49563b9eaf720d6861606b7b28d4fe5fddce63d2ad44d6759df29c966dd6dfbb913efac1c6e399e9837a583a9e4aa8051d61a3c446ba94b
|
data/Gemfile.lock
CHANGED
@@ -13,7 +13,9 @@ module RbtcArbitrage
|
|
13
13
|
@options = {}
|
14
14
|
set_key opts, :volume, 0.01
|
15
15
|
set_key opts, :cutoff, 2
|
16
|
-
|
16
|
+
default_logger = Logger.new($stdout)
|
17
|
+
default_logger.datetime_format = "%^b %e %Y %l:%M:%S %p %z"
|
18
|
+
set_key opts, :logger, default_logger
|
17
19
|
set_key opts, :verbose, true
|
18
20
|
set_key opts, :live, false
|
19
21
|
set_key opts, :repeat, nil
|
data/spec/trader_spec.rb
CHANGED
@@ -199,15 +199,28 @@ describe RbtcArbitrage::Trader do
|
|
199
199
|
end
|
200
200
|
|
201
201
|
describe "#log_info" do
|
202
|
-
|
202
|
+
before :each do
|
203
203
|
trader.buyer[:price] = 1
|
204
204
|
trader.seller[:price] = 1
|
205
205
|
trader.instance_variable_set :@percent, 1
|
206
206
|
trader.instance_variable_set :@paid, 1
|
207
207
|
trader.instance_variable_set :@received, 1
|
208
|
+
end
|
209
|
+
it "calls logger.info" do
|
208
210
|
trader.logger.should_receive(:info).exactly(5).times
|
209
211
|
trader.log_info
|
210
212
|
end
|
213
|
+
|
214
|
+
it "formats the log correctly" do
|
215
|
+
date = DateTime.now.strftime "%^b %e %Y %l"
|
216
|
+
logger = Logger.new('tmp/log.info')
|
217
|
+
logger.datetime_format = trader.logger.datetime_format
|
218
|
+
trader.options[:logger] = logger
|
219
|
+
trader.log_info
|
220
|
+
contents = File.read("tmp/log.info")
|
221
|
+
contents.should include(date)
|
222
|
+
contents.should include(" INFO -- ")
|
223
|
+
end
|
211
224
|
end
|
212
225
|
|
213
226
|
describe "#logger" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbtc_arbitrage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hank Stoever
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|