currency_converter 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/currency_converter/version.rb +1 -1
- data/lib/currency_converter/xe.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3da96c09a429b3136e2fd1665f224f43ba1ae10
|
4
|
+
data.tar.gz: 6e7e0b634be3d8e6866a1ee2710255180c4154b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e278cdb6cb89a525f6b8a8ba9cd777ac6837cc575ac3feef6723e7a12f87ca4bc5cf1707dc940f17828aa8b0721f3cb89dcd2bb0128937a39b7abc58e830a87
|
7
|
+
data.tar.gz: 90168379ac63eac6b74691d8c0fbb5ee5743530044d88647759116f97325ba20d18009d0d204f49b4504392bca7919c4dd1e057c3946ff2dd49559a3c187757f
|
@@ -38,10 +38,12 @@ module CurrencyConverter
|
|
38
38
|
|
39
39
|
# Returns the Float value of rate or nil
|
40
40
|
def exchange_rate
|
41
|
-
http = Net::HTTP.new('www.xe.com', 80)
|
42
41
|
url = "/currencyconverter/convert/?Amount=1&From=#{from_currency.to_s.upcase}&To=#{to_currency.to_s.upcase}"
|
42
|
+
uri = URI.parse('https://www.xe.com')
|
43
43
|
|
44
|
-
|
44
|
+
request = Net::HTTP.new(uri.host, uri.port)
|
45
|
+
request.use_ssl = true
|
46
|
+
response = request.get(url)
|
45
47
|
|
46
48
|
doc = Nokogiri::HTML(response.body)
|
47
49
|
result = doc.css('span.uccResultAmount').text
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: currency_converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diganta Mandal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|