scrappy 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,7 @@
1
+ === 0.1.12 2011-01-10
2
+
3
+ * Correction for Windows compatibility
4
+
1
5
  === 0.1.11 2010-12-23
2
6
 
3
7
  * Handling of timeout errors
data/bin/scrappy CHANGED
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/ruby
2
2
  # encoding: UTF-8
3
3
 
4
- stty_save = `stty -g`.chomp
5
- trap('INT') { system('stty', stty_save); Scrappy::App.quit }
4
+ if !RUBY_PLATFORM.include?("mswin")
5
+ stty_save = `stty -g`.chomp
6
+ trap('INT') { system('stty', stty_save); Scrappy::App.quit }
7
+ end
8
+
6
9
  module Scrappy
7
10
  Root = File.expand_path(File.dirname(File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__) + "/..")
8
11
 
@@ -13,7 +16,6 @@ module Scrappy
13
16
  gem 'camping', '=2.0'
14
17
  require 'camping'
15
18
  require 'camping/server'
16
- require 'etc'
17
19
  require "#{Root}/lib/scrappy"
18
20
  require 'scrappy/shell'
19
21
 
@@ -123,9 +125,11 @@ Copyright
123
125
 
124
126
  def onload
125
127
  # Check local or global knowledge base
126
- if File.exists?("#{Etc.getpwuid.dir}/.scrappy/kb")
127
- data_folder = "#{Etc.getpwuid.dir}/.scrappy/kb"
128
- cache_file = "#{Etc.getpwuid.dir}/.scrappy/kb.cache"
128
+ home = RUBY_PLATFORM.include?("mswin") ? "#{ENV['HOME']}/scrappy" : "#{ENV['HOME']}/.scrappy"
129
+
130
+ if File.exists?("#{home}/kb")
131
+ data_folder = "#{home}/kb"
132
+ cache_file = "#{home}/kb.cache"
129
133
  else
130
134
  data_folder = "#{Scrappy::Root}/kb"
131
135
  cache_file = "#{Dir.tmpdir}/scrappy.kb.cache"
@@ -74,8 +74,8 @@ module Scrappy
74
74
  end
75
75
 
76
76
  # Cache the request
77
- cache[request] = { :time=>Time.now, :response=>response }
78
- cache[request.merge(:uri=>self.uri)] = { :time=>Time.now, :response=>response } unless self.uri.nil?
77
+ # cache[request] = { :time=>Time.now, :response=>response }
78
+ # cache[request.merge(:uri=>self.uri)] = { :time=>Time.now, :response=>response } unless self.uri.nil?
79
79
 
80
80
  response
81
81
  end
data/lib/scrappy.rb CHANGED
@@ -19,7 +19,7 @@ require 'scrappy/agent/agent'
19
19
  Namespace :sc, 'http://lab.gsi.dit.upm.es/scraping.rdf#'
20
20
 
21
21
  module Scrappy
22
- VERSION = '0.1.11'
22
+ VERSION = '0.1.12'
23
23
  end
24
24
 
25
25
  # Require selectors
data/scrappy.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{scrappy}
5
- s.version = "0.1.11"
5
+ s.version = "0.1.12"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Jose Ignacio"]
9
- s.date = %q{2010-12-23}
9
+ s.date = %q{2011-01-10}
10
10
  s.default_executable = %q{scrappy}
11
11
  s.description = %q{RDF web scraper}
12
12
  s.email = %q{joseignacio.fernandez@gmail.com}
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 11
9
- version: 0.1.11
8
+ - 12
9
+ version: 0.1.12
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jose Ignacio
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-23 00:00:00 +01:00
17
+ date: 2011-01-10 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency