cexio_reinvestor 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +6 -0
- data/cexio_reinvestor.gemspec +1 -1
- data/lib/cexio_reinvestor/version.rb +1 -1
- data/lib/cexio_reinvestor.rb +2 -2
- data/spec/cexio_reinvestor_spec.rb +11 -10
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDg5YTRiM2E1MDBiNmMxY2UzNzMzMmU2N2YxMzUwY2FjMTJmODM1Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjUzOWM3MjE4YjZmNGI4MWVkZDRkNzBlZGMwNjYzNjQyNWQzOTYxOA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmU2MDAxOTg2ZWJhOTk2ZWZkMTZhZTRhMzliMDVjZDEzNzA4ODY0ZmMzNzgw
|
10
|
+
OTcwMzUyNmJjOWQzODdjMDJkZmU2MzJmOTEzNmIxNWUzYTNiYTJjOGQ3ZDlj
|
11
|
+
NWE2MTI1YTJhNjExOTE4ZGRkYzdmZGI3YTZmODYxZGQ0ZTdmNDE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODM1ODk5NTFlNzYyM2M3NTI2ZWJlNTFjZWJmMjI3YWE1NzNiMGRmNDgyMjkz
|
14
|
+
YTc1ODA4OGNmZDJkMDZjMjFmMDMxYjk5OGU1N2VmNzUyNzYxZDY5YTEyMDA3
|
15
|
+
OGQzZTI5OTlhYmUxNzlmYTBkZjgwOWRjYTU2ZmIxYTA2YWQwMDc=
|
data/README.md
CHANGED
@@ -17,3 +17,9 @@ This is a simple command-line tool that helps you reinvest your mined BTC and NM
|
|
17
17
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
18
18
|
4. Push to the branch (`git push origin my-new-feature`)
|
19
19
|
5. Create new Pull Request
|
20
|
+
|
21
|
+
## Donations
|
22
|
+
|
23
|
+
**Bitcoin:** 1DwZR4TdRy4a448xRz8Dm51hHn6PdZXYS2
|
24
|
+
|
25
|
+
**CEX.IO referral link:** https://cex.io/r/2/eromirou/0/
|
data/cexio_reinvestor.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["tmsrjs@gmail.com"]
|
11
11
|
spec.description = %q{CEX.io Reinvestor reinvests earned BTC and NMC.}
|
12
12
|
spec.summary = %q{CEX.io Reinvestor.}
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/tmsrjs/cexio_reinvestor"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/lib/cexio_reinvestor.rb
CHANGED
@@ -1,22 +1,20 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe CexioReinvestor::Trader do
|
4
|
-
PAIRS = [ 'GHS/BTC', 'GHS/NMC', 'NMC/BTC' ]
|
5
|
-
|
6
|
-
let(:trader) { CexioReinvestor::Trader.new('username', 'api_key', 'api_secret') }
|
7
|
-
|
4
|
+
#PAIRS = [ 'GHS/BTC', 'GHS/NMC', 'NMC/BTC' ]
|
5
|
+
=begin
|
8
6
|
let(:stub_balance) do
|
9
7
|
stub_request(:post, 'https://cex.io/api/balance/').to_return(body: lambda { |r| balance })
|
10
8
|
end
|
11
|
-
let(:balance) {
|
9
|
+
let(:balance) { %{{"timestamp":"#{Time.now.to_i}","username":"eromirou","IXC":{"available":"3.95433625"},"DVC":{"available":"148.66713273"},"BTC":{"available":"1.5","orders":"0.00000000"},"NMC":{"available":"5.6","orders":"0.00000000"},"GHS":{"available":"200.1","orders":"0.00000000"}}} }
|
12
10
|
|
13
11
|
let(:stub_ticker) do
|
14
12
|
stub_request(:post, %r{https://cex\.io/api/ticker/(#{PAIRS.join('|')})})
|
15
13
|
.to_return(body: lambda { |r| send(r.uri.path.split('/')[-2..-1].join('_').downcase) })
|
16
14
|
end
|
17
|
-
let(:ghs_btc) {
|
18
|
-
let(:ghs_nmc) {
|
19
|
-
let(:nmc_btc) {
|
15
|
+
let(:ghs_btc) { %{{"timestamp":"#{Time.now.to_i}", "low":"0.02", "high":"0.03", "last":"0.025", "volume":"500", "bid":"0.026", "ask":"0.027"}} }
|
16
|
+
let(:ghs_nmc) { %{{"timestamp":"#{Time.now.to_i}", "low":"4", "high":"5", "last":"4.5", "volume":"200", "bid":"4.6", "ask":"4.7"}} }
|
17
|
+
let(:nmc_btc) { %{{"timestamp":"#{Time.now.to_i}", "low":"0.005", "high":"0.008", "last":"0.006", "volume":"3000", "bid":"0.006", "ask":"0.007"}} }
|
20
18
|
|
21
19
|
let(:stub_place_order) do
|
22
20
|
stub_request(:post, %r{https://cex\.io/api/place_order/(#{PAIRS.join('|')})})
|
@@ -26,10 +24,10 @@ describe CexioReinvestor::Trader do
|
|
26
24
|
})
|
27
25
|
end
|
28
26
|
let(:ghs_btc_buy_order) do
|
29
|
-
|
27
|
+
%{{"id":"123456", "time":"#{Time.now.to_i}", "pending":"0.0", "amount":"1", "type":"buy", "price":"0.025"}}
|
30
28
|
end
|
31
29
|
let(:ghs_btc_sell_order) do
|
32
|
-
|
30
|
+
%{{"id":"123456", "time":"#{Time.now.to_i}", "pending":"0.0", "amount":"1", "type":"sell", "price":"0.026"}}
|
33
31
|
end
|
34
32
|
|
35
33
|
before :each do
|
@@ -37,8 +35,11 @@ describe CexioReinvestor::Trader do
|
|
37
35
|
stub_ticker
|
38
36
|
stub_place_order
|
39
37
|
end
|
38
|
+
=end
|
40
39
|
|
41
40
|
describe '#trade(pair)' do
|
41
|
+
let(:trader) { CexioReinvestor::Trader.new('username', 'api_key', 'api_secret') }
|
42
|
+
|
42
43
|
it 'does not blow up when a timeout occurs' do
|
43
44
|
stub_request(:post, 'https://cex.io/api/balance/').to_timeout
|
44
45
|
expect do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cexio_reinvestor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Rojas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cexio
|
@@ -113,7 +113,7 @@ files:
|
|
113
113
|
- lib/cexio_reinvestor/version.rb
|
114
114
|
- spec/cexio_reinvestor_spec.rb
|
115
115
|
- spec/spec_helper.rb
|
116
|
-
homepage:
|
116
|
+
homepage: https://github.com/tmsrjs/cexio_reinvestor
|
117
117
|
licenses:
|
118
118
|
- MIT
|
119
119
|
metadata: {}
|
@@ -140,3 +140,4 @@ summary: CEX.io Reinvestor.
|
|
140
140
|
test_files:
|
141
141
|
- spec/cexio_reinvestor_spec.rb
|
142
142
|
- spec/spec_helper.rb
|
143
|
+
has_rdoc:
|