smart_driver 1.1.0 → 1.1.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
  SHA1:
3
- metadata.gz: f7f1e40525ae0561f12ad7d767e7327f9a9647c2
4
- data.tar.gz: 487c68a8c6cb46e791dcb59444ccd6897671a589
3
+ metadata.gz: 4c94a9e0156f04341a4051d5be6b77e0a9d5b18a
4
+ data.tar.gz: 95463e7b76d8d12d35018f00a1323a743807c69a
5
5
  SHA512:
6
- metadata.gz: dc48552df327c3b63ef5b08baf0503edaa024feafbaf8c9d3af040f5da8299026c71c4c6a6247d6a88f1c15de41a802ad3235d98a783dca8c63b13ed23ed6eb0
7
- data.tar.gz: ed46c725f6e46070605f94087e32d1c86eafe17c0c5e3d1dd7d994e89b5f07c05ad51700ade91fee23a98aaf62133237a6335ffdddc82bb1e1e17bf03fac9b89
6
+ metadata.gz: 688e8e217e27072cc7f07f78af3510c90ec031a12ccdfbe88badd618cbfeae0e18cbff1b7dbd3420cce72f4c70f26c7b0e20426ba187318143bf8ee242964dfa
7
+ data.tar.gz: 8b11a81c5c3cb1072484d4b58aa1a3576e8ed89b7e1d1cd266b6a56db224f31ae4466d600626749660d229fa557f5924cb16f37b41f9f634ab2207cafcc12412
data/lib/smart_driver.rb CHANGED
@@ -7,10 +7,8 @@ class SmartDriver
7
7
  attr_reader :log_dir_path
8
8
  include SmartDriver::CommonInterface
9
9
 
10
- def initialize(url=nil, log_dir_path="./log", browser=:chrome)
10
+ def initialize(url=nil, browser=:chrome)
11
11
  @__driver__ = Selenium::WebDriver.for(browser)
12
- FileUtils.mkdir_p log_dir_path
13
- @log_dir_path = log_dir_path
14
12
  go(url) if url
15
13
  end
16
14
 
@@ -32,12 +30,12 @@ class SmartDriver
32
30
  @__driver__.execute_script js_code
33
31
  end
34
32
 
35
- def save_html(file_name="log.html")
36
- File.open("#{@log_dir_path}/#{file_name}", 'w') { |f| f.write(@__driver__.page_source) }
33
+ def save_html(file_path)
34
+ File.open(file_path, 'w') { |f| f.write(@__driver__.page_source) }
37
35
  end
38
36
 
39
- def save_png(file_name="log.png")
40
- @__driver__.save_screenshot "#{@log_dir_path}/#{file_name}"
37
+ def save_png(file_path)
38
+ @__driver__.save_screenshot file_path
41
39
  end
42
40
 
43
41
  def method_missing(method, *args, &block)
@@ -1,3 +1,3 @@
1
1
  class SmartDriver
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gogotanaka