cryptocoincharts_api 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cryptocoincharts_api.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 TM Lee
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,51 @@
1
+ # CryptocoinchartsApi
2
+
3
+ Ruby wrapper for the Cryptocoincharts API (http://www.cryptocoincharts.info/).
4
+ You can get more information about the API at http://www.cryptocoincharts.info/v2/tools/api
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ gem 'cryptocoincharts_api'
11
+
12
+ And then execute:
13
+
14
+ $ bundle
15
+
16
+ Or install it yourself as:
17
+
18
+ $ gem install cryptocoincharts_api
19
+
20
+ ## Usage
21
+
22
+ ### Available Methods
23
+
24
+ list_coins
25
+ trading_pair
26
+ trading_pairs
27
+
28
+ ### Initialize a Client
29
+
30
+ client = CryptocoinchartsApi::Client.new
31
+
32
+ ### List Coins
33
+
34
+ client.list_coins
35
+
36
+ ### Get a Trading Pair
37
+
38
+ client.trading_pair currency_1: 'btc', currency_2: 'ltc'
39
+
40
+ ### Get a List of Trading Pairs
41
+
42
+ client.trading_pairs "ltc_btc,drk_btc,ppc_btc,doge_btc"
43
+
44
+
45
+ ## Contributing
46
+
47
+ 1. Fork it ( http://github.com/<my-github-username>/cryptocoincharts_api/fork )
48
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
49
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
50
+ 4. Push to the branch (`git push origin my-new-feature`)
51
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rake/testtask'
3
+
4
+
5
+ Rake::TestTask.new do |t|
6
+ t.libs << 'lib'
7
+ t.libs << 'test'
8
+ t.test_files = FileList['test/*_test.rb']
9
+ t.verbose = true
10
+ end
11
+ task :default => :test
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cryptocoincharts_api/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cryptocoincharts_api"
8
+ spec.version = CryptocoinchartsApi::VERSION
9
+ spec.authors = ["TM Lee"]
10
+ spec.email = ["tm89lee@gmail.com"]
11
+ spec.summary = %q{Cryptocoincharts API Ruby wrapper for http://www.cryptocoincharts.info/v2/tools/api}
12
+ spec.description = %q{Cryptocoincharts API Ruby wrapper for http://www.cryptocoincharts.info/v2/tools/api}
13
+ spec.homepage = "http://www.cryptocoincharts.info/v2/tools/api"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency('faraday', '~> 0.9.0')
22
+ spec.add_dependency('json', '~> 1.8.1')
23
+ spec.add_development_dependency('fakeweb', "~> 1.3.0")
24
+ spec.add_development_dependency('rake')
25
+ spec.add_development_dependency('debugger')
26
+
27
+ end
@@ -0,0 +1,58 @@
1
+ require "cryptocoincharts_api/version"
2
+ require "cryptocoincharts_api/api"
3
+
4
+ require "faraday"
5
+ require "json"
6
+
7
+ module CryptocoinchartsApi
8
+
9
+ class Client
10
+ include CryptocoinchartsApi::API
11
+
12
+ def initialize; end
13
+
14
+ def self.debug
15
+ @debug ||= false
16
+ end
17
+
18
+ def self.debug=(v)
19
+ @debug = !!v
20
+ end
21
+
22
+ API_VERSION = 'v2'
23
+ BASE_URL = "http://www.cryptocoincharts.info/#{API_VERSION}/api/"
24
+
25
+ private
26
+
27
+ def api_call(method_name, options, verb=:get)
28
+ response = connection(method_name, options, verb)
29
+ puts response.inspect if self.class.debug
30
+ parse_response response
31
+ end
32
+
33
+ def parse_response(response)
34
+ if response.status.to_i == 200
35
+ JSON.parse response.body, symbolize_names: true
36
+ else
37
+ raise response.status.to_s
38
+ end
39
+ end
40
+
41
+ def connection(method_name, options, verb)
42
+ conn = Faraday.new(:url => BASE_URL) do |faraday|
43
+ faraday.request :url_encoded
44
+ faraday.response(:logger) if self.class.debug
45
+ faraday.adapter Faraday.default_adapter
46
+ faraday.headers['User-Agent'] = "CryptocoinchartsAPI rubygem v#{VERSION}"
47
+ end
48
+
49
+ case verb
50
+ when :put then conn.put(method_name, options)
51
+ when :post then conn.post(method_name, options)
52
+ when :delete then conn.delete(method_name, options)
53
+ else conn.get(method_name, options)
54
+ end
55
+ end
56
+
57
+ end
58
+ end
@@ -0,0 +1,19 @@
1
+ module CryptocoinchartsApi
2
+ module API
3
+
4
+ def list_coins(options={})
5
+ api_call "listCoins", options
6
+ end
7
+
8
+ def trading_pair(options={})
9
+ currency_1 = options.delete(:currency_1)
10
+ currency_2 = options.delete(:currency_2)
11
+ api_call "tradingPair/#{currency_1}_#{currency_2}", options
12
+ end
13
+
14
+ def trading_pairs(pairs)
15
+ api_call "tradingPairs", pairs, :post
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,3 @@
1
+ module CryptocoinchartsApi
2
+ VERSION = "0.0.2"
3
+ end
@@ -0,0 +1,33 @@
1
+ require 'minitest_helper'
2
+ require 'cryptocoincharts_api'
3
+ require 'debugger'
4
+
5
+ class CryptocoinchartsApiTest < MiniTest::Unit::TestCase
6
+
7
+ def setup
8
+ @client = CryptocoinchartsApi::Client.new
9
+ end
10
+
11
+ def test_list_coins
12
+ stub_get("http://www.cryptocoincharts.info/v2/api/listCoins", 'list_coins.json')
13
+ result = @client.list_coins
14
+ assert_equal result.first[:name], "FourtyTwoCoin"
15
+ assert_equal result.first[:website], "http://fourtytwo42.com/"
16
+ assert_equal result.size, 265
17
+ end
18
+
19
+ def test_trading_pair
20
+ stub_get("http://www.cryptocoincharts.info/v2/api/tradingPair/drk_btc", 'trading_pair.json')
21
+ result = @client.trading_pair currency_1: 'drk', currency_2: 'btc'
22
+ assert_equal result[:id], "drk/btc"
23
+ assert_equal result[:price], "0.00122751"
24
+ assert_equal result[:best_market], "cryptsy"
25
+ end
26
+
27
+ def test_trading_pairs
28
+ stub_post("http://www.cryptocoincharts.info/v2/api/tradingPairs", 'trading_pairs.json')
29
+ result = @client.trading_pairs "ltc_btc,drk_btc,ppc_btc,doge_btc"
30
+ assert_equal result.size, 10
31
+ end
32
+
33
+ end
@@ -0,0 +1 @@
1
+ [{"id":"42","name":"FourtyTwoCoin","website":"http:\/\/fourtytwo42.com\/","price_btc":"23.00600001","volume_btc":"1.76656354498118"},{"id":"adt","name":"Android Token","website":"","price_btc":"0.00000001","volume_btc":"2.02041692032897"},{"id":"air","name":"AIR","website":"","price_btc":"0.00201000","volume_btc":"11.8878774801269"},{"id":"alb","name":"ALB","website":"","price_btc":"0.00000001","volume_btc":"1.45000001339213e-06"},{"id":"alf","name":"AlphaCoin","website":"http:\/\/cur.lv\/5rzs5","price_btc":"0.00000160","volume_btc":"0.139502898622595"},{"id":"alp","name":"ALP","website":"","price_btc":"0.00000251","volume_btc":"0"},{"id":"amc","name":"AmericanCoin","website":"","price_btc":"0.00000269","volume_btc":"0.317382079489379"},{"id":"anc","name":"AnonCoin","website":"http:\/\/anoncoin.net","price_btc":"0.00219358","volume_btc":"13.3584463300981"},{"id":"ant","name":"ANT","website":"","price_btc":"0.00010000","volume_btc":"0.0199719422962517"},{"id":"aph","name":"APH","website":"","price_btc":"0.00450000","volume_btc":"21.8632596023381"},{"id":"arg","name":"Argentum","website":"","price_btc":"0.00004413","volume_btc":"0.90201426204294"},{"id":"asc","name":"ASC","website":"","price_btc":"0.00000070","volume_btc":"4.01975831945269"},{"id":"asr","name":"AstroCoin","website":"","price_btc":"0.00110989","volume_btc":"0.0191180901601911"},{"id":"atp","name":"ATP","website":"","price_btc":"0.04300000","volume_btc":"1.22539131521626"},{"id":"aur","name":"Auroracoin","website":"http:\/\/www.auroracoin.org\/","price_btc":"0.01610002","volume_btc":"498.091261101644"},{"id":"bc","name":"BC","website":"","price_btc":"0.00002015","volume_btc":"2.58452822217169"},{"id":"bcx","name":"BCX","website":"","price_btc":"0.00000614","volume_btc":"0.40435038695432"},{"id":"bec","name":"BeaoCoin","website":"http:\/\/cur.lv\/62fdg","price_btc":"0.00051034","volume_btc":"0"},{"id":"ben","name":"BEN","website":"","price_btc":"0.00002080","volume_btc":"0.270890931766189"},{"id":"bet","name":"BET","website":"","price_btc":"0.00000919","volume_btc":"2.52510529761397"},{"id":"bfc","name":"BFC","website":"","price_btc":"0.00000048","volume_btc":"0"},{"id":"bil","name":"BillionCoin","website":"http:\/\/billioncoin.net\/","price_btc":"0.00000012","volume_btc":"0.241886275599631"},{"id":"blc","name":"Blakecoin","website":"http:\/\/www.blakecoin.org\/","price_btc":"0.00002149","volume_btc":"0.10816854712175"},{"id":"blk","name":"BLK","website":"","price_btc":"0.00001150","volume_btc":"0"},{"id":"boc","name":"Bountycoin","website":"http:\/\/www.bountycoin.org\/","price_btc":"0.00000163","volume_btc":"0"},{"id":"bqc","name":"BBQCoin","website":"","price_btc":"0.00000881","volume_btc":"0.686232787391748"},{"id":"btb","name":"BitBar","website":"","price_btc":"0.05124636","volume_btc":"2.66415135610623"},{"id":"btc","name":"Bitcoin","website":"http:\/\/bitcoin.org","price_btc":"1.00000000","volume_btc":"88402.6737868493"},{"id":"bte","name":"Bytecoin","website":"","price_btc":"0.00007049","volume_btc":"12.6256497087306"},{"id":"btg","name":"Bitgem","website":"http:\/\/cur.lv\/5rzsu","price_btc":"0.00434882","volume_btc":"0.991682860119909"},{"id":"btq","name":"BTQ","website":"","price_btc":"0.00001030","volume_btc":"0.000449258615844883"},{"id":"btr","name":"BTR","website":"","price_btc":"0.00000102","volume_btc":"0"},{"id":"buk","name":"BUK","website":"","price_btc":"0.00011415","volume_btc":"0.663350913493172"},{"id":"c2","name":"C2","website":"","price_btc":"0.00000999","volume_btc":"0.00443440990056843"},{"id":"cach","name":"CACHeCoin","website":"http:\/\/www.cachecoin.org","price_btc":"0.00597841","volume_btc":"156.341576020234"},{"id":"cage","name":"Cagecoin","website":"http:\/\/www.cagecoin.com\/","price_btc":"0.00000001","volume_btc":"0.406207019910463"},{"id":"cap","name":"CAP","website":"","price_btc":"0.00001310","volume_btc":"0.475475809842465"},{"id":"cash","name":"Cash","website":"http:\/\/www.cash-coin.org\/","price_btc":"0.00002400","volume_btc":"7.12641619548606"},{"id":"cat","name":"CatCoin","website":"","price_btc":"0.00029493","volume_btc":"2.69368230788314"},{"id":"cdc","name":"Cloudcoin","website":"","price_btc":"0.00003600","volume_btc":"0"},{"id":"cent","name":"Pennies","website":"http:\/\/cur.lv\/5rzpo","price_btc":"0.00000000","volume_btc":"0"},{"id":"cga","name":"CGA","website":"","price_btc":"0.00274000","volume_btc":"0.838740034261718"},{"id":"cgb","name":"CryptogenicBullion","website":"https:\/\/cryptogenicbullion.org","price_btc":"0.00057529","volume_btc":"9.56961367520015"},{"id":"cin","name":"CIN","website":"","price_btc":"0.00001400","volume_btc":"0.134265170563594"},{"id":"clr","name":"CopperLark","website":"http:\/\/cur.lv\/5rzqi","price_btc":"0.00015800","volume_btc":"6.85926957799711"},{"id":"cmc","name":"Cosmoscoin","website":"","price_btc":"0.00007282","volume_btc":"0.613556447962467"},{"id":"cnc","name":"CHNCoin","website":"","price_btc":"0.00000806","volume_btc":"1.53746072359517"},{"id":"cnote","name":"CNOTE","website":"","price_btc":"0.00000147","volume_btc":"0.101285087383644"},{"id":"cny","name":"CNY","website":"","price_btc":"0.00000000","volume_btc":"0"},{"id":"coin","name":"COIN","website":"http:\/\/coin-project.org\/","price_btc":"0.00000031","volume_btc":"0.140200257490505"},{"id":"col","name":"ColossusCoin","website":"http:\/\/cur.lv\/5rzrc","price_btc":"0.00000001","volume_btc":"4.19175635727594"},{"id":"con","name":"CON","website":"","price_btc":"0.00000501","volume_btc":"0.132395041516247"},{"id":"corg","name":"CorgiCoin","website":"http:\/\/corgicoin.com\/","price_btc":"0.00000001","volume_btc":"1.22275664355772"},{"id":"cpr","name":"CopperBars","website":"","price_btc":"0.01191152","volume_btc":"0.45231748711422"},{"id":"crc","name":"CraftCoin","website":"","price_btc":"0.00005555","volume_btc":"1.44953745452221"},{"id":"csc","name":"CasinoCoin","website":"","price_btc":"0.00000414","volume_btc":"1.71476032916689"},{"id":"ctm","name":"Continuumcoin","website":"http:\/\/www.continuumcoin.com\/","price_btc":"0.00000002","volume_btc":"0"},{"id":"dbl","name":"Doubloons","website":"","price_btc":"0.00000979","volume_btc":"0.22535959134937"},{"id":"dem","name":"Deutsche eMark","website":"http:\/\/www.deutsche-emark.org\/","price_btc":"0.00001543","volume_btc":"1.21058926565397"},{"id":"dgb","name":"DigiByte","website":"http:\/\/www.digibyte.co\/","price_btc":"0.00000054","volume_btc":"8.71787951008264"},{"id":"dgc","name":"Digitalcoin","website":"","price_btc":"0.00006760","volume_btc":"12.0924380641069"},{"id":"diem","name":"DIEM","website":"","price_btc":"0.00000001","volume_btc":"0.56990454942754"},{"id":"dime","name":"Dimecoin","website":"http:\/\/cur.lv\/62f4x","price_btc":"0.00000001","volume_btc":"2.67623945535713"},{"id":"dmd","name":"Diamond","website":"http:\/\/cur.lv\/5rzsr","price_btc":"0.00015084","volume_btc":"2.26522933191154"},{"id":"doge","name":"DogeCoin","website":"http:\/\/cur.lv\/5rztu","price_btc":"0.00000127","volume_btc":"10718.6747069098"},{"id":"drk","name":"Darkcoin","website":"http:\/\/www.darkcoin.io\/","price_btc":"0.00123898","volume_btc":"172.509617622418"},{"id":"dsc","name":"DSC","website":"","price_btc":"0.00000403","volume_btc":"0"},{"id":"dtc","name":"Datacoin","website":"http:\/\/datacoin.info","price_btc":"0.00010000","volume_btc":"0.3631945600373"},{"id":"duck","name":"DUCK","website":"","price_btc":"3.25000200","volume_btc":"0.0949883209957921"},{"id":"dvc","name":"Devcoin","website":"http:\/\/cur.lv\/5rzqs","price_btc":"0.00000034","volume_btc":"7.63589851189177"},{"id":"eac","name":"EarthCoin","website":"http:\/\/cur.lv\/62f4i","price_btc":"0.00000015","volume_btc":"6.74373206387492"},{"id":"ebt","name":"Electronic Benefit Transfer","website":"http:\/\/ebt-coin.com\/","price_btc":"0.00000032","volume_btc":"0.779620160322338"},{"id":"elc","name":"ElaCoin","website":"http:\/\/github.com\/elacoin\/elacoin","price_btc":"0.00022967","volume_btc":"3.15043638518546"},{"id":"elp","name":"ELP","website":"","price_btc":"0.00000073","volume_btc":"0.190507479199209"},{"id":"emc2","name":"EMC2","website":"","price_btc":"0.00000302","volume_btc":"0.545664177395338"},{"id":"emd","name":"Emerald","website":"","price_btc":"0.00000510","volume_btc":"0.683182092092466"},{"id":"emo","name":"EMO","website":"","price_btc":"0.00000000","volume_btc":"0.087369282540446"},{"id":"etok","name":"eToken","website":"","price_btc":"0.00005261","volume_btc":"0.00671979978960735"},{"id":"eur","name":"EUR","website":"","price_btc":"0.00000000","volume_btc":"0.22326028423828"},{"id":"exc","name":"Extremecoin","website":"http:\/\/www.extremecoin.org","price_btc":"0.00023000","volume_btc":"0"},{"id":"exe","name":"Execoin","website":"http:\/\/www.execoin.net\/","price_btc":"0.00006114","volume_btc":"2.39727083443007"},{"id":"ezc","name":"EZCoin","website":"","price_btc":"0.00000636","volume_btc":"2.24923024504963"},{"id":"ffc","name":"FireFlyCoin","website":"http:\/\/cur.lv\/62f5o","price_btc":"0.00000049","volume_btc":"0.930655524854956"},{"id":"flap","name":"Flappycoin","website":"http:\/\/flappycoin.info\/","price_btc":"0.00000001","volume_btc":"19.7446983241671"},{"id":"flo","name":"FlorinCoin","website":"","price_btc":"0.00001501","volume_btc":"2.7896392889457"},{"id":"fox","name":"FOX","website":"","price_btc":"0.00000050","volume_btc":"0.0267053693387425"},{"id":"frc","name":"Freicoin","website":"","price_btc":"0.00003894","volume_btc":"1.85827885544859"},{"id":"fre","name":"FRE","website":"","price_btc":"0.00000330","volume_btc":"0"},{"id":"frk","name":"FrankoCoin","website":"","price_btc":"0.00080062","volume_btc":"1.40290925758745"},{"id":"frq","name":"FRQ","website":"","price_btc":"0.00000014","volume_btc":"0.43699562148322"},{"id":"fry","name":"FRY","website":"","price_btc":"0.00000010","volume_btc":"0"},{"id":"fsc","name":"FSC","website":"","price_btc":"0.00000055","volume_btc":"0.426200067791797"},{"id":"fst","name":"FastCoin","website":"","price_btc":"0.00000281","volume_btc":"2.75753063643297"},{"id":"ftc","name":"Feathercoin","website":"","price_btc":"0.00030565","volume_btc":"12.80897954481"},{"id":"fz","name":"Frozen","website":"","price_btc":"0.00004496","volume_btc":"0.657242079332118"},{"id":"gac","name":"GAC","website":"","price_btc":"0.00004000","volume_btc":"0.0284999999566935"},{"id":"gdc","name":"GrandCoin","website":"","price_btc":"0.00000021","volume_btc":"0.618708943784441"},{"id":"ghc","name":"GHC","website":"","price_btc":"0.00000046","volume_btc":"2.74206436797976"},{"id":"gil","name":"Gilcoin","website":"","price_btc":"0.00000000","volume_btc":"0"},{"id":"glb","name":"Globe","website":"","price_btc":"0.00005500","volume_btc":"1.63017077437144"},{"id":"glc","name":"Globalcoin","website":"","price_btc":"0.00000266","volume_btc":"0.893600994953886"},{"id":"gld","name":"GoldCoin","website":"","price_btc":"0.00001626","volume_btc":"1.08609964547507"},{"id":"glx","name":"Galaxycoin","website":"","price_btc":"0.00000132","volume_btc":"0.120822486347606"},{"id":"gme","name":"Gamecoins","website":"","price_btc":"0.00000020","volume_btc":"0.261090889155594"},{"id":"gpu","name":"GPU","website":"","price_btc":"0.00000019","volume_btc":"0.0938476134906523"},{"id":"gpuc","name":"GPUC","website":"","price_btc":"0.00000017","volume_btc":"1.15436094169854"},{"id":"gra","name":"Graincoin","website":"http:\/\/graincoin.webs.com\/","price_btc":"0.00000002","volume_btc":"0.195738192872377"},{"id":"grc","name":"Gridcoin","website":"http:\/\/www.gridcoin.us","price_btc":"0.00003900","volume_btc":"1.08199074381355"},{"id":"grump","name":"GRUMP","website":"","price_btc":"0.00000000","volume_btc":"0.11207237512053"},{"id":"grw","name":"GRW","website":"","price_btc":"0.00000288","volume_btc":"0"},{"id":"hbn","name":"HoboNickels","website":"http:\/\/cur.lv\/5rztl","price_btc":"0.00012099","volume_btc":"2.69697347436158"},{"id":"hpc","name":"HPC","website":"","price_btc":"0.00001500","volume_btc":"0.000778233999881195"},{"id":"huc","name":"Huntercoin","website":"http:\/\/huntercoin.org","price_btc":"0.00070100","volume_btc":"1.50350759550929"},{"id":"hvc","name":"HVC","website":"","price_btc":"0.00002449","volume_btc":"1.61498288585426"},{"id":"hyc","name":"Hypercoin","website":"http:\/\/cur.lv\/5rzso","price_btc":"0.00000000","volume_btc":"0"},{"id":"i0c","name":"I0C","website":"","price_btc":"0.00002798","volume_btc":"0"},{"id":"icn","name":"ICN","website":"","price_btc":"0.00000610","volume_btc":"0.161248342853223"},{"id":"ifc","name":"InfiniteCoin","website":"","price_btc":"0.00000008","volume_btc":"21.1696356929405"},{"id":"iqd","name":"IQD","website":"","price_btc":"0.00012000","volume_btc":"1.04435441498572"},{"id":"isk","name":"ISK","website":"","price_btc":"0.00002688","volume_btc":"0"},{"id":"ixc","name":"IXCoin","website":"","price_btc":"0.00008821","volume_btc":"0.800613347296658"},{"id":"jkc","name":"Junkcoin","website":"","price_btc":"0.00001288","volume_btc":"0.839629857597825"},{"id":"karm","name":"Karmacoin","website":"http:\/\/karmacoin.info\/","price_btc":"0.00000003","volume_btc":"0"},{"id":"kdc","name":"KlondikeCoin","website":"http:\/\/klondikecoin.com\/","price_btc":"0.00004357","volume_btc":"0.587430808383942"},{"id":"kgc","name":"KrugerCoin","website":"http:\/\/cur.lv\/5rzr7","price_btc":"0.00000120","volume_btc":"0.346795570250606"},{"id":"krn","name":"KRN","website":"","price_btc":"4764.17341591","volume_btc":"16.4695228891796"},{"id":"lbw","name":"Lebowskis","website":"http:\/\/cur.lv\/5rzt2","price_btc":"0.00000000","volume_btc":"0"},{"id":"ldc","name":"LDC","website":"","price_btc":"0.00000001","volume_btc":"0.213745684057512"},{"id":"leaf","name":"Leafcoin","website":"http:\/\/leafco.in\/","price_btc":"0.00000002","volume_btc":"3.16337099260513"},{"id":"lgbt","name":"LGBT","website":"","price_btc":"0.00000008","volume_btc":"0.0571402679096155"},{"id":"lk7","name":"LK7","website":"","price_btc":"0.00000062","volume_btc":"0.235813969266019"},{"id":"lky","name":"LuckyCoin","website":"http:\/\/cur.lv\/5rzsc","price_btc":"0.00001651","volume_btc":"4.74179898186412"},{"id":"lot","name":"LottoCoin","website":"http:\/\/cur.lv\/5rzq8","price_btc":"0.00000001","volume_btc":"7.70227209666043"},{"id":"love","name":"Lovecoin","website":"http:\/\/lovecoin.info\/","price_btc":"0.00000285","volume_btc":"0"},{"id":"ltc","name":"Litecoin","website":"http:\/\/cur.lv\/5rzqv","price_btc":"0.02837514","volume_btc":"98489.0280098363"},{"id":"max","name":"Maxcoin","website":"","price_btc":"0.00015101","volume_btc":"110.850581981971"},{"id":"mcx","name":"MCX","website":"http:\/\/cur.lv\/5rzsn","price_btc":"0.16899990","volume_btc":"23.6294631361961"},{"id":"mec","name":"MegaCoin","website":"http:\/\/cur.lv\/5rzsl","price_btc":"0.00029305","volume_btc":"34.5116165086336"},{"id":"med","name":"MED","website":"","price_btc":"0.00001376","volume_btc":"0.126436836377252"},{"id":"mem","name":"MemeCoin","website":"","price_btc":"0.00000000","volume_btc":"0.026698685119068"},{"id":"meow","name":"Kittehcoin","website":"","price_btc":"0.00000005","volume_btc":"10.2359914871003"},{"id":"mim","name":"MIM","website":"","price_btc":"0.00000001","volume_btc":"0"},{"id":"mint","name":"Mintcoin","website":"http:\/\/mintcoin.cc\/","price_btc":"0.00000013","volume_btc":"6.42504790702446"},{"id":"mmc","name":"MemoryCoin","website":"http:\/\/memorycoin.org","price_btc":"0.00003631","volume_btc":"0.0695242265355773"},{"id":"mnc","name":"Mincoin","website":"","price_btc":"0.00045505","volume_btc":"13.1115565874788"},{"id":"moon","name":"MoonCoin","website":"http:\/\/mooncoin.info\/","price_btc":"0.00000002","volume_btc":"9.62065354745939"},{"id":"mrc","name":"MRC","website":"","price_btc":"0.00000001","volume_btc":"1.47975097746848"},{"id":"msc","name":"Mastercoin","website":"http:\/\/cur.lv\/5rzpc","price_btc":"0.10290000","volume_btc":"17.6879765801132"},{"id":"mst","name":"MasterCoin","website":"http:\/\/cur.lv\/5rzq0","price_btc":"0.00000145","volume_btc":"0.1220572255102"},{"id":"mtc","name":"MTC","website":"","price_btc":"0.00250000","volume_btc":"0.00805648043751717"},{"id":"mts","name":"MTS","website":"","price_btc":"0.00002126","volume_btc":"0.182655300071929"},{"id":"mvc","name":"MVC","website":"","price_btc":"0.00000001","volume_btc":"0.015749822993256"},{"id":"mxb","name":"mcxBUX","website":"https:\/\/mcxnow.com?r=xchrix","price_btc":"0.00161587","volume_btc":"21.9110153627116"},{"id":"myr","name":"Myriad","website":"","price_btc":"0.00000218","volume_btc":"8.0854175761342"},{"id":"mzc","name":"Mazacoin","website":"http:\/\/www.mazacoin.org\/","price_btc":"0.00000543","volume_btc":"26.7963315026791"},{"id":"nan","name":"NanoToken","website":"","price_btc":"0.00000514","volume_btc":"0.0311854672254412"},{"id":"nbl","name":"Nibble","website":"","price_btc":"0.00001859","volume_btc":"0.244156291868421"},{"id":"nec","name":"NEC","website":"","price_btc":"0.00000891","volume_btc":"0.492949931271141"},{"id":"net","name":"Netcoin","website":"http:\/\/netcoinfoundation.org\/","price_btc":"0.00000273","volume_btc":"6.89715020034019"},{"id":"nib","name":"NIB","website":"","price_btc":"0.00004950","volume_btc":"0"},{"id":"nka","name":"Incakoin","website":"http:\/\/cur.lv\/62f6z","price_btc":"0.00000009","volume_btc":"0.00957022254640539"},{"id":"nmc","name":"Namecoin","website":"","price_btc":"0.00520045","volume_btc":"14.6062349782645"},{"id":"nobl","name":"NobleCoin","website":"https:\/\/www.noblemovement.com\/","price_btc":"0.00000018","volume_btc":"0.426399408490397"},{"id":"nok","name":"NOK","website":"","price_btc":"0.00000000","volume_btc":"0"},{"id":"nrb","name":"NoirBits","website":"","price_btc":"0.00001318","volume_btc":"0.292100758379092"},{"id":"nrs","name":"NRS","website":"","price_btc":"0.00015000","volume_btc":"2.92948473611614"},{"id":"nvc","name":"Novacoin","website":"","price_btc":"0.01031717","volume_btc":"1.2900253959815"},{"id":"nwc","name":"Networkcoin","website":"http:\/\/cur.lv\/62fel","price_btc":"0.00024164","volume_btc":"0"},{"id":"nxt","name":"Nxt","website":"http:\/\/cur.lv\/5rzp0","price_btc":"0.00005415","volume_btc":"106.845319570241"},{"id":"nyan","name":"Nyancoin","website":"http:\/\/nyancoin.org","price_btc":"0.00000267","volume_btc":"1.59353704544748"},{"id":"nym","name":"NYM","website":"","price_btc":"0.00000011","volume_btc":"0.00522546735217588"},{"id":"ogc","name":"OnlineGamingCoin","website":"http:\/\/cur.lv\/62f9g","price_btc":"0.00000011","volume_btc":"0.0149747833559104"},{"id":"oly","name":"OLY","website":"","price_btc":"0.00000049","volume_btc":"0.00550663888816416"},{"id":"orb","name":"Orbitcoin","website":"http:\/\/cur.lv\/62fe4","price_btc":"0.00005073","volume_btc":"0.1804333641026"},{"id":"osc","name":"OSC","website":"","price_btc":"0.00000666","volume_btc":"0.273121564870962"},{"id":"pand","name":"PAND","website":"","price_btc":"0.00000461","volume_btc":"0.0226007429967774"},{"id":"panda","name":"PANDA","website":"","price_btc":"0.00000001","volume_btc":"0.0064020677788669"},{"id":"pcc","name":"PCC","website":"","price_btc":"0.00000400","volume_btc":"0.538319371960824"},{"id":"peng","name":"PENG","website":"","price_btc":"0.00000005","volume_btc":"0.14435658390954"},{"id":"pho","name":"PHO","website":"","price_btc":"0.00000002","volume_btc":"0"},{"id":"phs","name":"PhilosopherStone","website":"","price_btc":"0.00011512","volume_btc":"0.370032386432285"},{"id":"pi","name":"PI","website":"","price_btc":"15.00000000","volume_btc":"0.0120831001549959"},{"id":"pig","name":"Piggycoin","website":"http:\/\/piggy-coin.com\/","price_btc":"0.00000021","volume_btc":"0.123291988352321"},{"id":"pmc","name":"PMC","website":"","price_btc":"0.00011000","volume_btc":"0.150684380874736"},{"id":"points","name":"CryptsyPoints","website":"http:\/\/cur.lv\/5rzo4","price_btc":"0.00079782","volume_btc":"2.47858667839319"},{"id":"pot","name":"POT","website":"","price_btc":"0.00004500","volume_btc":"0"},{"id":"ppc","name":"Peercoin","website":"http:\/\/cur.lv\/5rzp4","price_btc":"0.00494790","volume_btc":"22.8623200178366"},{"id":"ppl","name":"PeopleCoin","website":"","price_btc":"0.00006476","volume_btc":"0"},{"id":"prc","name":"PRC","website":"","price_btc":"0.00004609","volume_btc":"0.404862564882023"},{"id":"prt","name":"Particle","website":"http:\/\/www.bitparticle.com\/","price_btc":"0.00000140","volume_btc":"0.155293247687621"},{"id":"pt","name":"PT","website":"","price_btc":"0.00000070","volume_btc":"0.0971709546756756"},{"id":"pts","name":"ProtoShares","website":"http:\/\/cur.lv\/5rztd","price_btc":"0.01099000","volume_btc":"8.52831553341821"},{"id":"pwc","name":"PWC","website":"","price_btc":"0.00000003","volume_btc":"0"},{"id":"pxc","name":"PhenixCoin","website":"","price_btc":"0.00000280","volume_btc":"0.345679718132778"},{"id":"pxl","name":"PixelCoin","website":"http:\/\/www.pxlcoin.com\/","price_btc":"0.00002220","volume_btc":"0"},{"id":"pyc","name":"PayCoin","website":"http:\/\/cur.lv\/5rzsj","price_btc":"0.00001974","volume_btc":"0.0372831558488542"},{"id":"q2c","name":"Q2C","website":"","price_btc":"0.00000061","volume_btc":"1.23215791843541"},{"id":"qqc","name":"QQcoin","website":"http:\/\/qqco.in\/","price_btc":"0.00000471","volume_btc":"1.32359659764916"},{"id":"qrk","name":"Quarkcoin","website":"http:\/\/cur.lv\/5rzq3","price_btc":"0.00005090","volume_btc":"37.5825788159766"},{"id":"rch","name":"Richcoin","website":"","price_btc":"0.00000007","volume_btc":"0.0049869990625"},{"id":"rdd","name":"Reddcoin","website":"http:\/\/www.reddcoin.com\/","price_btc":"0.00000006","volume_btc":"11.679751518832"},{"id":"rec","name":"RealCoin","website":"","price_btc":"0.00000006","volume_btc":"0.0189803485157676"},{"id":"red","name":"RedCoin","website":"http:\/\/cur.lv\/5rzrn","price_btc":"0.00000500","volume_btc":"1.12355524014511"},{"id":"redd","name":"Reddcoin","website":"http:\/\/www.reddcoin.com","price_btc":"0.00000006","volume_btc":"1.71543452346305"},{"id":"ric","name":"Riecoin","website":"http:\/\/riecoin.org\/","price_btc":"0.00034000","volume_btc":"0.839019315375481"},{"id":"rpc","name":"RonPaulCoin","website":"http:\/\/www.ronpaulcoin.com","price_btc":"0.00094003","volume_btc":"1.41373199452868"},{"id":"rpd","name":"RPD","website":"","price_btc":"0.00000434","volume_btc":"0"},{"id":"rqc","name":"RQC","website":"","price_btc":"0.00000005","volume_btc":"0"},{"id":"ruby","name":"RUBY","website":"","price_btc":"0.00000151","volume_btc":"0.00567800452972733"},{"id":"rur","name":"Russian ruble","website":"","price_btc":"0.00000000","volume_btc":"0"},{"id":"ryc","name":"RoyalCoin","website":"","price_btc":"0.00000387","volume_btc":"0.138162109610959"},{"id":"sat","name":"SAT","website":"","price_btc":"0.00000003","volume_btc":"2.39389810850844"},{"id":"sav","name":"SAV","website":"","price_btc":"0.00000005","volume_btc":"0"},{"id":"sbc","name":"StableCoin","website":"","price_btc":"0.00000401","volume_btc":"0.491266085718376"},{"id":"sc","name":"SC","website":"","price_btc":"0.00018120","volume_btc":"1.0834911567963"},{"id":"skc","name":"SKC","website":"","price_btc":"0.00000100","volume_btc":"0.000199999994947575"},{"id":"sll","name":"SLL","website":"","price_btc":"0.00000667","volume_btc":"0"},{"id":"smc","name":"Smartcoin","website":"http:\/\/getsmartcoin.com\/","price_btc":"0.00000618","volume_btc":"3.52429176494524"},{"id":"soc","name":"SOC","website":"","price_btc":"0.00000003","volume_btc":"0.180441832394536"},{"id":"spa","name":"SpainCoin","website":"http:\/\/spaincoin.org\/","price_btc":"0.00102000","volume_btc":"81.054052368767"},{"id":"spt","name":"Spots","website":"","price_btc":"0.00000445","volume_btc":"0.238165659291553"},{"id":"src","name":"SecureCoin","website":"http:\/\/cur.lv\/5rzsx","price_btc":"0.00030023","volume_btc":"2.28937433590181"},{"id":"stc","name":"STC","website":"","price_btc":"0.00000275","volume_btc":"0.00244144154472649"},{"id":"str","name":"StarCoin","website":"http:\/\/cur.lv\/5rzow","price_btc":"0.00000046","volume_btc":"0.309655247619958"},{"id":"sun","name":"Suncoin","website":"http:\/\/reddit.com\/r\/suncoin","price_btc":"0.00000564","volume_btc":"0.0010082875811832"},{"id":"svc","name":"SVC","website":"","price_btc":"0.00000095","volume_btc":"3.9947613430023e-05"},{"id":"sxc","name":"Sexcoin","website":"http:\/\/cur.lv\/5rzph","price_btc":"0.00000566","volume_btc":"6.42056178063658"},{"id":"syn","name":"SYN","website":"","price_btc":"0.00000900","volume_btc":"0"},{"id":"tag","name":"TagCoin","website":"","price_btc":"0.00040896","volume_btc":"8.7123282509856"},{"id":"tak","name":"Takcoin","website":"","price_btc":"0.00000106","volume_btc":"3.97562363397446"},{"id":"tea","name":"Teacoin","website":"http:\/\/www.teacoin.net\/","price_btc":"0.00000109","volume_btc":"0.0084580818656832"},{"id":"tek","name":"TEK","website":"","price_btc":"0.00014112","volume_btc":"0.483465161916683"},{"id":"tes","name":"TeslaCoin","website":"http:\/\/www.teslacoins.com\/","price_btc":"0.00000121","volume_btc":"0.00805727024965108"},{"id":"tgc","name":"Tigercoin","website":"","price_btc":"0.00000260","volume_btc":"0.0870882053568494"},{"id":"tips","name":"Fedoracoin","website":"http:\/\/cur.lv\/62fav","price_btc":"0.00000001","volume_btc":"12.8795372066243"},{"id":"tix","name":"Tickets","website":"","price_btc":"0.00000003","volume_btc":"0.92994815828672"},{"id":"trc","name":"Terracoin","website":"","price_btc":"0.00025153","volume_btc":"4.40905004256638"},{"id":"trl","name":"TRL","website":"","price_btc":"0.00000001","volume_btc":"0"},{"id":"ttc","name":"TTC","website":"","price_btc":"0.00000001","volume_btc":"0.00207627130293986"},{"id":"ufc","name":"UFC","website":"","price_btc":"0.00000054","volume_btc":"0"},{"id":"uni","name":"UNI","website":"","price_btc":"0.00000005","volume_btc":"5.30133038409986e-05"},{"id":"uno","name":"Unobtanium","website":"http:\/\/unobtanium.io\/","price_btc":"0.00540000","volume_btc":"11.1748596164207"},{"id":"usd","name":"US Dollar","website":"","price_btc":"0.00000000","volume_btc":"0"},{"id":"usde","name":"Unitary Status Dollar eCoin","website":"","price_btc":"0.00000046","volume_btc":"1.68493145541288"},{"id":"utc","name":"UltraCoin","website":"","price_btc":"0.00025802","volume_btc":"18.4346277003279"},{"id":"vel","name":"Velocitycoin","website":"http:\/\/velocitycoin.com\/","price_btc":"0.00000250","volume_btc":"0"},{"id":"ven","name":"VEN","website":"","price_btc":"0.00015385","volume_btc":"0"},{"id":"vtc","name":"VertCoin","website":"http:\/\/vertcoin.org","price_btc":"0.00136002","volume_btc":"73.1071104952207"},{"id":"wdc","name":"WorldCoin","website":"","price_btc":"0.00008849","volume_btc":"57.0499858026179"},{"id":"wiki","name":"WIKI","website":"","price_btc":"0.00000205","volume_btc":"0.0424931962934352"},{"id":"wolf","name":"WOLF","website":"","price_btc":"0.00099820","volume_btc":"37.681100063026"},{"id":"xcp","name":"Counterparty","website":"http:\/\/counterparty.co\/","price_btc":"0.00730000","volume_btc":"0"},{"id":"xiv","name":"Xivra","website":"https:\/\/www.xivra.com","price_btc":"0.00000006","volume_btc":"0.0943850405608855"},{"id":"xjo","name":"JouleCoin","website":"http:\/\/cur.lv\/5rzs1","price_btc":"0.00000533","volume_btc":"3.9124664096089"},{"id":"xnc","name":"XenCoin","website":"","price_btc":"0.00000019","volume_btc":"0.0896582502920505"},{"id":"xpm","name":"PrimeCoin","website":"http:\/\/cur.lv\/5rzt0","price_btc":"0.00189399","volume_btc":"22.8675370533943"},{"id":"xrp","name":"XRP","website":"","price_btc":"0.00002292","volume_btc":"8.52967561634082"},{"id":"yac","name":"Yacoin","website":"http:\/\/www.yacoin.org\/","price_btc":"0.00002277","volume_btc":"1.15549436702721"},{"id":"yang","name":"YANG","website":"","price_btc":"0.00000406","volume_btc":"0.0244071296274342"},{"id":"ybc","name":"YBCoin","website":"http:\/\/cur.lv\/5rzor","price_btc":"0.00390000","volume_btc":"3.83435409557569"},{"id":"yin","name":"YIN","website":"","price_btc":"0.00000368","volume_btc":"0.0155310897389427"},{"id":"zcc","name":"ZcCoin","website":"http:\/\/www.zhaocaibi.com\/?lang=en","price_btc":"0.00007317","volume_btc":"0.2308846997621"},{"id":"zed","name":"Zedcoin","website":"http:\/\/www.zedcoins.com","price_btc":"0.00000405","volume_btc":"1.29849534027926"},{"id":"zeit","name":"ZEIT","website":"","price_btc":"0.00000001","volume_btc":"0.0290528051955334"},{"id":"zet","name":"ZetaCoin","website":"http:\/\/cur.lv\/5rzoe","price_btc":"0.00001014","volume_btc":"4.27617078344541"}]
@@ -0,0 +1 @@
1
+ {"id":"drk\/btc","price":"0.00122751","price_before_24h":"0.00121571","volume_first":"34850.4632461071","volume_second":"172.261041055841","volume_btc":"172.26","best_market":"cryptsy","latest_trade":"2014-03-18 01:43:24"}
@@ -0,0 +1,91 @@
1
+ [{
2
+ "id": "ltc\/cny",
3
+ "price": "105.45000000",
4
+ "price_before_24h": "106.32000000",
5
+ "volume_first": "3474716.24369773",
6
+ "volume_second": "366025867.902357",
7
+ "volume_btc": "98330.99",
8
+ "best_market": "okcoin",
9
+ "latest_trade": "2014-03-18 04:55:53"
10
+ }, {
11
+ "id": "btc\/cny",
12
+ "price": "3723.04000000",
13
+ "price_before_24h": "3832.50000000",
14
+ "volume_first": "69098.5704127084",
15
+ "volume_second": "260026363.223839",
16
+ "volume_btc": "69098.57",
17
+ "best_market": "okcoin",
18
+ "latest_trade": "2014-03-18 04:55:50"
19
+ }, {
20
+ "id": "btc\/usd",
21
+ "price": "615.63000000",
22
+ "price_before_24h": "632.70000000",
23
+ "volume_first": "13933.3546343664",
24
+ "volume_second": "8688688.70579652",
25
+ "volume_btc": "13933.35",
26
+ "best_market": "bitstamp",
27
+ "latest_trade": "2014-03-18 04:47:56"
28
+ }, {
29
+ "id": "doge\/btc",
30
+ "price": "0.00000127",
31
+ "price_before_24h": "0.00000127",
32
+ "volume_first": "499064759.675292",
33
+ "volume_second": "10656.1163361164",
34
+ "volume_btc": "10656.12",
35
+ "best_market": "cryptsy",
36
+ "latest_trade": "2014-03-18 00:50:37"
37
+ }, {
38
+ "id": "ltc\/btc",
39
+ "price": "0.02822014",
40
+ "price_before_24h": "0.02771000",
41
+ "volume_first": "22573.3434676528",
42
+ "volume_second": "724.524732606301",
43
+ "volume_btc": "724.52",
44
+ "best_market": "cryptsy",
45
+ "latest_trade": "2014-03-18 00:50:20"
46
+ }, {
47
+ "id": "btc\/eur",
48
+ "price": "442.54000000",
49
+ "price_before_24h": "457.19066000",
50
+ "volume_first": "515.142155241222",
51
+ "volume_second": "232214.019520759",
52
+ "volume_btc": "515.14",
53
+ "best_market": "kraken",
54
+ "latest_trade": "2014-03-18 04:48:43"
55
+ }, {
56
+ "id": "aur\/btc",
57
+ "price": "0.01610002",
58
+ "price_before_24h": "0.01400200",
59
+ "volume_first": "43837.2792022633",
60
+ "volume_second": "479.966933636651",
61
+ "volume_btc": "479.97",
62
+ "best_market": "cryptsy",
63
+ "latest_trade": "2014-03-18 00:50:19"
64
+ }, {
65
+ "id": "pcc\/btc",
66
+ "price": "0.00000400",
67
+ "price_before_24h": "0.00000750",
68
+ "volume_first": "81374.4853439331",
69
+ "volume_second": "262.77704884889",
70
+ "volume_btc": "262.78",
71
+ "best_market": "c-cex",
72
+ "latest_trade": "2014-03-18 00:11:05"
73
+ }, {
74
+ "id": "drk\/btc",
75
+ "price": "0.00123898",
76
+ "price_before_24h": "0.00130445",
77
+ "volume_first": "35182.5749864578",
78
+ "volume_second": "157.452992415056",
79
+ "volume_btc": "157.45",
80
+ "best_market": "cryptsy",
81
+ "latest_trade": "2014-03-18 00:50:05"
82
+ }, {
83
+ "id": "cach\/btc",
84
+ "price": "0.00597841",
85
+ "price_before_24h": "0.00604994",
86
+ "volume_first": "26072.2444645614",
87
+ "volume_second": "155.363812486641",
88
+ "volume_btc": "155.36",
89
+ "best_market": "cryptsy",
90
+ "latest_trade": "2014-03-18 00:46:17"
91
+ }]
@@ -0,0 +1,57 @@
1
+ require 'minitest/autorun'
2
+ require 'fakeweb'
3
+
4
+ FakeWeb.allow_net_connect = false
5
+
6
+ def fixture_file(filename, options={})
7
+ return '' if filename == ''
8
+
9
+ file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
10
+ fixture = File.read(file_path)
11
+
12
+ case File.extname(file_path)
13
+ when '.json'
14
+ options[:parse] ? JSON.parse(fixture) : fixture
15
+ else
16
+ fixture
17
+ end
18
+ end
19
+
20
+
21
+ def stub_get(url, filename, options={})
22
+ opts = {
23
+ :body => error_or_standard_body(filename, options)
24
+ }.merge(options)
25
+ FakeWeb.register_uri(:get, url, opts)
26
+ end
27
+
28
+ def stub_post(url, filename, options={})
29
+ opts = {
30
+ :body => error_or_standard_body(filename, options),
31
+ }.merge(options)
32
+ FakeWeb.register_uri(:post, url, opts)
33
+ end
34
+
35
+ def stub_delete(url, filename, options={})
36
+ opts = {
37
+ :body => error_or_standard_body(filename, options),
38
+ }.merge(options)
39
+ FakeWeb.register_uri(:delete, url, opts)
40
+ end
41
+
42
+ def stub_put(url, filename, options={})
43
+ opts = {
44
+ :body => error_or_standard_body(filename, options),
45
+ }.merge(options)
46
+ FakeWeb.register_uri(:put, url, opts)
47
+ end
48
+
49
+
50
+ def error_or_standard_body(filename, options)
51
+ error_options = options.delete(:error)
52
+ body = fixture_file(error_options ? 'error_template.json' : filename)
53
+ body = body.gsub(/%error_code%/, error_options[:code])
54
+ .gsub(/%error_type%/, error_options[:type])
55
+ .gsub(/%error_message%/, error_options[:message]) if error_options
56
+ body
57
+ end
metadata ADDED
@@ -0,0 +1,146 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cryptocoincharts_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - TM Lee
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-03-18 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: faraday
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 0.9.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 0.9.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: json
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 1.8.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 1.8.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: fakeweb
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.3.0
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: rake
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: debugger
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ description: Cryptocoincharts API Ruby wrapper for http://www.cryptocoincharts.info/v2/tools/api
95
+ email:
96
+ - tm89lee@gmail.com
97
+ executables: []
98
+ extensions: []
99
+ extra_rdoc_files: []
100
+ files:
101
+ - .gitignore
102
+ - Gemfile
103
+ - LICENSE.txt
104
+ - README.md
105
+ - Rakefile
106
+ - cryptocoincharts_api.gemspec
107
+ - lib/cryptocoincharts_api.rb
108
+ - lib/cryptocoincharts_api/api.rb
109
+ - lib/cryptocoincharts_api/version.rb
110
+ - test/cryptocoincharts_api_test.rb
111
+ - test/fixtures/list_coins.json
112
+ - test/fixtures/trading_pair.json
113
+ - test/fixtures/trading_pairs.json
114
+ - test/minitest_helper.rb
115
+ homepage: http://www.cryptocoincharts.info/v2/tools/api
116
+ licenses:
117
+ - MIT
118
+ post_install_message:
119
+ rdoc_options: []
120
+ require_paths:
121
+ - lib
122
+ required_ruby_version: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ requirements: []
135
+ rubyforge_project:
136
+ rubygems_version: 1.8.23
137
+ signing_key:
138
+ specification_version: 3
139
+ summary: Cryptocoincharts API Ruby wrapper for http://www.cryptocoincharts.info/v2/tools/api
140
+ test_files:
141
+ - test/cryptocoincharts_api_test.rb
142
+ - test/fixtures/list_coins.json
143
+ - test/fixtures/trading_pair.json
144
+ - test/fixtures/trading_pairs.json
145
+ - test/minitest_helper.rb
146
+ has_rdoc: