descartes 0.8.3.5 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/descartes/modules/currency.rb +3 -2
- data/lib/descartes/version.rb +1 -1
- 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: be9e7f1dcf85945b9abb3240b64cc07befcd4b8b
|
4
|
+
data.tar.gz: b4e2bbbb1f6e40b05c5eb2c5f995ee3155dbdc91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecf0dc34e9f5fc7d6cdf4c9fac685e08dd7fd0460248f6890d076d1ed8743d3ec19f6bedce7781dc8b14861da1e5af0fde52e2f6f971c94d52ae54f92f2d279c
|
7
|
+
data.tar.gz: 5491cfbe1b34d9b9802a210c5d8454e744f81b2fb5bf65a22cb0026d09555b82530d9ea3b8b05511393dfee48bef44e425850e5b63fbb8ce31c2f1d53f43c91d
|
@@ -18,7 +18,7 @@ require 'nokogiri'
|
|
18
18
|
class Descartes
|
19
19
|
class Currency
|
20
20
|
include Cinch::Plugin
|
21
|
-
match /[0-9]+ [A-Za-z]+ to [A-Za-z]
|
21
|
+
match /[0-9]+ [A-Za-z]+ to [A-Za-z]+$/, use_prefix: false
|
22
22
|
|
23
23
|
def execute(m)
|
24
24
|
amount = m.params[1].match /[0-9]+/
|
@@ -29,7 +29,8 @@ class Descartes
|
|
29
29
|
to = 'jpy' if to == 'yen'
|
30
30
|
|
31
31
|
url = "http://www.xe.com/currencyconverter/convert/?Amount=#{amount}&From=#{from}&To=#{to}"
|
32
|
-
|
32
|
+
res = Nokogiri::HTML(open(url)).xpath('//tr[@class="uccRes"]').children[4].text
|
33
|
+
m.reply res unless res.strip.empty?
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
data/lib/descartes/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: descartes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cinch
|