bank-of-israel 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3a0d5287b3bcaa88d01837ac8a3f4607378d384c
4
+ data.tar.gz: 1701af379038436c7808225f1ef215c4bae59bda
5
+ SHA512:
6
+ metadata.gz: 87f3695a07a93ca034f3eb56c2f8d2d64b275c5dc2fc773713df75e93ad581b96bc1e9524a18f8b6b2827adefa730488d4349523d7cdafaf03b3a56f02ef132c
7
+ data.tar.gz: 2b0576efb85d6a03f083d04f825a3065fe3985039d4a8778898d0c33b6b2c8638f53a0cf1ab0a34b2ad76313d181038281c57d3056e97d8abd106449c97c2fb7
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Dan Evron
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ bank-of-israel
2
+ ==============
3
+
4
+ A simple client for the Bank of Israel Exchange Rates information
5
+
6
+ ## Installation
7
+
8
+ gem install bank-of-israel
9
+
10
+ ## Source and development
11
+
12
+ The source for bank-of-israel is available on [Github](https://github.com/danevron/bank-of-israel)
13
+
14
+ The Gem uses rspec and webmock for testing, do a `bundle install` for all
15
+ the development requirements.
16
+
17
+ ## Usage
18
+
19
+ require 'bank-of-israel'
20
+
21
+ The Gem exposes two methods:
22
+
23
+ 1. BankOfIsrael.rates("YYYYMMDD") - to return the exchange rates for a given date
24
+
25
+ BankOfIsrael.rates("20140530")
26
+
27
+ 2. BankOfIsrael.latest_rates - to return the latest available rates
28
+
29
+ BankOfIsrael.latest_rates
30
+
31
+ ### Respense hash example
32
+
33
+ {:release_date => "2014-05-30",
34
+ :usd=>{:name=>"Dollar", :unit=>"1", :country=>"USA", :rate=>"3.475", :change=>"-0.029"},
35
+ :gbp=>{:name=>"Pound", :unit=>"1", :country=>"Great Britain", :rate=>"5.8158", :change=>"0.11"},
36
+ :jpy=>{:name=>"Yen", :unit=>"100", :country=>"Japan", :rate=>"3.4188", :change=>"-0.114"}}
37
+
38
+ You can find detailed information about the fields [here](http://www.boi.org.il/en/Markets/Pages/explainxml.aspx).
39
+
@@ -0,0 +1,64 @@
1
+ require "multi_xml"
2
+ require 'uri'
3
+ require 'net/http'
4
+
5
+ class BankOfIsrael
6
+
7
+ def self.rates(date)
8
+ raise "Please provide a date in YYYYMMDD format" unless date
9
+ call_bank(params(date))
10
+ end
11
+
12
+ def self.latest_rates
13
+ call_bank
14
+ end
15
+
16
+ private
17
+
18
+ def self.params(date)
19
+ { "rdate" => format_date(date) }
20
+ end
21
+
22
+ def self.format_date(date)
23
+ begin
24
+ date = DateTime.parse(date.to_s)
25
+ raise "rates not available on sunday and saturday" if date.sunday? or date.saturday?
26
+ date.strftime("%Y%m%d")
27
+ rescue ArgumentError
28
+ raise "Please provide a date in YYYYMMDD format"
29
+ end
30
+ end
31
+
32
+ def self.call_bank(params = {})
33
+ MultiXml.parser = :nokogiri
34
+ uri = URI.parse("http://www.bankisrael.gov.il")
35
+ http = Net::HTTP.new(uri.host, uri.port)
36
+ full_path = encode_path_params("/currency.xml", params)
37
+ request = Net::HTTP::Get.new(full_path)
38
+
39
+ response = http.request(request)
40
+ hash = MultiXml.parse(response.body)
41
+ parse(hash)
42
+ end
43
+
44
+ def self.encode_path_params(path, params)
45
+ encoded = URI.encode_www_form(params)
46
+ [path, encoded].join("?")
47
+ end
48
+
49
+ def self.parse(hash)
50
+ raise "rates not available on the given date" if hash["CURRENCIES"]["ERROR1"] == "Requested date is invalid or"
51
+ helper_hash = { :release_date => hash["CURRENCIES"]["LAST_UPDATE"] }
52
+ hash["CURRENCIES"]["CURRENCY"].each do |c|
53
+ helper_hash.merge! c["CURRENCYCODE"] => c.reject {|k,v| k == "CURRENCYCODE"}
54
+ end
55
+
56
+ downcase_and_symbolize(helper_hash)
57
+ end
58
+
59
+ def self.downcase_and_symbolize(obj)
60
+ return obj.inject({}){|memo,(k,v)| memo[k.downcase.to_sym] = downcase_and_symbolize(v); memo} if obj.is_a? Hash
61
+ return obj.inject([]){|memo,v | memo << downcase_and_symbolize(v); memo} if obj.is_a? Array
62
+ return obj
63
+ end
64
+ end
@@ -0,0 +1,4 @@
1
+ class BankOfIsrael
2
+ VERSION = "0.0.1"
3
+ end
4
+
@@ -0,0 +1,52 @@
1
+ require 'spec_helper'
2
+
3
+ describe BankOfIsrael do
4
+
5
+ let(:exchange_rates) {{:release_date => "2014-05-30",
6
+ :usd=>{:name=>"Dollar", :unit=>"1", :country=>"USA", :rate=>"3.475", :change=>"-0.029"},
7
+ :gbp=>{:name=>"Pound", :unit=>"1", :country=>"Great Britain", :rate=>"5.8158", :change=>"0.11"},
8
+ :jpy=>{:name=>"Yen", :unit=>"100", :country=>"Japan", :rate=>"3.4188", :change=>"-0.114"},
9
+ :eur=>{:name=>"Euro", :unit=>"1", :country=>"EMU", :rate=>"4.7283", :change=>"-0.106"},
10
+ :aud=>{:name=>"Dollar", :unit=>"1", :country=>"Australia", :rate=>"3.2369", :change=>"0.198"},
11
+ :cad=>{:name=>"Dollar", :unit=>"1", :country=>"Canada", :rate=>"3.2083", :change=>"0.25"},
12
+ :dkk=>{:name=>"krone", :unit=>"1", :country=>"Denmark", :rate=>"0.6335", :change=>"-0.079"},
13
+ :nok=>{:name=>"Krone", :unit=>"1", :country=>"Norway", :rate=>"0.5822", :change=>"-0.257"},
14
+ :zar=>{:name=>"Rand", :unit=>"1", :country=>"South Africa", :rate=>"0.3327", :change=>"-0.12"},
15
+ :sek=>{:name=>"Krona", :unit=>"1", :country=>"Sweden", :rate=>"0.5210", :change=>"-0.648"},
16
+ :chf=>{:name=>"Franc", :unit=>"1", :country=>"Switzerland", :rate=>"3.8735", :change=>"-0.067"},
17
+ :jod=>{:name=>"Dinar", :unit=>"1", :country=>"Jordan", :rate=>"4.9046", :change=>"-0.041"},
18
+ :lbp=>{:name=>"Pound", :unit=>"10", :country=>"Lebanon", :rate=>"0.0230", :change=>"0"},
19
+ :egp=>{:name=>"Pound", :unit=>"1", :country=>"Egypt", :rate=>"0.4860", :change=>"-0.041"}} }
20
+
21
+ context ".rates" do
22
+
23
+ it "returns formatted exchange rates", :vcr do
24
+ expect(BankOfIsrael.rates("20140530")).to eq exchange_rates
25
+ end
26
+
27
+ it "raises an exception on Sundays" do
28
+ expect { BankOfIsrael.rates("20140504") }.to raise_error(RuntimeError, "rates not available on sunday and saturday")
29
+ end
30
+
31
+ it "raises an exception on Saturdays" do
32
+ expect { BankOfIsrael.rates("20140531") }.to raise_error(RuntimeError, "rates not available on sunday and saturday")
33
+ end
34
+
35
+ context "given that the input date rates are not published" do
36
+ it "raises an exception", :vcr do
37
+ expect { BankOfIsrael.rates("20140506") }.to raise_error(RuntimeError, "rates not available on the given date")
38
+ end
39
+ end
40
+
41
+ end
42
+
43
+ context ".latest_rates" do
44
+ context "given that today's rates are not published" do
45
+
46
+ # lets say today is the 31th, may 2014
47
+ it "returns yesterday's rates", :vcr do
48
+ expect(BankOfIsrael.latest_rates[:release_date]).to eq ("2014-05-30")
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,164 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.bankisrael.gov.il/currency.xml
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Cache-Control:
22
+ - private
23
+ Content-Type:
24
+ - text/xml; charset=utf-8
25
+ Vary:
26
+ - Accept-Encoding
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Sprequestguid:
30
+ - 01db8619-0d1a-4914-a07a-fc103cbd1442
31
+ X-Sharepointhealthscore:
32
+ - '0'
33
+ X-Aspnet-Version:
34
+ - 2.0.50727
35
+ X-Powered-By:
36
+ - ASP.NET
37
+ Microsoftsharepointteamservices:
38
+ - 14.0.0.6109
39
+ Date:
40
+ - Sat, 31 May 2014 14:14:53 GMT
41
+ Content-Length:
42
+ - '1011'
43
+ body:
44
+ encoding: UTF-8
45
+ string: |-
46
+ <?xml version="1.0" encoding="utf-8" standalone="yes"?>
47
+ <CURRENCIES>
48
+ <LAST_UPDATE>2014-05-30</LAST_UPDATE>
49
+ <CURRENCY>
50
+ <NAME>Dollar</NAME>
51
+ <UNIT>1</UNIT>
52
+ <CURRENCYCODE>USD</CURRENCYCODE>
53
+ <COUNTRY>USA</COUNTRY>
54
+ <RATE>3.475</RATE>
55
+ <CHANGE>-0.029</CHANGE>
56
+ </CURRENCY>
57
+ <CURRENCY>
58
+ <NAME>Pound</NAME>
59
+ <UNIT>1</UNIT>
60
+ <CURRENCYCODE>GBP</CURRENCYCODE>
61
+ <COUNTRY>Great Britain</COUNTRY>
62
+ <RATE>5.8158</RATE>
63
+ <CHANGE>0.11</CHANGE>
64
+ </CURRENCY>
65
+ <CURRENCY>
66
+ <NAME>Yen</NAME>
67
+ <UNIT>100</UNIT>
68
+ <CURRENCYCODE>JPY</CURRENCYCODE>
69
+ <COUNTRY>Japan</COUNTRY>
70
+ <RATE>3.4188</RATE>
71
+ <CHANGE>-0.114</CHANGE>
72
+ </CURRENCY>
73
+ <CURRENCY>
74
+ <NAME>Euro</NAME>
75
+ <UNIT>1</UNIT>
76
+ <CURRENCYCODE>EUR</CURRENCYCODE>
77
+ <COUNTRY>EMU</COUNTRY>
78
+ <RATE>4.7283</RATE>
79
+ <CHANGE>-0.106</CHANGE>
80
+ </CURRENCY>
81
+ <CURRENCY>
82
+ <NAME>Dollar</NAME>
83
+ <UNIT>1</UNIT>
84
+ <CURRENCYCODE>AUD</CURRENCYCODE>
85
+ <COUNTRY>Australia</COUNTRY>
86
+ <RATE>3.2369</RATE>
87
+ <CHANGE>0.198</CHANGE>
88
+ </CURRENCY>
89
+ <CURRENCY>
90
+ <NAME>Dollar</NAME>
91
+ <UNIT>1</UNIT>
92
+ <CURRENCYCODE>CAD</CURRENCYCODE>
93
+ <COUNTRY>Canada</COUNTRY>
94
+ <RATE>3.2083</RATE>
95
+ <CHANGE>0.25</CHANGE>
96
+ </CURRENCY>
97
+ <CURRENCY>
98
+ <NAME>krone</NAME>
99
+ <UNIT>1</UNIT>
100
+ <CURRENCYCODE>DKK</CURRENCYCODE>
101
+ <COUNTRY>Denmark</COUNTRY>
102
+ <RATE>0.6335</RATE>
103
+ <CHANGE>-0.079</CHANGE>
104
+ </CURRENCY>
105
+ <CURRENCY>
106
+ <NAME>Krone</NAME>
107
+ <UNIT>1</UNIT>
108
+ <CURRENCYCODE>NOK</CURRENCYCODE>
109
+ <COUNTRY>Norway</COUNTRY>
110
+ <RATE>0.5822</RATE>
111
+ <CHANGE>-0.257</CHANGE>
112
+ </CURRENCY>
113
+ <CURRENCY>
114
+ <NAME>Rand</NAME>
115
+ <UNIT>1</UNIT>
116
+ <CURRENCYCODE>ZAR</CURRENCYCODE>
117
+ <COUNTRY>South Africa</COUNTRY>
118
+ <RATE>0.3327</RATE>
119
+ <CHANGE>-0.12</CHANGE>
120
+ </CURRENCY>
121
+ <CURRENCY>
122
+ <NAME>Krona</NAME>
123
+ <UNIT>1</UNIT>
124
+ <CURRENCYCODE>SEK</CURRENCYCODE>
125
+ <COUNTRY>Sweden</COUNTRY>
126
+ <RATE>0.5210</RATE>
127
+ <CHANGE>-0.648</CHANGE>
128
+ </CURRENCY>
129
+ <CURRENCY>
130
+ <NAME>Franc</NAME>
131
+ <UNIT>1</UNIT>
132
+ <CURRENCYCODE>CHF</CURRENCYCODE>
133
+ <COUNTRY>Switzerland</COUNTRY>
134
+ <RATE>3.8735</RATE>
135
+ <CHANGE>-0.067</CHANGE>
136
+ </CURRENCY>
137
+ <CURRENCY>
138
+ <NAME>Dinar</NAME>
139
+ <UNIT>1</UNIT>
140
+ <CURRENCYCODE>JOD</CURRENCYCODE>
141
+ <COUNTRY>Jordan</COUNTRY>
142
+ <RATE>4.9046</RATE>
143
+ <CHANGE>-0.041</CHANGE>
144
+ </CURRENCY>
145
+ <CURRENCY>
146
+ <NAME>Pound</NAME>
147
+ <UNIT>10</UNIT>
148
+ <CURRENCYCODE>LBP</CURRENCYCODE>
149
+ <COUNTRY>Lebanon</COUNTRY>
150
+ <RATE>0.0230</RATE>
151
+ <CHANGE>0</CHANGE>
152
+ </CURRENCY>
153
+ <CURRENCY>
154
+ <NAME>Pound</NAME>
155
+ <UNIT>1</UNIT>
156
+ <CURRENCYCODE>EGP</CURRENCYCODE>
157
+ <COUNTRY>Egypt</COUNTRY>
158
+ <RATE>0.4860</RATE>
159
+ <CHANGE>-0.041</CHANGE>
160
+ </CURRENCY>
161
+ </CURRENCIES>
162
+ http_version:
163
+ recorded_at: Sat, 31 May 2014 14:14:53 GMT
164
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,55 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.bankisrael.gov.il/currency.xml?rdate=20140506
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Cache-Control:
22
+ - private
23
+ Content-Type:
24
+ - text/xml
25
+ Vary:
26
+ - Accept-Encoding
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Sprequestguid:
30
+ - 3e77d526-de6c-40b1-b986-9438f30e6474
31
+ X-Sharepointhealthscore:
32
+ - '0'
33
+ X-Aspnet-Version:
34
+ - 2.0.50727
35
+ X-Powered-By:
36
+ - ASP.NET
37
+ Microsoftsharepointteamservices:
38
+ - 14.0.0.6109
39
+ Date:
40
+ - Sat, 31 May 2014 14:14:53 GMT
41
+ Content-Length:
42
+ - '343'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: !binary |-
46
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiIHN0YW5k
47
+ YWxvbmU9InllcyI/Pgo8Q1VSUkVOQ0lFUz4KICA8UkVRVUVTVEVEX0RBVEU+
48
+ MjAxNDA1MDY8L1JFUVVFU1RFRF9EQVRFPgogIDxFUlJPUjE+UmVxdWVzdGVk
49
+ IGRhdGUgaXMgaW52YWxpZCBvcjwvRVJST1IxPgogIDxFUlJPUjI+Tm8gZXhj
50
+ aGFuZ2UgcmF0ZSBwdWJsaXNoZWQgZm9yIHRoaXMgZGF0ZTwvRVJST1IyPgog
51
+ IDxFUlJPUjM+QVRURU5USU9OOiBEYXRlIHNob3VsZCBiZSBpbiBmb3JtYXQg
52
+ WVlZWU1NREQ8L0VSUk9SMz4KPC9DVVJSRU5DSUVTPg==
53
+ http_version:
54
+ recorded_at: Sat, 31 May 2014 14:14:53 GMT
55
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.bankisrael.gov.il/currency.xml?rdate=20140530
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - '*/*'
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Cache-Control:
22
+ - private
23
+ Content-Type:
24
+ - text/xml
25
+ Vary:
26
+ - Accept-Encoding
27
+ Server:
28
+ - Microsoft-IIS/7.5
29
+ Sprequestguid:
30
+ - 1b156699-acdc-471d-8a83-46facce88bb7
31
+ X-Sharepointhealthscore:
32
+ - '0'
33
+ X-Aspnet-Version:
34
+ - 2.0.50727
35
+ X-Powered-By:
36
+ - ASP.NET
37
+ Microsoftsharepointteamservices:
38
+ - 14.0.0.6109
39
+ Date:
40
+ - Sat, 31 May 2014 14:14:53 GMT
41
+ Content-Length:
42
+ - '1016'
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: !binary |-
46
+ 77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiIHN0YW5k
47
+ YWxvbmU9InllcyI/Pgo8Q1VSUkVOQ0lFUz4KICA8TEFTVF9VUERBVEU+MjAx
48
+ NC0wNS0zMDwvTEFTVF9VUERBVEU+CiAgPENVUlJFTkNZPgogICAgPE5BTUU+
49
+ RG9sbGFyPC9OQU1FPgogICAgPFVOSVQ+MTwvVU5JVD4KICAgIDxDVVJSRU5D
50
+ WUNPREU+VVNEPC9DVVJSRU5DWUNPREU+CiAgICA8Q09VTlRSWT5VU0E8L0NP
51
+ VU5UUlk+CiAgICA8UkFURT4z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DWUNPREU+TEJQPC9DVVJSRU5DWUNPREU+CiAgICA8
101
+ Q09VTlRSWT5MZWJhbm9uPC9DT1VOVFJZPgogICAgPFJBVEU+MC4wMjMwPC9S
102
+ QVRFPgogICAgPENIQU5HRT4wPC9DSEFOR0U+CiAgPC9DVVJSRU5DWT4KICA8
103
+ Q1VSUkVOQ1k+CiAgICA8TkFNRT5Qb3VuZDwvTkFNRT4KICAgIDxVTklUPjE8
104
+ L1VOSVQ+CiAgICA8Q1VSUkVOQ1lDT0RFPkVHUDwvQ1VSUkVOQ1lDT0RFPgog
105
+ ICAgPENPVU5UUlk+RWd5cHQ8L0NPVU5UUlk+CiAgICA8UkFURT4wLjQ4NjA8
106
+ L1JBVEU+CiAgICA8Q0hBTkdFPi0wLjA0MTwvQ0hBTkdFPgogIDwvQ1VSUkVO
107
+ Q1k+CjwvQ1VSUkVOQ0lFUz4=
108
+ http_version:
109
+ recorded_at: Sat, 31 May 2014 14:14:53 GMT
110
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,16 @@
1
+ require 'bundler/setup'
2
+ Bundler.setup
3
+
4
+ require 'bank-of-israel'
5
+ require 'vcr'
6
+
7
+ VCR.configure do |c|
8
+ c.cassette_library_dir = 'spec/cassettes'
9
+ c.hook_into :webmock
10
+ c.default_cassette_options = { :record => :new_episodes }
11
+ c.configure_rspec_metadata!
12
+ end
13
+
14
+ RSpec.configure do |c|
15
+ c.treat_symbols_as_metadata_keys_with_true_values = true
16
+ end
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bank-of-israel
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Dan Evron
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: vcr
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: webmock
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: nokogiri
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: multi_xml
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: Bank Of Israel exchange rates client
84
+ email: danevron@gmail.com
85
+ executables: []
86
+ extensions: []
87
+ extra_rdoc_files: []
88
+ files:
89
+ - Gemfile
90
+ - LICENSE
91
+ - README.md
92
+ - lib/bank-of-israel.rb
93
+ - lib/bank-of-israel/version.rb
94
+ - spec/bank_of_israel_spec.rb
95
+ - spec/cassettes/BankOfIsrael/_latest_rates/given_that_today_s_rates_are_not_published/returns_yesterday_s_rates.yml
96
+ - spec/cassettes/BankOfIsrael/_rates/given_that_the_input_date_rates_are_not_published/raises_an_exception.yml
97
+ - spec/cassettes/BankOfIsrael/_rates/returns_formatted_exchange_rates.yml
98
+ - spec/spec_helper.rb
99
+ homepage: https://github.com/danevron/bank-of-israel
100
+ licenses:
101
+ - MIT
102
+ metadata: {}
103
+ post_install_message:
104
+ rdoc_options: []
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ required_rubygems_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubyforge_project:
119
+ rubygems_version: 2.2.2
120
+ signing_key:
121
+ specification_version: 4
122
+ summary: Bank Of Israel exchange rates client
123
+ test_files: []
124
+ has_rdoc: