qunar 0.1.43 → 0.1.45
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.
- checksums.yaml +4 -4
- data/lib/qunar/rank.rb +1 -1
- data/lib/qunar/version.rb +1 -1
- data/spec/rank_spec.rb +2 -9
- 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: 16e7b274ae98c9d67ef174e5b206038269881639
|
4
|
+
data.tar.gz: df5c42c962a27cd47adea3637d03296579e1b2ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2ad28f22e66b33ef7456bdf382a6e0f0a53ab38a50cd38ff08de2e3cd77efe01645509d134ac339a651bd234eaac326541b77230530ded9122efb92bc96f9d6
|
7
|
+
data.tar.gz: 79b39074310c6e47683e78c027dd71df8b304c610ad0ec6d89cf92ba6ccb6a52fc2b884a4f5d48be1f684368741f26c2bf6ef98a90be8ce326fbe01c3fc07400
|
data/lib/qunar/rank.rb
CHANGED
@@ -43,7 +43,7 @@ module Qunar
|
|
43
43
|
rooms = []
|
44
44
|
|
45
45
|
# room
|
46
|
-
@hotel.search("//
|
46
|
+
@hotel.search("//div[@id='roomTool']/div[@id='q-ra-1']/ul/li").each do |li|
|
47
47
|
#puts 'one roomtype found'
|
48
48
|
room = {}
|
49
49
|
type = li.search("span[@class='type-name js-p-name']").first.text.strip
|
data/lib/qunar/version.rb
CHANGED
data/spec/rank_spec.rb
CHANGED
@@ -3,6 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe Qunar::Rank do
|
4
4
|
sample = Qunar::Rank.new('beijing_city_2933')
|
5
5
|
p sample.rooms
|
6
|
+
#The screen shot
|
7
|
+
sample.screen_shot
|
6
8
|
it "has 7 rooms" do
|
7
9
|
# when directly check the hash object the Chinese charactervalue is saved as format like "\u6807\u51C6\u53CC\u5E8A\u623F", it is not been parsed here, so it is not equal to chinese charactor, it's just a sequnce of coding,it needs to be parse,then it could show as Chinese character.
|
8
10
|
# room = {"room_type" => "\u6807\u51C6\u53CC\u5E8A\u623F", "ota" => "\u827A\u9F99\u65C5\u884C\u7F51", "bookable" => "\u9884\u8BA2", "insurance" => true, "coupon" => "0", "prepay" => false, "price" => "918", "neat_price" => "918"}
|
@@ -60,15 +62,6 @@ describe Qunar::Rank do
|
|
60
62
|
expect(sample.rooms.first[:otas].first[:coupon]).to eq 0
|
61
63
|
end
|
62
64
|
|
63
|
-
it "first ota of first roomtype in shenzhen coupon is 40" do
|
64
|
-
expect(sz_sample.rooms.first[:otas].first[:coupon]).to eq 40
|
65
|
-
end
|
66
|
-
|
67
|
-
it "first ota of first roomtype reserve_detail is '标准双床房 - 仅提供住宿 - 免费取消'" do
|
68
|
-
expect(sample.rooms.first[:otas].first[:reserve_detail]).to eq '标准双床房 - 仅提供住宿 - 免费取消'
|
69
|
-
end
|
70
|
-
|
71
|
-
|
72
65
|
it "first ota of first roomtype need prepay" do
|
73
66
|
expect(sample.rooms.first[:otas][2][:prepay]).to eq true
|
74
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qunar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JusticeChow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|