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 +12 -21
- data/klepto.gemspec +2 -1
- data/lib/klepto.rb +0 -2
- data/lib/klepto/version.rb +1 -1
- data/spec/lib/klepto/config_spec.rb +7 -0
- metadata +11 -22
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,
|
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
|
-
|
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
|
-
|
117
|
-
|
117
|
+
Cookie Stuffing
|
118
|
+
-------------------
|
118
119
|
```ruby
|
119
|
-
|
120
|
-
|
121
|
-
|
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
|
-
|
134
|
-
|
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
|
-
|
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
data/lib/klepto/version.rb
CHANGED
@@ -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.
|
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: &
|
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: *
|
24
|
+
version_requirements: *70139987462180
|
36
25
|
- !ruby/object:Gem::Dependency
|
37
26
|
name: capybara
|
38
|
-
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: *
|
35
|
+
version_requirements: *70139987460880
|
47
36
|
- !ruby/object:Gem::Dependency
|
48
37
|
name: nokogiri
|
49
|
-
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: *
|
46
|
+
version_requirements: *70139987459780
|
58
47
|
- !ruby/object:Gem::Dependency
|
59
48
|
name: activesupport
|
60
|
-
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: *
|
57
|
+
version_requirements: *70139987458980
|
69
58
|
- !ruby/object:Gem::Dependency
|
70
59
|
name: multi_json
|
71
|
-
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: *
|
68
|
+
version_requirements: *70139987456360
|
80
69
|
description: Tearing up web pages into ActiveRecord resources
|
81
70
|
email:
|
82
71
|
- github@coryodaniel.com
|