klepto 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/klepto/bot.rb CHANGED
@@ -44,7 +44,7 @@ EOS
44
44
  browser = Klepto::Browser.new
45
45
 
46
46
  browser.set_headers config.headers
47
- browser.set_driver config.driver
47
+ #browser.set_driver config.driver
48
48
 
49
49
  begin
50
50
  browser.fetch! url
@@ -6,13 +6,13 @@ module Klepto
6
6
  super
7
7
  end
8
8
 
9
- def set_driver(use_driver)
10
- @use_driver = use_driver
11
- end
9
+ # def set_driver(use_driver)
10
+ # @use_driver = use_driver
11
+ # end
12
12
 
13
- def use_driver
14
- @use_driver || :poltergeist
15
- end
13
+ # def use_driver
14
+ # @use_driver || :poltergeist
15
+ # end
16
16
 
17
17
  def set_headers(headers)
18
18
  page.driver.headers = headers
@@ -35,10 +35,10 @@ module Klepto
35
35
  end
36
36
 
37
37
  def fetch!(url)
38
- Capybara.using_driver use_driver do
38
+ #Capybara.using_driver use_driver do
39
39
  visit url
40
40
  page
41
- end
41
+ #end
42
42
  end
43
43
  end
44
44
  end
data/lib/klepto/config.rb CHANGED
@@ -24,10 +24,10 @@ module Klepto
24
24
  # @handlers[group][handler].each{|handler| handler.call(*args)}
25
25
  # end
26
26
 
27
- def driver(_driver=nil)
28
- @default_driver = _driver if _driver
29
- @default_driver
30
- end
27
+ # def driver(_driver=nil)
28
+ # @default_driver = _driver if _driver
29
+ # @default_driver
30
+ # end
31
31
 
32
32
  def headers(_headers=nil)
33
33
  @headers = _headers if _headers
@@ -1,3 +1,3 @@
1
1
  module Klepto
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -13,7 +13,7 @@ describe Klepto::Browser, :vcr => {:record => :new_episodes} do
13
13
  @page.status_code.should be(200)
14
14
  end
15
15
 
16
- it 'should use poltergeist by default' do
17
- @browser.use_driver.should == :poltergeist
18
- end
16
+ # it 'should use poltergeist by default' do
17
+ # @browser.use_driver.should == :poltergeist
18
+ # end
19
19
  end
@@ -14,7 +14,7 @@ describe Klepto::Config do
14
14
  @config.on_http_status('5xx','4xx'){
15
15
  "Its crazy."
16
16
  }
17
- @config.driver :cool_driver
17
+ #@config.driver :cool_driver
18
18
  @config.abort_on_failure(false)
19
19
  end
20
20
 
@@ -22,9 +22,9 @@ describe Klepto::Config do
22
22
  @config.headers['Referer'].should eq('http://example.com')
23
23
  end
24
24
 
25
- it 'should default to poltergeist as the driver' do
26
- @config.driver.should == :cool_driver
27
- end
25
+ # it 'should default to poltergeist as the driver' do
26
+ # @config.driver.should == :cool_driver
27
+ # end
28
28
 
29
29
  it 'should have a 2xx status handler' do
30
30
  @config.instance_variable_get("@status_handlers")['2xx'].first.call.should eq ('Its 2xx')
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.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: poltergeist
16
- requirement: &70230785811460 !ruby/object:Gem::Requirement
16
+ requirement: &70332727963300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.1.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70230785811460
24
+ version_requirements: *70332727963300
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: capybara
27
- requirement: &70230785810960 !ruby/object:Gem::Requirement
27
+ requirement: &70332727962800 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.0.2
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70230785810960
35
+ version_requirements: *70332727962800
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nokogiri
38
- requirement: &70230785810500 !ruby/object:Gem::Requirement
38
+ requirement: &70332727962340 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.5.6
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70230785810500
46
+ version_requirements: *70332727962340
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activesupport
49
- requirement: &70230785810120 !ruby/object:Gem::Requirement
49
+ requirement: &70332727961960 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70230785810120
57
+ version_requirements: *70332727961960
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: multi_json
60
- requirement: &70230785809580 !ruby/object:Gem::Requirement
60
+ requirement: &70332727961420 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '1.0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70230785809580
68
+ version_requirements: *70332727961420
69
69
  description: Tearing up web pages into ActiveRecord resources
70
70
  email:
71
71
  - github@coryodaniel.com