qunar 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 650dfece267ee88868f8d461c65f36f5238343d5
4
- data.tar.gz: f4ef4a8be1c121e641d51c7f8c329fc33164d15a
3
+ metadata.gz: 725fb450ecbc035f72a397dfb047ac2b48f45fa1
4
+ data.tar.gz: 6509a4004ad273c928d520ca69e01e0ad574e4f3
5
5
  SHA512:
6
- metadata.gz: 003140a0a585eeff29dc8df03b3db331bba4d51f3bcde66eba45f02923c2c7dfa305cd0abcb8b1db754b3081d8fd195e5b90fc5e0adc3199b92980b9dbff118e
7
- data.tar.gz: a64fd073eff7c0c9a5a3348ec058a5a87971c5c008c40bfb53441a9cce71b12fdfb6378ca80cc043130b39172ee571812efe5d2538664b2163342633140f7ba5
6
+ metadata.gz: 2743710e646d95b80a71791e39e8043472387366a401fb014be1c22b7b2af6473703498aae76d350268e13d3153fa8a052c8a158a70963ad850a4419f9916d12
7
+ data.tar.gz: 43796586966ada8b46f986f11d6379e7a6208a3964650fe5e7868c055aa67bd69a95e0983bec2345572862f178b4579297801460caf7749b99c77ca5c07913cb
data/lib/qunar/hotel.rb CHANGED
@@ -15,7 +15,12 @@ module Qunar
15
15
  end
16
16
 
17
17
  def name #get the name of the hotel
18
- @hotel.search("//div[@class='htl-info fr']//span").first.text.strip
18
+ name = @hotel.search("//div[@class='htl-info fr']//span")
19
+ if name.empty?
20
+ name = '该酒店不存在'
21
+ else
22
+ name = name.first.text.strip
23
+ return name
19
24
  end
20
25
 
21
26
  def star #get the level of the hotel
data/lib/qunar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Qunar
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qunar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - JusticeChow