polipus 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzFhNjEwZmMzMDMwNWRlZDMzODU1NDljMDBmNmUyZWQ5MDI1YmZlNQ==
4
+ ZmMzMzJiMDQ1NGQzYTRhNTRmMGZiZWNhY2Y4YTgwNTU2OTljNzdkNQ==
5
5
  data.tar.gz: !binary |-
6
- NGY4Njg0NzJkNWVkMDJlYWIxZWEyNzhmYTM3MDlmZGJkYmFlMGQ0MA==
6
+ ZDQyNTBiNjkzYzQ0ZDc3ODc3N2MxMTcxOTAzOWFkZjliZGZlYzFjZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjJiMmU4YmI2NDRhMGMzNzJmNzlhZWRjNjg5YjQ0OGVkYWM5YTZhODk4NzEx
10
- Y2JhNDEzMDMxMDE5ZDBkMDZlNjhlNGQ1NTI0OWE5YjlhNjAyZTM0NDc1N2Fk
11
- MGIyNDIzOGRkMTZlODE1MmQwNzg4MTU4MzQ0ZDc1NjhiNzNhYzk=
9
+ MWMwNjYzMzY5ZmYzYzNiMTdlMTFkOTNhNGYzNTViZmQ4ZjdkYWFkMjE1YTMz
10
+ MDc3ZDA1Y2JlN2FiNjVmZGZmYWRlNDU2YjcwYjdlNjFiYjViY2NiZTA1OTNm
11
+ M2JhYjVhYjkwMzlhNWIxMmM2MzhmNWM5YmY5ZTQ1ZjE2OWY5MGM=
12
12
  data.tar.gz: !binary |-
13
- ZTQxOWFiNjI4YzI5MjhjMjQ0ODA3ODY0ZWNlZjZhZDE3YWE1OGJhMjdiN2Jm
14
- NGY2YWJjNzE2OWFlZjAyYjM4Y2E2MzVlNTBlYzc5MjMwM2QyZTllNjg4OGVi
15
- NzY5ZmRlZTliMTk1MWE4YmQ4MWNjYTA0OGFlZjhjZmRjZGU2M2I=
13
+ ODlkYzUyNTI1MTVmOTI1YzI2ZjFkMzY1NTMyZWIzMWEwYjI4MGFmODc4Y2Yx
14
+ ZGVkZTA2NmM2OGU5ZThkOTg1ODJjYjMxNTJiNGZkZDVhYzkwZjkzOWI1ZGI2
15
+ OTcxOGViODEwZDBiYmQ1ZDU4NmRmZWI2NWZkMTFlNzIzYjdlMjc=
data/lib/polipus/http.rb CHANGED
@@ -196,7 +196,7 @@ module Polipus
196
196
  response = connection(url).request(req)
197
197
  finish = Time.now
198
198
  response_time = ((finish - start) * 1000).round
199
- cookie_jar.parse(response['Set-Cookie'], url) if accept_cookies?
199
+ cookie_jar.parse(response['Set-Cookie'], url) if accept_cookies? && response['Set-Cookie']
200
200
  return response, response_time
201
201
  rescue *RESCUABLE_ERRORS => e
202
202
  puts e.inspect if verbose?
data/lib/polipus/page.rb CHANGED
@@ -126,7 +126,7 @@ module Polipus
126
126
  # otherwise.
127
127
  #
128
128
  def redirect?
129
- (300..307).include?(@code)
129
+ (300...400).include?(@code)
130
130
  end
131
131
 
132
132
  #
@@ -228,7 +228,7 @@ module Polipus
228
228
  def self.from_hash(hash)
229
229
  page = new(URI(hash['url']))
230
230
  {
231
- '@headers' => hash['headers'] ? Marshal.load(hash['headers']) : { 'content-type' => [''] },
231
+ '@headers' => hash['headers'] && !hash['headers'].empty? ? Marshal.load(hash['headers']) : { 'content-type' => [''] },
232
232
  '@body' => hash['body'],
233
233
  '@links' => hash['links'] ? hash['links'].map { |link| URI(link) } : [],
234
234
  '@code' => hash['code'].to_i,
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  module Polipus
3
- VERSION = '0.3.6'
3
+ VERSION = '0.3.7'
4
4
  HOMEPAGE = 'https://github.com/taganaka/polipus'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polipus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Laurita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2014-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-bloomfilter