hostelify 0.6.3 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hostelify (0.6.2)
4
+ hostelify (0.6.4)
5
5
  nibbler (>= 1.2.1)
6
6
  nokogiri (>= 1.4.4)
7
7
  rest-client (>= 1.6.1)
@@ -31,8 +31,4 @@ PLATFORMS
31
31
 
32
32
  DEPENDENCIES
33
33
  hostelify!
34
- nibbler (>= 1.2.1)
35
- nokogiri (>= 1.4.4)
36
- rest-client (>= 1.6.1)
37
- robotstxt (>= 0.5.4)
38
34
  rspec (= 2.5.0)
@@ -7,6 +7,7 @@ class Hostelworld < Nibbler
7
7
  elements 'div.links ul.column li' => :features, :with => lambda { |node| node.inner_text.first }
8
8
  elements '.cboxElement img //@src' => :photos
9
9
  elements '.rating-values li' => :ratings
10
+ element 'script[19]' => :base_currency, :with => lambda { |node| node.inner_text.scan(/\$\.Microsite\.propertyCurrency = \'(.*)\';/).to_s }
10
11
 
11
12
  elements '//table[@class="beds-details"]//tr[position() > 1]' => :beds do
12
13
  element 'td.left span' => :title, :with => lambda { |node| node.inner_text.lstrip.rstrip.squeeze(" ") }
@@ -1,3 +1,3 @@
1
1
  module Hostelify
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.5"
3
3
  end
@@ -27,4 +27,12 @@ describe "hostelworld" do
27
27
  @hostel.beds.last.nights.last.price.to_i.should be >= 5
28
28
  end
29
29
 
30
+ it "should return a base currency" do
31
+ @hostel.base_currency.should_not be_nil
32
+ end
33
+
34
+ it "should return a base currency in EUROs" do
35
+ @hostel.base_currency.should be == "EUR"
36
+ end
37
+
30
38
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
+ require 'rspec'
2
3
  require 'bundler/setup'
3
4
 
4
5
  Bundler.require(:default)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hostelify
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
5
- prerelease: false
4
+ hash: 13
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 3
10
- version: 0.6.3
9
+ - 5
10
+ version: 0.6.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Holden Thomas
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-07 00:00:00 +02:00
18
+ date: 2011-04-18 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  requirements: []
150
150
 
151
151
  rubyforge_project: hostelify
152
- rubygems_version: 1.3.7
152
+ rubygems_version: 1.6.2
153
153
  signing_key:
154
154
  specification_version: 3
155
155
  summary: API for hostel related sites