scrapey 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
data/lib/scrapey.rb CHANGED
@@ -2,6 +2,8 @@ require 'mechanize'
2
2
  require 'csv'
3
3
  require 'json'
4
4
  require 'yaml'
5
+ require 'unf_ext'
6
+ require 'coderay/tokens_proxy'
5
7
 
6
8
  require "scrapey/scrapey"
7
9
  require "scrapey/constants"
data/lib/scrapey/cache.rb CHANGED
@@ -17,4 +17,24 @@ module Scrapey
17
17
  @use_cache = true
18
18
  end
19
19
 
20
+
21
+ def without_cache
22
+ yield
23
+ end
24
+
25
+ def with_cache cassette_name = 'my_cassette'
26
+ require 'vcr'
27
+ require 'fakeweb'
28
+
29
+ VCR.configure do |c|
30
+ c.cassette_library_dir = "#{BASEDIR}/cache"
31
+ c.hook_into :fakeweb
32
+ c.allow_http_connections_when_no_cassette = true
33
+ end
34
+
35
+ VCR.use_cassette(cassette_name, :record => :new_episodes, :match_requests_on => [:method, :uri, :body]) do
36
+ yield
37
+ end
38
+ end
39
+
20
40
  end
@@ -1,5 +1,5 @@
1
1
  module Scrapey
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  BASEDIR = File.expand_path(File.dirname($0)).gsub(/\/src$/,'')
4
4
  URL = "https://github.com/monkeysuffrage/scrapey"
5
5
  end
data/template/Rakefile CHANGED
@@ -21,3 +21,17 @@ task 'dropbox' do
21
21
  url = [ENV['DROPBOX_public_url'], name, file].join('/').squeeze('/')
22
22
  puts "uploaded to #{url}"
23
23
  end
24
+
25
+ task 'git' do
26
+ server = ARGV[1] || 'foo'
27
+ puts <<EOF
28
+ git commands:
29
+ -------------
30
+ cd my_repo
31
+ git init
32
+ git remote add origin ssh://#{server}/repos/#{name}
33
+ git add .
34
+ git commit -m "Initial commit"
35
+ git push -u origin master
36
+ EOF
37
+ end
@@ -21,4 +21,4 @@ Name: "{group}\Uninstall Template Scraper"; Filename: "{uninstallexe}"
21
21
  // Root: HKCR; Subkey: SystemFileAssociations\.csv\shell\Template Scraper\command; ValueType: string; ValueData: """{app}\template.exe"" ""%1"""; Flags: uninsdeletekey deletekey
22
22
 
23
23
  [Run]
24
- //Filename: schtasks.exe; Parameters:" /CREATE /TN ""Scheduled Template"" /TR ""{app}\template.exe"" /SC DAILY /ST 02:30"
24
+ // Filename: schtasks.exe; Parameters:" /CREATE /TN ""Scheduled Template"" /TR ""{app}\template.exe"" /SC DAILY /ST 02:30"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrapey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-01 00:00:00.000000000 Z
12
+ date: 2013-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize