klepto 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ Capybara.register_driver :poltergeist do |app|
12
12
  js_errors: false
13
13
  })
14
14
  end
15
- Capybara.current_driver = :poltergeist
15
+ Capybara.javascript_driver = Capybara.current_driver = :poltergeist
16
16
 
17
17
  module Klepto
18
18
  def self.logger
@@ -31,15 +31,17 @@ EOS
31
31
  # Structure all the pages
32
32
  def __process!
33
33
  @structure = nil
34
+ @browser.set_driver @config.driver || :poltergeist
34
35
  @browser.set_headers @config.headers
35
- @browser.set_driver @config.driver
36
-
36
+
37
37
  @config.before_handlers[:get].each { |bh|
38
38
  bh.call(@browser,@config.url)
39
39
  }
40
40
 
41
41
  begin
42
42
  @browser.fetch! @config.url
43
+ #@browser.page.driver.restart
44
+ #@browser.page.driver.quit #rescue nil
43
45
 
44
46
  # Fire callbacks on GET
45
47
  @config.after_handlers[:get].each do |ah|
@@ -8,8 +8,8 @@ module Klepto
8
8
  super
9
9
  end
10
10
 
11
- def set_driver(use_driver)
12
- @use_driver = use_driver
11
+ def set_driver(using_driver)
12
+ @use_driver = Capybara.current_driver = Capybara.javascript_driver = using_driver
13
13
  end
14
14
 
15
15
  def use_driver
@@ -55,9 +55,8 @@ module Klepto
55
55
 
56
56
  def fetch!(_url)
57
57
  @url_to_structure = _url
58
- Klepto.logger.debug("Fetching #{@url_to_structure}")
58
+ Klepto.logger.debug("Fetching (#{@use_driver}) #{@url_to_structure}")
59
59
 
60
- Capybara.current_driver = Capybara.javascript_driver = use_driver
61
60
  visit @url_to_structure
62
61
  page
63
62
  end
@@ -1,3 +1,3 @@
1
1
  module Klepto
2
- VERSION = "0.7.0"
2
+ VERSION = "0.7.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: klepto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-11 00:00:00.000000000 Z
12
+ date: 2013-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: poltergeist