fuelprice 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/fuelprice.gemspec +1 -1
- data/lib/fuelprice.rb +6 -4
- metadata +3 -3
data/fuelprice.gemspec
CHANGED
data/lib/fuelprice.rb
CHANGED
|
@@ -4,8 +4,6 @@ require 'hpricot'
|
|
|
4
4
|
|
|
5
5
|
module Fuelprice
|
|
6
6
|
|
|
7
|
-
VERSION = File.open(File.join(File.dirname(__FILE__), '..', 'VERSION'), 'r') { |f| f.read.strip }
|
|
8
|
-
|
|
9
7
|
class Fuelprice
|
|
10
8
|
|
|
11
9
|
attr_accessor :url
|
|
@@ -18,14 +16,18 @@ module Fuelprice
|
|
|
18
16
|
@url = "http://www.nu.nl/brandstof"
|
|
19
17
|
end
|
|
20
18
|
|
|
21
|
-
def
|
|
19
|
+
def petrol
|
|
22
20
|
document.search("#gasprices tr[3]/td[2]/b").innerHTML.to_f
|
|
23
21
|
end
|
|
24
22
|
|
|
25
|
-
def
|
|
23
|
+
def dieseloil
|
|
26
24
|
document.search("#gasprices tr[5]/td[2]/b").innerHTML.to_f
|
|
27
25
|
end
|
|
28
26
|
|
|
27
|
+
def lpg
|
|
28
|
+
document.search("#gasprices tr[6]/td[2]/b").innerHTML.to_f
|
|
29
|
+
end
|
|
30
|
+
|
|
29
31
|
private
|
|
30
32
|
def document
|
|
31
33
|
@document ||= Hpricot(open(self.url))
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fuelprice
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 31
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
9
|
+
- 2
|
|
10
|
+
version: 0.1.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Joost Saanen
|