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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 992f3a5296f9a1feeb0b986dabdafe5af0fa9e87
4
- data.tar.gz: c0c42d3deae6d309c73dc44c437797a59ca96777
3
+ metadata.gz: 112350f3fa47387e9121793ced80616589108424
4
+ data.tar.gz: 17bd11be45829dc649d4b9ccced38c0e22bbc3f9
5
5
  SHA512:
6
- metadata.gz: bf16cb86c59b9007eb13fefb4421e5f0bd5913ed3eef26b615605954dfe2391cc7c6c65f0c571d7ec743b82fa60028e24aef76ba07f5888dc47cf97e712de170
7
- data.tar.gz: 9ba41721fcd93f2b1cb6a5646ad82736ec74fec2d23e9c43f5e7e9b17fcd79eabab754571e7504a8a3fe12cf21f74da7982969dfdd8017df95e1b0f6fc023d0e
6
+ metadata.gz: caae825ddcbe47e7c4dd9fc730be9b905141dcf23528eb13d27fb75d19be390405fa24dea190ef5d51142d093fd24851369e162a847a50d4e3e2205ffe948ce6
7
+ data.tar.gz: 4048c8f3faa53366f49563b9eaf720d6861606b7b28d4fe5fddce63d2ad44d6759df29c966dd6dfbb913efac1c6e399e9837a583a9e4aa8051d61a3c446ba94b
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbtc_arbitrage (1.4.2)
4
+ rbtc_arbitrage (1.4.3)
5
5
  activemodel (>= 3.1)
6
6
  activesupport (>= 3.1)
7
7
  bitstamp
@@ -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
- set_key opts, :logger, Logger.new(STDOUT)
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
@@ -1,3 +1,3 @@
1
1
  module RbtcArbitrage
2
- VERSION = "1.4.2"
2
+ VERSION = "1.4.3"
3
3
  end
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
- it "calls logger.info" do
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.2
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-03 00:00:00.000000000 Z
11
+ date: 2014-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler