Skip to content

Commit 791b8c0

Browse files
authored
Merge pull request #136 from aayush2610/master
Allow support for ActiveSupport~>5
2 parents 2e74c43 + 21d6f05 commit 791b8c0

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

lib/wrest/components/container/typecaster.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ module Typecaster
2424
def self.included(klass) #:nodoc:
2525
klass.extend Typecaster::ClassMethods
2626
klass.class_eval{ include Typecaster::InstanceMethods }
27-
klass.alias_method_chain :initialize, :typecasting
27+
klass.send(:alias_method, :initialize_without_typecasting, :initialize)
28+
klass.send(:alias_method, :initialize, :initialize_with_typecasting)
2829
end
2930

3031
module Helpers

lib/wrest/native/get.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ def invoke_with_cache_check
5555
cache_proxy.get
5656
end
5757

58-
alias_method_chain :invoke, :cache_check
58+
alias_method :invoke_without_cache_check, :invoke
59+
alias_method :invoke, :invoke_with_cache_check
5960

6061
def build_request_without_cache_store(cache_validation_headers)
6162
new_headers = headers.clone.merge cache_validation_headers

lib/wrest/native/request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def initialize(wrest_uri, http_request_klass, parameters = {}, body = nil, heade
8080
# The request hash is followed by a connection hash; requests using the
8181
# same connection (effectively a keep-alive connection) will have the
8282
# same connection hash.
83+
#
84+
# Passing nil for either username or password will skip HTTP authentication
8385
#
8486
# This is followed by the response code, the payload size and the time taken.
8587
def invoke

lib/wrest/uri.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Uri
3636
# defaults if there are any clashes. Use this to set cookies or use OAuth2 Authorize
3737
# headers. When extending or cloning a Uri, passing in a new set of default_headers
3838
# will result in the old set being overridden.
39+
# :username, :password => HTTP authentication. Passing nil for either username or password will skip it.
3940
# See Wrest::Native::Request for other available options and their default values.
4041
def initialize(uri_string, options = {})
4142
@options = options.clone

wrest.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
3030
s.add_development_dependency "rspec", ["~> 3.3"]
3131
s.add_development_dependency "sinatra", ["~> 1.0.0"]
3232

33-
s.add_runtime_dependency "activesupport", ["~> 4"]
33+
s.add_runtime_dependency "activesupport", ["~> 5"]
3434
s.add_runtime_dependency "builder", ["> 2.0"]
3535
s.add_runtime_dependency "multi_json", ["~> 1.0"]
3636
s.add_runtime_dependency "concurrent-ruby", ["~> 1.0"]

0 commit comments

Comments
 (0)