activeresource-response 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -6,6 +6,10 @@ This gem adds possibility to access http response object from result of activere
6
6
  Such functionallity can be used for easily implementing pagination in a REST API so that an ActiveResource client can navigate paginated results.
7
7
 
8
8
  == How to use?
9
+ Add dependency to your Gemfile
10
+
11
+ gem "activeresource-response", "~> 0.0.3"
12
+
9
13
  Just open your ActiveResource class and add
10
14
 
11
15
  add_response_method :your_method_name
@@ -4,7 +4,7 @@ require "activeresource-response/version"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "activeresource-response"
7
- s.version = ActiveresourceResponse::VERSION
7
+ s.version = ActiveresourceResponse::Version::VERSION
8
8
  s.authors = ["Igor Fedoronchuk"]
9
9
  s.email = ["fedoronchuk@gmail.com"]
10
10
  s.homepage = "https://github.com/Fivell/activeresource-response"
@@ -2,14 +2,16 @@ require "activeresource-response/version"
2
2
  module ActiveresourceResponse
3
3
  module Connection
4
4
  def self.included(base)
5
- base.class_eval <<-EOS
5
+ base.class_eval do
6
6
  alias_method :origin_handle_response, :handle_response
7
- attr_reader :http_response
8
7
  def handle_response(response)
9
- @http_response= response
8
+ Thread.current['ActiveResource::Base.http_response'] = response
10
9
  origin_handle_response(response)
11
10
  end
12
- EOS
11
+ def http_response
12
+ Thread.current['ActiveResource::Base.http_response']
13
+ end
14
+ end
13
15
  end
14
16
  end
15
17
  module AddResponseMethod
@@ -1,3 +1,5 @@
1
1
  module ActiveresourceResponse
2
- VERSION = "0.0.3"
2
+ module Version
3
+ VERSION = "0.0.4"
4
+ end
3
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: activeresource-response
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.3
5
+ version: 0.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Igor Fedoronchuk
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-02-15 00:00:00 Z
13
+ date: 2012-02-16 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activeresource