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.
Files changed (3) hide show
  1. data/fuelprice.gemspec +1 -1
  2. data/lib/fuelprice.rb +6 -4
  3. metadata +3 -3
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{fuelprice}
5
- s.version = "0.1.1"
5
+ s.version = "0.1.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Joost Saanen"]
@@ -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 gasoline
19
+ def petrol
22
20
  document.search("#gasprices tr[3]/td[2]/b").innerHTML.to_f
23
21
  end
24
22
 
25
- def oil
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: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joost Saanen