From a0b8b019de2a47d92a4fc8bf52f3a798c5728dfd Mon Sep 17 00:00:00 2001 From: marc tobias Date: Wed, 24 Apr 2019 19:34:49 +0200 Subject: [PATCH] bundler 1.17 --- .travis.yml | 4 ++++ kong.gemspec | 2 +- lib/kong/belongs_to_consumer.rb | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 352ddaf..07dca1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,8 @@ rvm: - 2.5 - 2.6 cache: bundler +before_install: + - # we want bundler 1.7 (for now) https://docs.travis-ci.com/user/languages/ruby/ + - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true + - gem install bundler -v '< 2' script: bundle install && bundle exec rspec spec/ diff --git a/kong.gemspec b/kong.gemspec index d5f646f..6e17ea8 100644 --- a/kong.gemspec +++ b/kong.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.0.0" - spec.add_development_dependency "bundler", "~> 1.7" + spec.add_development_dependency "bundler", "~> 1.17" spec.add_development_dependency "rake", "~> 12.0" spec.add_runtime_dependency "excon" end diff --git a/lib/kong/belongs_to_consumer.rb b/lib/kong/belongs_to_consumer.rb index 9d3a746..24cd482 100644 --- a/lib/kong/belongs_to_consumer.rb +++ b/lib/kong/belongs_to_consumer.rb @@ -13,9 +13,8 @@ def consumer if @consumer return @consumer elsif self.attributes['consumer'] && self.attributes['consumer'].instance_of?(Hash) - @consumer = Consumer.new(attributes['consumer']) - return @consumer - elsif self.attributes['consumer'] && self..attributes['consumer'].instance_of?(Kong::Consumer) + return @consumer = Consumer.new(attributes['consumer']) + elsif self.attributes['consumer'] && self.attributes['consumer'].instance_of?(Kong::Consumer) @consumer = self.attributes['consumer'] return @consumer end