mtgox 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/LICENSE.md +1 -1
- data/README.md +7 -7
- data/lib/mtgox/connection.rb +2 -3
- data/lib/mtgox/response/parse_json.rb +25 -0
- data/lib/mtgox/version.rb +1 -1
- data/mtgox.gemspec +2 -3
- metadata +106 -102
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/LICENSE.md
CHANGED
data/README.md
CHANGED
@@ -98,9 +98,9 @@ implementations:
|
|
98
98
|
|
99
99
|
* Ruby 1.9.2
|
100
100
|
* Ruby 1.9.3
|
101
|
+
* Ruby 2.0.0
|
101
102
|
|
102
|
-
If something doesn't work on one of these interpreters, it
|
103
|
-
a bug.
|
103
|
+
If something doesn't work on one of these interpreters, it's a bug.
|
104
104
|
|
105
105
|
This library may inadvertently work (or seem to work) on other Ruby
|
106
106
|
implementations, however support will only be provided for the versions listed
|
@@ -109,11 +109,11 @@ above.
|
|
109
109
|
If you would like this library to support another Ruby version, you may
|
110
110
|
volunteer to be a maintainer. Being a maintainer entails making sure all tests
|
111
111
|
run and pass on that implementation. When something breaks on your
|
112
|
-
implementation, you will be
|
113
|
-
|
114
|
-
|
112
|
+
implementation, you will be responsible for providing patches in a timely
|
113
|
+
fashion. If critical issues for a particular implementation exist at the time
|
114
|
+
of a major release, support for that Ruby version may be dropped.
|
115
115
|
|
116
116
|
## Copyright
|
117
|
-
Copyright (c) 2011 Erik Michaels-Ober. See [LICENSE][] for details.
|
117
|
+
Copyright (c) 2011-2013 Erik Michaels-Ober. See [LICENSE][] for details.
|
118
118
|
|
119
|
-
[license]:
|
119
|
+
[license]: LICENSE.md
|
data/lib/mtgox/connection.rb
CHANGED
@@ -2,8 +2,7 @@ require 'faraday'
|
|
2
2
|
require 'faraday/request/url_encoded'
|
3
3
|
require 'faraday/response/raise_error'
|
4
4
|
require 'faraday/response/raise_mtgox_error'
|
5
|
-
require '
|
6
|
-
require 'faraday_middleware/response/parse_json'
|
5
|
+
require 'mtgox/response/parse_json'
|
7
6
|
require 'mtgox/version'
|
8
7
|
|
9
8
|
module MtGox
|
@@ -22,7 +21,7 @@ module MtGox
|
|
22
21
|
Faraday.new(options) do |connection|
|
23
22
|
connection.request :url_encoded
|
24
23
|
connection.use Faraday::Response::RaiseError
|
25
|
-
connection.use
|
24
|
+
connection.use MtGox::Response::ParseJson
|
26
25
|
connection.use Faraday::Response::RaiseMtGoxError
|
27
26
|
connection.adapter(Faraday.default_adapter)
|
28
27
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'multi_json'
|
3
|
+
|
4
|
+
module MtGox
|
5
|
+
module Response
|
6
|
+
class ParseJson < Faraday::Response::Middleware
|
7
|
+
|
8
|
+
def parse(body)
|
9
|
+
case body
|
10
|
+
when /\A^\s*$\z/, nil
|
11
|
+
nil
|
12
|
+
else
|
13
|
+
MultiJson.decode(body)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def on_complete(env)
|
18
|
+
if respond_to?(:parse)
|
19
|
+
env[:body] = parse(env[:body]) unless [204, 301, 302, 304].include?(env[:status])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/lib/mtgox/version.rb
CHANGED
data/mtgox.gemspec
CHANGED
@@ -4,9 +4,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'mtgox/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.add_dependency 'faraday', '~> 0.8'
|
8
|
-
spec.add_dependency '
|
9
|
-
spec.add_dependency 'multi_json', '~> 1.3'
|
7
|
+
spec.add_dependency 'faraday', ['~> 0.8', '< 0.10']
|
8
|
+
spec.add_dependency 'multi_json', '~> 1.0'
|
10
9
|
spec.add_development_dependency 'bundler', '~> 1.0'
|
11
10
|
spec.author = "Erik Michaels-Ober"
|
12
11
|
spec.cert_chain = ['certs/sferik.pem']
|
metadata
CHANGED
@@ -1,114 +1,104 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mtgox
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 59
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 8
|
9
|
+
- 2
|
10
|
+
version: 0.8.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Erik Michaels-Ober
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
|
-
cert_chain:
|
12
|
-
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
cEdUdnk0NVhWcEIrNTl5MzNQSm1FdVExUFRFT1l2UXlhbzlVS01BQWFBTi83
|
38
|
-
cVdRdGpsMApobHc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
|
39
|
-
date: 2013-02-08 00:00:00.000000000 Z
|
40
|
-
dependencies:
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
prerelease: false
|
43
|
-
version_requirements: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ~>
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0.8'
|
48
|
-
none: false
|
49
|
-
type: :runtime
|
16
|
+
cert_chain:
|
17
|
+
- |
|
18
|
+
-----BEGIN CERTIFICATE-----
|
19
|
+
MIIDLjCCAhagAwIBAgIBADANBgkqhkiG9w0BAQUFADA9MQ8wDQYDVQQDDAZzZmVy
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BlypHfhs6JJuLlyZPGhU3R/v
|
35
|
+
Sf3lVKpBCWgRpGTvy45XVpB+59y33PJmEuQ1PTEOYvQyao9UKMAAaAN/7qWQtjl0
|
36
|
+
hlw=
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
|
39
|
+
date: 2013-02-10 00:00:00 Z
|
40
|
+
dependencies:
|
41
|
+
- !ruby/object:Gem::Dependency
|
50
42
|
name: faraday
|
51
|
-
requirement: !ruby/object:Gem::Requirement
|
52
|
-
requirements:
|
53
|
-
- - ~>
|
54
|
-
- !ruby/object:Gem::Version
|
55
|
-
version: '0.8'
|
56
|
-
none: false
|
57
|
-
- !ruby/object:Gem::Dependency
|
58
43
|
prerelease: false
|
59
|
-
|
60
|
-
requirements:
|
61
|
-
- - ~>
|
62
|
-
- !ruby/object:Gem::Version
|
63
|
-
version: '0.8'
|
64
|
-
none: false
|
65
|
-
type: :runtime
|
66
|
-
name: faraday_middleware
|
67
|
-
requirement: !ruby/object:Gem::Requirement
|
68
|
-
requirements:
|
69
|
-
- - ~>
|
70
|
-
- !ruby/object:Gem::Version
|
71
|
-
version: '0.8'
|
44
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
72
45
|
none: false
|
73
|
-
|
74
|
-
prerelease: false
|
75
|
-
version_requirements: !ruby/object:Gem::Requirement
|
76
|
-
requirements:
|
46
|
+
requirements:
|
77
47
|
- - ~>
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
hash: 27
|
50
|
+
segments:
|
51
|
+
- 0
|
52
|
+
- 8
|
53
|
+
version: "0.8"
|
54
|
+
- - <
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
hash: 31
|
57
|
+
segments:
|
58
|
+
- 0
|
59
|
+
- 10
|
60
|
+
version: "0.10"
|
81
61
|
type: :runtime
|
62
|
+
version_requirements: *id001
|
63
|
+
- !ruby/object:Gem::Dependency
|
82
64
|
name: multi_json
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '1.3'
|
88
|
-
none: false
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
65
|
prerelease: false
|
91
|
-
|
92
|
-
requirements:
|
93
|
-
- - ~>
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '1.0'
|
66
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
96
67
|
none: false
|
97
|
-
|
98
|
-
name: bundler
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
68
|
+
requirements:
|
101
69
|
- - ~>
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 15
|
72
|
+
segments:
|
73
|
+
- 1
|
74
|
+
- 0
|
75
|
+
version: "1.0"
|
76
|
+
type: :runtime
|
77
|
+
version_requirements: *id002
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: bundler
|
80
|
+
prerelease: false
|
81
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
104
82
|
none: false
|
105
|
-
|
106
|
-
|
83
|
+
requirements:
|
84
|
+
- - ~>
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 15
|
87
|
+
segments:
|
88
|
+
- 1
|
89
|
+
- 0
|
90
|
+
version: "1.0"
|
91
|
+
type: :development
|
92
|
+
version_requirements: *id003
|
93
|
+
description: Ruby wrapper for the Mt. Gox Trade API. Mt. Gox allows you to trade US Dollars (USD) for Bitcoins (BTC) or Bitcoins for US Dollars.
|
107
94
|
email: sferik@gmail.com
|
108
95
|
executables: []
|
96
|
+
|
109
97
|
extensions: []
|
98
|
+
|
110
99
|
extra_rdoc_files: []
|
111
|
-
|
100
|
+
|
101
|
+
files:
|
112
102
|
- .yardopts
|
113
103
|
- CONTRIBUTING.md
|
114
104
|
- LICENSE.md
|
@@ -130,6 +120,7 @@ files:
|
|
130
120
|
- lib/mtgox/order.rb
|
131
121
|
- lib/mtgox/price_ticker.rb
|
132
122
|
- lib/mtgox/request.rb
|
123
|
+
- lib/mtgox/response/parse_json.rb
|
133
124
|
- lib/mtgox/sell.rb
|
134
125
|
- lib/mtgox/ticker.rb
|
135
126
|
- lib/mtgox/trade.rb
|
@@ -153,29 +144,42 @@ files:
|
|
153
144
|
- spec/mtgox_spec.rb
|
154
145
|
homepage: https://github.com/sferik/mtgox
|
155
146
|
licenses: []
|
147
|
+
|
156
148
|
post_install_message:
|
157
149
|
rdoc_options: []
|
158
|
-
|
150
|
+
|
151
|
+
require_paths:
|
159
152
|
- lib
|
160
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
-
|
162
|
-
|
163
|
-
|
153
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
hash: 55
|
159
|
+
segments:
|
160
|
+
- 1
|
161
|
+
- 9
|
162
|
+
- 2
|
164
163
|
version: 1.9.2
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
166
|
+
requirements:
|
167
|
+
- - ">="
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
hash: 23
|
170
|
+
segments:
|
171
|
+
- 1
|
172
|
+
- 3
|
173
|
+
- 6
|
170
174
|
version: 1.3.6
|
171
|
-
none: false
|
172
175
|
requirements: []
|
176
|
+
|
173
177
|
rubyforge_project:
|
174
178
|
rubygems_version: 1.8.25
|
175
179
|
signing_key:
|
176
180
|
specification_version: 3
|
177
181
|
summary: Ruby wrapper for the Mt. Gox Trade API
|
178
|
-
test_files:
|
182
|
+
test_files:
|
179
183
|
- spec/faraday/response_spec.rb
|
180
184
|
- spec/fixtures/address.json
|
181
185
|
- spec/fixtures/balance.json
|
metadata.gz.sig
CHANGED
Binary file
|