gocoin 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{history.md → HISTORY.md} +4 -0
- data/VERSION +1 -1
- data/lib/gocoin/client.rb +5 -3
- data/lib/gocoin/version.rb +1 -1
- data/spec/gocoin/client_spec.rb +6 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5557e882f1e991be1d8a4987a55eed1a241d8394
|
4
|
+
data.tar.gz: 1e0eca96faa3a10376dbf10a14ba9c2ebcb31051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6a7c620d3abb22506e0696e296a5cd94cc602acad07da75a6139e64cc582a7011923d5e5e57944c8bb42ebb216ae295ae90ab24effc03b8d2617697fdc30568
|
7
|
+
data.tar.gz: 979da0219e13a61f480f4924886a2ed31d30fbb408f4e90dfbe95172b3485518378602ccf3e4216bb68cea4cce6d4385bffa5e5ad35b2c2b5c9509c45fe3c57b
|
data/{history.md → HISTORY.md}
RENAMED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/lib/gocoin/client.rb
CHANGED
@@ -19,7 +19,8 @@ module Gocoin
|
|
19
19
|
request_id: nil,
|
20
20
|
dashboard_host: 'dashboard.gocoin.com',
|
21
21
|
xrate_host: 'x.g0cn.com',
|
22
|
-
log_file: nil
|
22
|
+
log_file: nil,
|
23
|
+
token: nil
|
23
24
|
}
|
24
25
|
|
25
26
|
@default_headers = {
|
@@ -30,6 +31,7 @@ module Gocoin
|
|
30
31
|
@logger = Logger.new(@options[:log_file] || STDOUT)
|
31
32
|
@headers = @options[:headers] || @default_headers
|
32
33
|
@headers['X-Request-Id'] = @options[:request_id] if @options[:request_id]
|
34
|
+
@token = @options[:token] if @options[:token]
|
33
35
|
|
34
36
|
@auth = Gocoin::Auth.new(self)
|
35
37
|
@api = Gocoin::API.new(self)
|
@@ -107,7 +109,7 @@ module Gocoin
|
|
107
109
|
end
|
108
110
|
end
|
109
111
|
obj[:headers]['Authorization'] = '<bearer>' if obj[:headers]['Authorization']
|
110
|
-
|
112
|
+
|
111
113
|
obj
|
112
114
|
end
|
113
115
|
|
@@ -198,4 +200,4 @@ module Gocoin
|
|
198
200
|
end
|
199
201
|
|
200
202
|
end
|
201
|
-
end
|
203
|
+
end
|
data/lib/gocoin/version.rb
CHANGED
data/spec/gocoin/client_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Gocoin::Client do
|
4
|
-
|
4
|
+
|
5
5
|
describe "::initialize" do
|
6
6
|
|
7
7
|
describe "with an empty options hash" do
|
@@ -24,6 +24,7 @@ describe Gocoin::Client do
|
|
24
24
|
@gocoin_client.options[:dashboard_host].should == 'dashboard.gocoin.com'
|
25
25
|
@gocoin_client.options[:xrate_host].should == 'x.g0cn.com'
|
26
26
|
@gocoin_client.options[:log_file].should be_nil
|
27
|
+
@gocoin_client.options[:token].should be_nil
|
27
28
|
end
|
28
29
|
|
29
30
|
it "should have the default headers" do
|
@@ -76,6 +77,7 @@ describe Gocoin::Client do
|
|
76
77
|
grant_type: 'a_different_grant_type',
|
77
78
|
request_id: 'a_request_id_string',
|
78
79
|
dashboard_host: 'a.different.dash.host',
|
80
|
+
token: 'a_token'
|
79
81
|
}
|
80
82
|
@gocoin_client = Gocoin::Client.new(@options)
|
81
83
|
end
|
@@ -86,7 +88,7 @@ describe Gocoin::Client do
|
|
86
88
|
|
87
89
|
it "should set the options with the provided values" do
|
88
90
|
@gocoin_client.options[:client_id].should == @options[:client_id]
|
89
|
-
@gocoin_client.options[:client_secret].should == @options[:client_secret]
|
91
|
+
@gocoin_client.options[:client_secret].should == @options[:client_secret]
|
90
92
|
@gocoin_client.options[:host].should == @options[:host]
|
91
93
|
@gocoin_client.options[:port].should == @options[:port]
|
92
94
|
@gocoin_client.options[:path].should == @options[:path]
|
@@ -97,6 +99,7 @@ describe Gocoin::Client do
|
|
97
99
|
@gocoin_client.options[:grant_type].should == @options[:grant_type]
|
98
100
|
@gocoin_client.options[:request_id].should == @options[:request_id]
|
99
101
|
@gocoin_client.options[:dashboard_host].should == @options[:dashboard_host]
|
102
|
+
@gocoin_client.options[:token].should == @options[:token]
|
100
103
|
end
|
101
104
|
|
102
105
|
end
|
@@ -136,4 +139,4 @@ describe Gocoin::Client do
|
|
136
139
|
|
137
140
|
end
|
138
141
|
|
139
|
-
end
|
142
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocoin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCoin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -61,11 +61,11 @@ extensions: []
|
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
63
|
- Gemfile
|
64
|
+
- HISTORY.md
|
64
65
|
- LICENSE
|
65
66
|
- README.md
|
66
67
|
- Rakefile
|
67
68
|
- VERSION
|
68
|
-
- history.md
|
69
69
|
- lib/gocoin.rb
|
70
70
|
- lib/gocoin/api.rb
|
71
71
|
- lib/gocoin/api/accounts.rb
|