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 CHANGED
Binary file
data/LICENSE.md CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Erik Michaels-Ober
1
+ Copyright (c) 2011-2013 Erik Michaels-Ober
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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 should be considered
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 personally responsible for providing patches in a
113
- timely fashion. If critical issues for a particular implementation exist at the
114
- time of a major release, support for that Ruby version may be dropped.
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]: https://github.com/sferik/mtgox/blob/master/LICENSE.md
119
+ [license]: LICENSE.md
@@ -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 'faraday_middleware'
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 FaradayMiddleware::ParseJson
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
@@ -13,7 +13,7 @@ module MtGox
13
13
 
14
14
  # @return [Integer]
15
15
  def self.patch
16
- 1
16
+ 2
17
17
  end
18
18
 
19
19
  # @return [String, NilClass]
@@ -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 'faraday_middleware', '~> 0.8'
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
- version: 0.8.1
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
- - !binary |-
13
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMakNDQWhhZ0F3SUJB
14
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE5TVE4d0RRWURWUVFEREFaelpt
15
- VnkKYVdzeEZUQVRCZ29Ka2lhSmsvSXNaQUVaRmdWbmJXRnBiREVUTUJFR0Nn
16
- bVNKb21UOGl4a0FSa1dBMk52YlRBZQpGdzB4TXpBeU1ETXhNREF5TWpkYUZ3
17
- MHhOREF5TURNeE1EQXlNamRhTUQweER6QU5CZ05WQkFNTUJuTm1aWEpwCmF6
18
- RVZNQk1HQ2dtU0pvbVQ4aXhrQVJrV0JXZHRZV2xzTVJNd0VRWUtDWkltaVpQ
19
- eUxHUUJHUllEWTI5dE1JSUIKSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4
20
- QU1JSUJDZ0tDQVFFQWwweDVkeDh1S3hpN1Rrckl1eUJVVEpWQgp2MW85M25V
21
- QjlqL3k0TTk2Z1Yycll3QWNpMUpQQnNlTmQ2RnliempvM1lHdUhsN0VRSHVT
22
- SE5hZjFwMmx4ZXcvCnk2MEpYSUpCQmdQY0RLL0tDUDROVUhvZm0wamZvWUQr
23
- SDV1TkpmSENOcTcvWnNUeE90RTNSYTkyczBCQ01UcG0Kd0JNTWxXUjVNdGRF
24
- aElZdUJPNFhobmVqWWdIMEwvN0JMMmx5bW50Vm5zci9hZ2RRb29qUUNOMUlR
25
- bXNSSnZyUgpkdVpSTzN0WnZvSW8xcEJjNEpFZWhEdXFDZXlCZ1BMT3FNb0t0
26
- UWxvbGQxVFFzMWtXVUJLN0tXTUZFaEtDL0tnCnp5ektSSFFvOXlEWXdPdllu
27
- Z29CTFkrVC9sd0NUNGR5c3NkaHpSYmZueEFoYUt1NFNBc3NJd2FDMDF5Vm93
28
- SUQKQVFBQm96a3dOekFKQmdOVkhSTUVBakFBTUIwR0ExVWREZ1FXQkJTMHJ1
29
- RGZSYWs1Y2kxT3BETlgvWmRERWtJcwppVEFMQmdOVkhROEVCQU1DQkxBd0RR
30
- WUpLb1pJaHZjTkFRRUZCUUFEZ2dFQkFISFNNcy9NUDBzT2FMa0V2NEpvCnp2
31
- a20zcW41QTZ0MHZhSHg3NzRjbWVqeU1VKzV3eVN4UmV6c3BMN1VMaDlOZXVL
32
- Mk9oVStPZTNUcHFyQWc1VEsKUjhHUUlMblZ1MkZlbUdBNnNBa1BEbGNQdGdB
33
- NmllSTE5UFpPRjZIVkxtYy9JRC9kUC9OZ1pXV3pFZXFRS21jSwoyK0hNK1NF
34
- RURoWmtTY1lla3c0Wk9lMTY0WnRaRzgxNm9BdjV4MHBHaXRTSWt1bVVwN1Y4
35
- aUVaLzZlaHI3WTllClhPZzRlZXVuNUwvSmptakFSb1cya05kdmtSRDNjMkVl
36
- U0xxV3ZRUnNCbHlwSGZoczZKSnVMbHlaUEdoVTNSL3YKU2YzbFZLcEJDV2dS
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
20
+ aWsxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2NvbT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
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
- version_requirements: !ruby/object:Gem::Requirement
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
- - !ruby/object:Gem::Dependency
74
- prerelease: false
75
- version_requirements: !ruby/object:Gem::Requirement
76
- requirements:
46
+ requirements:
77
47
  - - ~>
78
- - !ruby/object:Gem::Version
79
- version: '1.3'
80
- none: false
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
- version_requirements: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - ~>
94
- - !ruby/object:Gem::Version
95
- version: '1.0'
66
+ requirement: &id002 !ruby/object:Gem::Requirement
96
67
  none: false
97
- type: :development
98
- name: bundler
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
68
+ requirements:
101
69
  - - ~>
102
- - !ruby/object:Gem::Version
103
- version: '1.0'
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
- description: Ruby wrapper for the Mt. Gox Trade API. Mt. Gox allows you to trade US
106
- Dollars (USD) for Bitcoins (BTC) or Bitcoins for US Dollars.
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
- files:
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
- require_paths:
150
+
151
+ require_paths:
159
152
  - lib
160
- required_ruby_version: !ruby/object:Gem::Requirement
161
- requirements:
162
- - - ! '>='
163
- - !ruby/object:Gem::Version
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
- required_rubygems_version: !ruby/object:Gem::Requirement
167
- requirements:
168
- - - ! '>='
169
- - !ruby/object:Gem::Version
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