kabutops 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77fe8ec688a04815be1251f3dadbcba9cc8a6178
4
- data.tar.gz: 0d35e650e10456b76694caebf4f8d52a4db91ef5
3
+ metadata.gz: c9d30b351bb730c7b4b6d44de1dfb4b34630c702
4
+ data.tar.gz: b39802e0b31ad087cd96259957d16624307fe011
5
5
  SHA512:
6
- metadata.gz: caa5eee784efac080a5726d80b593e1d2fa21444c0064fec01ca5d9ec1a99ebb4a23e4ec43308f4eabfec545e65d612814ddd87a55e001f01e7748ad05a3a4e4
7
- data.tar.gz: 6e461464e795806088cc6f35b896e9c2594ae60d7e91eef3b475d61282f888d56d437bd1a6bc5115a2b8a1423cbbb6d2fd48943fed0bccd94abbabb3a82e043e
6
+ metadata.gz: 6ff995f573eeafac0895a0f8095161bda425f970a6095c637e0cf71028e122348a9b7ea2c65cd62e20d013efacb5178a0aa7c26fa6ed9b8e753b5dd61d9a744e
7
+ data.tar.gz: f9470dee147282accc9dd9a31debd11706f634e14679f085242febdc874aded7ae9e09439ae3e2a77f55892f6a53e6b887f9832bbeebf5a51bdff694d5fd57f8
@@ -16,7 +16,7 @@ module Kabutops
16
16
  include Extensions::CallbackSupport
17
17
 
18
18
  params :collection, :proxy, :cache, :wait,
19
- :skip_existing, :agent
19
+ :skip_existing, :agent, :encoding
20
20
  callbacks :after_crawl, :before_cache, :store_if
21
21
 
22
22
  def adapters
@@ -111,6 +111,7 @@ module Kabutops
111
111
  content = Cachy.cache_if(params.cache, cache_key) do
112
112
  sleep params[:wait] || 0 # wait only if value is not from cache
113
113
  body = agent.get(resource[:url]).body
114
+ body.encode!('utf-8', params[:encoding]) if params[:encoding]
114
115
  page = Nokogiri::HTML(body)
115
116
  self.class.notify(:before_cache, resource, page)
116
117
  body
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
 
3
3
  module Kabutops
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kabutops
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rene Klacan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-10 00:00:00.000000000 Z
11
+ date: 2014-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize