klepto 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -64,12 +64,13 @@ Say you want a bunch of Bieb tweets! How is there not profit in that?
64
64
  resource[:tweets].each do |tweet|
65
65
  Tweet.create(tweet)
66
66
  end
67
- end
67
+ end #=> Profit!
68
68
  }
69
69
 
70
- #An array of hashes is returned, store those bad boys you heart throb!
70
+ # An array of hashes is returned, so if you wanted to do something else
71
+ # you could do it here...
71
72
  @structures.each do |structure|
72
- TwitterClone.create(structure) #=> Profit!
73
+ pp structure
73
74
  end
74
75
  ```
75
76
 
@@ -113,15 +114,12 @@ config = {
113
114
 
114
115
 
115
116
  ## Stuff I'm going to add.
116
- sexier config...
117
- ------------------
117
+ Cookie Stuffing
118
+ -------------------
118
119
  ```ruby
119
- Klepto::Structure.crawl("https://twitter.com/justinbieber"){
120
- config.headers({
121
- "Referer" => "http://example.com"
122
- })
123
- }
124
-
120
+ cookies({
121
+ 'Has Fun' => true
122
+ })
125
123
  ```
126
124
 
127
125
  event handlers...
@@ -130,8 +128,8 @@ event handlers...
130
128
  on_http_status(500,404) do |response, bot|
131
129
  email('admin@example.com', bot.status, bot.summary)
132
130
  end
133
- on_assertion_failure{ |response, bot| }
134
- on_invalid_resource{ |resource, bot| }
131
+ on_http_status('3xx') do |response, bot|
132
+ end
135
133
  ```
136
134
 
137
135
  Pre-req Steps
@@ -149,12 +147,5 @@ Page Assertions
149
147
  assertions do
150
148
  #presence and value assertions...
151
149
  end
152
- ```
153
-
154
- Cookie Stuffing
155
- -------------------
156
- ```ruby
157
- cookies({
158
- 'Has Fun' => true
159
- })
150
+ on_assertion_failure{ |response, bot| }
160
151
  ```
data/klepto.gemspec CHANGED
@@ -16,9 +16,10 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
- gem.add_dependency "docile"
19
+
20
20
  gem.add_dependency "poltergeist", '1.1.0'
21
21
  gem.add_dependency "capybara", '2.0.2'
22
+ #gem.add_dependency "docile"
22
23
  #gem.add_dependency "thor"
23
24
  gem.add_dependency "nokogiri", '~> 1.5.6'
24
25
  gem.add_dependency "activesupport"
data/lib/klepto.rb CHANGED
@@ -1,10 +1,8 @@
1
- require 'docile'
2
1
  require 'open-uri'
3
2
  require 'logger'
4
3
  require "capybara"
5
4
  require "capybara/dsl"
6
5
  require 'capybara/poltergeist'
7
- require 'pp'
8
6
 
9
7
  Capybara.run_server = false
10
8
 
@@ -1,3 +1,3 @@
1
1
  module Klepto
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -20,4 +20,11 @@ describe Klepto::Config do
20
20
  pending 'should be able to set assertions'
21
21
  pending 'should be able to set on_http_status handler'
22
22
  pending 'should be able to set on_failed_assertion handler'
23
+ pending 'should be a sexier config' do
24
+ # Klepto::Structure.crawl("https://twitter.com/justinbieber"){
25
+ # config.headers({
26
+ # "Referer" => "http://example.com"
27
+ # })
28
+ # }
29
+ end
23
30
  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.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,20 +11,9 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2013-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: docile
16
- requirement: &70231930844560 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *70231930844560
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: poltergeist
27
- requirement: &70231930843200 !ruby/object:Gem::Requirement
16
+ requirement: &70139987462180 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
19
  - - =
@@ -32,10 +21,10 @@ dependencies:
32
21
  version: 1.1.0
33
22
  type: :runtime
34
23
  prerelease: false
35
- version_requirements: *70231930843200
24
+ version_requirements: *70139987462180
36
25
  - !ruby/object:Gem::Dependency
37
26
  name: capybara
38
- requirement: &70231930839840 !ruby/object:Gem::Requirement
27
+ requirement: &70139987460880 !ruby/object:Gem::Requirement
39
28
  none: false
40
29
  requirements:
41
30
  - - =
@@ -43,10 +32,10 @@ dependencies:
43
32
  version: 2.0.2
44
33
  type: :runtime
45
34
  prerelease: false
46
- version_requirements: *70231930839840
35
+ version_requirements: *70139987460880
47
36
  - !ruby/object:Gem::Dependency
48
37
  name: nokogiri
49
- requirement: &70231930836140 !ruby/object:Gem::Requirement
38
+ requirement: &70139987459780 !ruby/object:Gem::Requirement
50
39
  none: false
51
40
  requirements:
52
41
  - - ~>
@@ -54,10 +43,10 @@ dependencies:
54
43
  version: 1.5.6
55
44
  type: :runtime
56
45
  prerelease: false
57
- version_requirements: *70231930836140
46
+ version_requirements: *70139987459780
58
47
  - !ruby/object:Gem::Dependency
59
48
  name: activesupport
60
- requirement: &70231930835280 !ruby/object:Gem::Requirement
49
+ requirement: &70139987458980 !ruby/object:Gem::Requirement
61
50
  none: false
62
51
  requirements:
63
52
  - - ! '>='
@@ -65,10 +54,10 @@ dependencies:
65
54
  version: '0'
66
55
  type: :runtime
67
56
  prerelease: false
68
- version_requirements: *70231930835280
57
+ version_requirements: *70139987458980
69
58
  - !ruby/object:Gem::Dependency
70
59
  name: multi_json
71
- requirement: &70231930834460 !ruby/object:Gem::Requirement
60
+ requirement: &70139987456360 !ruby/object:Gem::Requirement
72
61
  none: false
73
62
  requirements:
74
63
  - - ~>
@@ -76,7 +65,7 @@ dependencies:
76
65
  version: '1.0'
77
66
  type: :runtime
78
67
  prerelease: false
79
- version_requirements: *70231930834460
68
+ version_requirements: *70139987456360
80
69
  description: Tearing up web pages into ActiveRecord resources
81
70
  email:
82
71
  - github@coryodaniel.com