krawler 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/bin/krawl CHANGED
@@ -25,6 +25,10 @@ optparse = OptionParser.new do |opts|
25
25
  options[:r] = r
26
26
  end
27
27
 
28
+ opts.on('-n', '--no-cache', 'Send Cache-Control: no-cache header', 'Default: false') do |r|
29
+ options[:nc] = true
30
+ end
31
+
28
32
  opts.separator ''
29
33
 
30
34
  opts.on('-h', '--help', 'Show this help message.') { puts opts; exit }
@@ -41,5 +45,6 @@ Krawler::Base.new(ARGV[0] || 'http://localhost:3000/', {
41
45
  :exclude => options[:e],
42
46
  :restrict => options[:s],
43
47
  :threads => options[:c],
44
- :randomize => options[:r]
48
+ :randomize => options[:r],
49
+ :no_cache => options[:nc]
45
50
  }).base
@@ -1,3 +1,3 @@
1
1
  module Krawler
2
- VERSION = '1.0.6'
2
+ VERSION = '1.0.7'
3
3
  end
data/lib/krawler.rb CHANGED
@@ -25,6 +25,7 @@ module Krawler
25
25
  @agent.user_agent = 'Krawler'
26
26
  @agent.ssl_version = 'SSLv3'
27
27
  @headers = { 'Accept-Encoding' => 'gzip, deflate' }
28
+ @headers['Cache-Control'] = 'no-cache' if options[:no_cache]
28
29
  end
29
30
 
30
31
  def base
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: krawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-02 00:00:00.000000000 Z
12
+ date: 2012-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
16
- requirement: &70230190266640 !ruby/object:Gem::Requirement
16
+ requirement: &70222535947940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: 2.5.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70230190266640
24
+ version_requirements: *70222535947940
25
25
  description: Simple little website crawler.
26
26
  email:
27
27
  - mike@urlgonomics.com