tiny_grabber 0.3.3 → 0.3.4

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: 59ce991862e0f0345b9e762dd9106c490dce9cf3
4
- data.tar.gz: 062c6d55305f54813462ab63e232214f0d35905c
3
+ metadata.gz: aecfdbfd15b0451467b5cd9dcff604fe00c0a672
4
+ data.tar.gz: 95f781f2171147e647a075d418bf5f0e59713eed
5
5
  SHA512:
6
- metadata.gz: 97c84f6d61c383dd8ef839773df38ae34278a39b1a880f82cfc88dadd119ed41c39818f7319659c3f722b6cc0b7f6d92d9c11fdafc286320660b8f1e8b51ac25
7
- data.tar.gz: 2c4eecb09be37a45d93f71e3980c06bd1a8888c57f8a0e308547dc52822fa77a22c3421d6b607a69992a25510ab82911646d450451a58422da14c2abfd3b5969
6
+ metadata.gz: 757cf78d7e9cf1fa59d127ed09a4709e3f04b7f5f688ef97f9f13790265924702f26f89e86f21f9f7372ed7447035be5b9938627727b410075cab65df7c733ca
7
+ data.tar.gz: 4952c9ea0bb912d693ca0c892028ad4e857d68896673e2bbef9392c3891c3a4d6fc50d39927a529906652f76d2d628c66f8ffc96107f6da9d44e548c5fcc5572
data/README.md CHANGED
@@ -126,6 +126,8 @@ response.body
126
126
 
127
127
  ## Changelog
128
128
 
129
+ * *v 0.3.4*
130
+ * Return URI of last request was added
129
131
  * *v 0.3.3*
130
132
  * Format cookies was changed
131
133
  * *v 0.3.2*
@@ -22,6 +22,8 @@ class TinyGrabber
22
22
  attr_writer :verify_mode
23
23
  # Follow location
24
24
  attr_writer :follow_location
25
+ # Uri
26
+ attr_accessor :uri
25
27
 
26
28
  # Agent aliases given from http://www.useragentstring.com/pages/Chrome/
27
29
  AGENT_ALIASES = [
@@ -312,10 +314,13 @@ class TinyGrabber
312
314
  # Save response cookies in agent attribute
313
315
  #
314
316
  def save_cookies
315
- return unless @response.cookies
316
- # @cookies = @response['Set-Cookie']
317
- @cookies = @response.cookies
318
- @debug.save "<- [cookies] = #{@cookies}" if @debug.active
317
+ if @response.respond_to?(:cookies)
318
+ return unless @response.cookies
319
+ @cookies = @response.cookies
320
+ else
321
+ return unless @response['Set-Cookie']
322
+ @cookies = @response['Set-Cookie']
323
+ end
319
324
  end
320
325
 
321
326
  # Clears headers and cookies
@@ -1,4 +1,4 @@
1
1
  class TinyGrabber
2
2
  # Version number
3
- VERSION = '0.3.3'.freeze
3
+ VERSION = '0.3.4'.freeze
4
4
  end
data/lib/tiny_grabber.rb CHANGED
@@ -177,4 +177,10 @@ class TinyGrabber
177
177
  def follow_location=(follow_location)
178
178
  @agent.follow_location = follow_location
179
179
  end
180
+
181
+ # Read URI
182
+ #
183
+ def uri
184
+ @agent.uri
185
+ end
180
186
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_grabber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksandr Chernyshev