diff --git a/Rakefile b/Rakefile index d6c5113..3d52175 100644 --- a/Rakefile +++ b/Rakefile @@ -4,7 +4,7 @@ require "rake/testtask" Rake::TestTask.new(:test) do |t| t.libs << "test" t.libs << "lib" - t.test_files = FileList['test/**/*_test.rb'] + t.test_files = FileList["test/**/*_test.rb"] end -task :default => :test +task default: :test diff --git a/inny.gemspec b/inny.gemspec index c90a09d..98536d1 100644 --- a/inny.gemspec +++ b/inny.gemspec @@ -1,33 +1,35 @@ # coding: utf-8 -lib = File.expand_path('../lib', __FILE__) +lib = File.expand_path("../lib", __FILE__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'inny/version' +require "inny/version" Gem::Specification.new do |spec| - spec.name = "inny" - spec.version = Inny::VERSION - spec.authors = ["Dan Barber"] - spec.email = ["github@danbarber.me"] + spec.name = "inny" + spec.version = Inny::VERSION + spec.authors = ["Dan Barber"] + spec.email = ["github@danbarber.me"] - spec.summary = %q{Better syntax for testing whether an object is in a list} - spec.description = %q{Better syntax for testing whether an object is in a list} - spec.homepage = "https://github.com/danbee/inny" - spec.license = "MIT" + spec.summary = "Better syntax for testing whether an object is in a list" + spec.description = "Better syntax for testing whether an object is in a list" + spec.homepage = "https://github.com/danbee/inny" + spec.license = "MIT" # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or # delete this section to allow pushing this gem to any host. if spec.respond_to?(:metadata) - spec.metadata['allowed_push_host'] = "https://rubygems.org" + spec.metadata["allowed_push_host"] = "https://rubygems.org" else raise "RubyGems 2.0 or newer is required to protect against public gem pushes." end - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } - spec.bindir = "exe" - spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } + spec.files = + `git ls-files -z`.split("\x0") + .reject { |f| f.match(%r{^(test|spec|features)/}) } + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ["lib"] - spec.add_development_dependency "bundler", "~> 1.10" - spec.add_development_dependency "rake", "~> 10.0" + spec.add_development_dependency "bundler", "~> 2.4" + spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "minitest" end diff --git a/lib/inny.rb b/lib/inny.rb index b4fdd70..0925c26 100644 --- a/lib/inny.rb +++ b/lib/inny.rb @@ -2,11 +2,11 @@ require "inny/version" module Inny def in?(object) - begin - object.include?(self) - rescue NoMethodError - raise ArgumentError.new("The parameter passed to #in? must respond to #include?") - end + object.include?(self) + rescue NoMethodError + raise ArgumentError.new( + "The parameter passed to #in? must respond to #include?" + ) end end diff --git a/lib/inny/version.rb b/lib/inny/version.rb index e647e2e..0b0791a 100644 --- a/lib/inny/version.rb +++ b/lib/inny/version.rb @@ -1,3 +1,3 @@ module Inny - VERSION = "2.0.1" + VERSION = "3.0.0" end diff --git a/test/inny_test.rb b/test/inny_test.rb index 8a127a8..00740b8 100644 --- a/test/inny_test.rb +++ b/test/inny_test.rb @@ -1,4 +1,4 @@ -require 'test_helper' +require "test_helper" class InnyTest < Minitest::Test def test_that_it_has_a_version_number @@ -11,19 +11,19 @@ class InnyTest < Minitest::Test end def test_it_finds_strings - assert 'Egg'.in?(['Bacon', 'Sausage', 'Egg']) - refute 'Egg'.in?(['Apple', 'Orange', 'Banana']) + assert "Egg".in?(%w[Bacon Sausage Egg]) + refute "Egg".in?(%w[Apple Orange Banana]) end def test_it_finds_substrings - assert 'bar'.in?('Foobar') - refute 'egg'.in?('Foobar') + assert "bar".in?("Foobar") + refute "egg".in?("Foobar") end def test_it_finds_things_in_an_array - list = ['John', 'Jimmy', 'Robert'] + list = %w[John Jimmy Robert] - assert 'Jimmy'.in?(list) - refute 'John Paul'.in?(list) + assert "Jimmy".in?(list) + refute "John Paul".in?(list) end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 9aec82f..b213b36 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,4 +1,4 @@ -$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) -require 'inny' +$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__) +require "inny" -require 'minitest/autorun' +require "minitest/autorun"