hotel_price 0.5.0 → 0.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e38f0cc8a2fa784a0d914f013934c8e3f5bc8bb862e5959f2025d7813d251c8
4
- data.tar.gz: 24e3ef0bf32e8b93fd7de72fe2719f41568feef2d2d24f16779c54f38e24c740
3
+ metadata.gz: 721f3ad16dfb1b86f930d6f9f420590ed1774f56653f1793ed2267deb8668ded
4
+ data.tar.gz: 7b4096b1eba821639226712dae8f36ba1adc09a1e01cc5bc756f2b3a0f60dc9b
5
5
  SHA512:
6
- metadata.gz: a77a876336f07c6ed05fd864225fb5f3b8fc596142071b8eccdcb073005687af2875601fde6736b84289ce7a64cc72a3f4d7c2d872e0f62b05a118f5c1986e82
7
- data.tar.gz: a751e80850b237e3fe3ee870e89e70e09d83c072cec30da1ae8a25d32c0702c3db4e5f643c7ae2fbd2b81e9c5b2f38e25cb89b9a16b68899893ce4dbaa51f2cd
6
+ metadata.gz: 1acfb4cecec62bf16f2e8b5c167151f15f2dbb99757b0a44f4771091f98cb80820e57cbb9e36cd4df1d8693eba74747d11ca8758f9c4b1eee7457f45d023fc6b
7
+ data.tar.gz: d372e2383be49bee1a3ae3db191abfea5806208d6eb7d3b36bd4cd393db3552f425b48c36bbe94e086f4735ee932116cf9a047ef47c584cf83c26dd5aa76d99e
data/lib/hotel_price.rb CHANGED
@@ -38,13 +38,18 @@ module HotelPrice
38
38
 
39
39
  private
40
40
 
41
- def self.get_selenium_driver
42
- # firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
43
- # @driver = Selenium::WebDriver.for(:remote, url: "http://hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
44
-
45
- options = Selenium::WebDriver::Firefox::Options.new
46
- options.add_argument("-headless")
47
- Selenium::WebDriver.for :firefox, options: options
41
+ def self.get_selenium_driver(mode = 0)
42
+ case mode
43
+ when 1
44
+ firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
45
+ Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
46
+ when 2
47
+ Selenium::WebDriver.for :firefox
48
+ else
49
+ options = Selenium::WebDriver::Firefox::Options.new
50
+ options.add_argument("-headless")
51
+ Selenium::WebDriver.for :firefox, options: options
52
+ end
48
53
  end
49
54
 
50
55
  class Configuration
@@ -44,17 +44,6 @@ module HotelPrice::Agoda
44
44
  "adults=#{num_adults}"
45
45
  end
46
46
 
47
- def self.get_selenium_driver(mode = 0)
48
- if mode == 1
49
- firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
50
- Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
51
- elsif mode == 2
52
- Selenium::WebDriver.for :firefox
53
- else
54
- options = Selenium::WebDriver::Firefox::Options.new
55
- options.add_argument("-headless")
56
- Selenium::WebDriver.for :firefox, options: options
57
- end
58
- end
47
+
59
48
  end
60
49
  end
@@ -46,18 +46,5 @@ module HotelPrice::Booking
46
46
  return "" if num_adults.to_i <= 1
47
47
  "group_adults=#{num_adults}&group_children=0"
48
48
  end
49
-
50
- def self.get_selenium_driver(mode = 0)
51
- if mode == 1
52
- firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
53
- Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
54
- elsif mode == 2
55
- Selenium::WebDriver.for :firefox
56
- else
57
- options = Selenium::WebDriver::Firefox::Options.new
58
- options.add_argument("-headless")
59
- Selenium::WebDriver.for :firefox, options: options
60
- end
61
- end
62
49
  end
63
50
  end
@@ -45,18 +45,5 @@ module HotelPrice::Expedia
45
45
  return "" if num_adults.to_i <= 1
46
46
  "rm1=a#{num_adults}"
47
47
  end
48
-
49
- def self.get_selenium_driver(mode = 0)
50
- if mode == 1
51
- firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
52
- Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
53
- elsif mode == 2
54
- Selenium::WebDriver.for :firefox
55
- else
56
- options = Selenium::WebDriver::Firefox::Options.new
57
- options.add_argument("-headless")
58
- Selenium::WebDriver.for :firefox, options: options
59
- end
60
- end
61
48
  end
62
49
  end
@@ -43,19 +43,5 @@ module HotelPrice::Jalan
43
43
  return "" if num_adults.to_i < 1
44
44
  "adultNum=#{num_adults}"
45
45
  end
46
-
47
- def self.get_selenium_driver(mode = 0)
48
- if mode == 1
49
- firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
50
- Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
51
- elsif mode == 2
52
- Selenium::WebDriver.for :firefox
53
- else
54
- options = Selenium::WebDriver::Firefox::Options.new
55
- options.add_argument("-headless")
56
- Selenium::WebDriver.for :firefox, options: options
57
- end
58
- end
59
-
60
46
  end
61
47
  end
@@ -116,19 +116,5 @@ module HotelPrice::Rakuten
116
116
  detail_class_code: ""
117
117
  }
118
118
  end
119
-
120
- def self.get_selenium_driver(mode = 0)
121
- if mode == 1
122
- firefox_capabilities = Selenium::WebDriver::Remote::Capabilities.firefox
123
- Selenium::WebDriver.for(:remote, url: "http://selenium-hub:4444/wd/hub", desired_capabilities: firefox_capabilities)
124
- elsif mode == 2
125
- Selenium::WebDriver.for :firefox
126
- else
127
- options = Selenium::WebDriver::Firefox::Options.new
128
- options.add_argument("-headless")
129
- Selenium::WebDriver.for :firefox, options: options
130
- end
131
- end
132
-
133
119
  end
134
120
  end
@@ -1,3 +1,3 @@
1
1
  module HotelPrice
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hotel_price
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fumitake Kawasaki