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 +1 -5
- data/lib/hostelify/hostelworld.rb +1 -0
- data/lib/hostelify/version.rb +1 -1
- data/spec/hostelworld_spec.rb +8 -0
- data/spec/spec_helper.rb +1 -0
- metadata +6 -6
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
hostelify (0.6.
|
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(" ") }
|
data/lib/hostelify/version.rb
CHANGED
data/spec/hostelworld_spec.rb
CHANGED
@@ -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
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:
|
5
|
-
prerelease:
|
4
|
+
hash: 13
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
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-
|
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.
|
152
|
+
rubygems_version: 1.6.2
|
153
153
|
signing_key:
|
154
154
|
specification_version: 3
|
155
155
|
summary: API for hostel related sites
|