Skip to content
This repository was archived by the owner on Mar 15, 2022. It is now read-only.
Closed
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
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: ruby
rvm:
- 2.4.0
- 2.3.3
- 2.2.0
- 2.1.5
- 2.1.4
Expand All @@ -14,6 +16,12 @@ jdk: # for JRuby only
- oraclejdk8
matrix:
exclude:
- rvm: 2.4.0
jdk: openjdk7
jdk: oraclejdk8
- rvm: 2.3.3
jdk: openjdk7
jdk: oraclejdk8
- rvm: 2.2.0
jdk: openjdk7
jdk: oraclejdk8
Expand All @@ -40,4 +48,4 @@ matrix:
- rvm: jruby-head
- rvm: 1.9.3

script: "rake test"
script: "bundle exec rake test"
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ gemspec
group :development, :test do
gem 'rspec', '~> 3.2.0'
gem 'simplecov', '~> 0.9.2', :require => false
gem 'tins', '~> 1.10.2', :require => false
gem 'coveralls', '~> 0.7.11', :require => false
end

Expand Down
4 changes: 2 additions & 2 deletions lib/thread_safe/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def populate_from(hash)
end

def validate_options_hash!(options)
if (initial_capacity = options[:initial_capacity]) && (!initial_capacity.kind_of?(Fixnum) || initial_capacity < 0)
raise ArgumentError, ":initial_capacity must be a positive Fixnum"
if (initial_capacity = options[:initial_capacity]) && (!initial_capacity.kind_of?(0.class) || initial_capacity < 0)
raise ArgumentError, ":initial_capacity must be a positive #{0.class}"
end
if (load_factor = options[:load_factor]) && (!load_factor.kind_of?(Numeric) || load_factor <= 0 || load_factor > 1)
raise ArgumentError, ":load_factor must be a number between 0 and 1"
Expand Down
2 changes: 1 addition & 1 deletion thread_safe.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ Gem::Specification.new do |gem|
gem.license = "Apache-2.0"

gem.add_development_dependency 'atomic', '= 1.1.16'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'rake', '< 12.0'
gem.add_development_dependency 'rspec', '~> 3.2'
end