Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ruby 1.9.3 compatibility #135

Merged
merged 2 commits into from
Mar 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
jwt.gemspec
pkg
Gemfile.lock
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ sudo: false
cache: bundler
language: ruby
rvm:
- 1.9.3
- 2.0.0
- 2.1.0
- 2.2.0
Expand Down
8 changes: 4 additions & 4 deletions lib/jwt/verify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module JWT
# JWT verify methods
class Verify
class << self
%i[verify_aud verify_expiration verify_iat verify_iss verify_jti verify_not_before verify_sub].each do |method_name|
%w[verify_aud verify_expiration verify_iat verify_iss verify_jti verify_not_before verify_sub].each do |method_name|
define_method method_name do |payload, options|
new(payload, options).send(method_name)
end
Expand All @@ -17,7 +17,7 @@ def initialize(payload, options)
end

def verify_aud
return unless options_aud = extract_option(:aud)
return unless (options_aud = extract_option(:aud))

if @payload['aud'].is_a?(Array)
fail(
Expand Down Expand Up @@ -49,7 +49,7 @@ def verify_iat
end

def verify_iss
return unless options_iss = extract_option(:iss)
return unless (options_iss = extract_option(:iss))

if @payload['iss'].to_s != options_iss.to_s
fail(
Expand Down Expand Up @@ -77,7 +77,7 @@ def verify_not_before
end

def verify_sub
return unless options_sub = extract_option(:sub)
return unless (options_sub = extract_option(:sub))

fail(
JWT::InvalidSubError,
Expand Down
1 change: 0 additions & 1 deletion ruby-jwt.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'simplecov-json'
spec.add_development_dependency 'codeclimate-test-reporter'
spec.add_development_dependency 'byebug'
end