diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..271b0c9 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +repo_token: YHujQy7tqpw5P0TuWjwk6Vd5Vuw8LcGvo diff --git a/.gitignore b/.gitignore index 5f3f73d..701b996 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,37 @@ -.*.sw? -lib/atomic_reference.jar -/nbproject -ext/*.bundle -ext/*.so -ext/*.jar +Gemfile.lock +*.gem +lib/1.8 +lib/1.9 +lib/2.0 +.rvmrc +.ruby-version +.ruby-gemset +.bundle/* +.yardoc/* +yardoc/* +tmp/* +man/* +*.tmproj +rdoc/* +*.orig +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* +git_pull.txt +coverage +critic +.DS_Store +TAGS +tmtags +*.sw? +.idea +.rbx/* +lib/**/*.bundle +lib/**/*.so +lib/**/*.jar +ext/**/*.bundle +ext/**/*.so +ext/**/*.jar pkg *.gem diff --git a/.travis.yml b/.travis.yml index 315bff9..6bc5ce2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,27 @@ language: ruby + rvm: + - 2.2.0 + - 2.1.5 + - 2.1.4 - 2.0.0 - 1.9.3 - - 1.8.7 - - jruby-18mode # JRuby in 1.8 mode - - jruby-19mode # JRuby in 1.9 mode + - ruby-head + - jruby-1.7.18 + - jruby-head - rbx-2 + jdk: - oraclejdk8 + +sudo: false + +branches: + only: + - master + +matrix: + allow_failures: + - rvm: ruby-head + - rvm: jruby-head + - rvm: 1.9.3 diff --git a/Gemfile b/Gemfile index 55034a9..d7e193e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,12 @@ -source "https://rubygems.org" +source 'https://rubygems.org' -gem 'rake-compiler' -gem 'minitest', '>= 5.0.0', :group => :development +gemspec + +group :development do + gem 'rake', '~> 10.3.2' + gem 'rake-compiler', '~> 0.9.2' +end + +group :testing do + gem 'minitest', '>= 5.0.0', :group => :development +end diff --git a/README.md b/README.md index 6001f9f..d48c59a 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,35 @@ -atomic: An atomic reference implementation for JRuby, Rubinius, and MRI. -======================================================================== +# Ruby Atomic -[![Build Status](https://travis-ci.org/headius/ruby-atomic.png?branch=master)](https://travis-ci.org/headius/ruby-atomic) +[![Gem Version](https://badge.fury.io/rb/atomic.svg)](http://badge.fury.io/rb/atomic) [![Build Status](https://travis-ci.org/ruby-concurrency/atomic.svg?branch=master)](https://travis-ci.org/ruby-concurrency/atomic) [![Code Climate](https://codeclimate.com/github/ruby-concurrency/atomic.svg)](https://codeclimate.com/github/ruby-concurrency/atomic) [![Dependency Status](https://gemnasium.com/ruby-concurrency/atomic.svg)](https://gemnasium.com/ruby-concurrency/atomic) [![License](https://img.shields.io/badge/license-Apache-green.svg)](http://opensource.org/licenses/Apache-2.0) [![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/ruby-concurrency/concurrent-ruby) -Summary -======= +An atomic reference implementation for JRuby, Rubinius, and MRI. + +# Deprecated! + +*This gem has been deprecated in lieu of [Concurrent Ruby](http://www.concurrent-ruby.com). +This gem will be retained in GitHUb and Rubygems.org indefinitely but no new development +will occur, including updates to support new versions of Ruby, JRuby, and Java. All users +of this gem are encouraged to update their projects to use `concurrent-ruby` instead.* + +All code from this gem has been merged into `concurrent-ruby` and its companion gems. +All abstrations in this library are available in `concurrent-ruby` but have been moved +under the `Concurrent` module to avoid namespace collisions. + +```ruby +# old way +require 'atomic' +my_atomic = Atomic.new(0) + +# new way +require 'concurrent' +my_atomic = Concurrent::Atomic.new(0) +``` + +# Old Documentation + +*For historic purposes only...* + +## Summary This library provides: @@ -15,10 +40,9 @@ The Atomic class provides accessors for the contained "value" plus two update me * update will run the provided block, passing the current value and replacing it with the block result if the value has not been changed in the meantime. It may run the block repeatedly if there are other concurrent updates in progress. * try_update will run the provided block, passing the current value and replacing it with the block result. If the value changes before the update can happen, it will throw an Atomic::ConcurrentUpdateError. -The atomic repository is at http://github.com/headius/ruby-atomic. +The atomic repository is at http://github.com/ruby-concurrency/ruby-atomic. -Usage -===== +## Usage The simplest way to use "atomic" is to call the "update" or "try_update" methods. @@ -47,7 +71,6 @@ my_atomic.compare_and_swap(2, 3) # => true, updated to 3 my_atomic.compare_and_swap(2, 3) # => false, current is not 2 ``` -Building -======== +## Building As of 1.1.0, JDK8 is required to build the atomic gem, since it attempts to use the new atomic Unsafe.getAndSetObject method only in JDK8. The resulting code should still work fine as far back as Java 5. diff --git a/Rakefile b/Rakefile index a0e109c..03e5ce5 100644 --- a/Rakefile +++ b/Rakefile @@ -13,8 +13,6 @@ require 'rake' require 'rake/testtask' -task :default => :test - desc "Run tests" Rake::TestTask.new :test do |t| t.libs << "lib" @@ -61,3 +59,5 @@ end task :package => :compile task :test => :compile + +task :default => :test diff --git a/atomic.gemspec b/atomic.gemspec index 3f65f94..8871198 100644 --- a/atomic.gemspec +++ b/atomic.gemspec @@ -4,13 +4,13 @@ Gem::Specification.new do |s| s.name = %q{atomic} - s.version = "1.1.16" + s.version = "1.1.99" s.authors = ["Charles Oliver Nutter", "MenTaLguY", "Sokolov Yura"] s.date = Time.now.strftime('%Y-%m-%d') s.summary = "An atomic reference implementation for JRuby, Rubinius, and MRI" s.description = s.summary s.email = ["headius@headius.com", "mental@rydia.net", "funny.falcon@gmail.com"] - s.homepage = "http://github.com/headius/ruby-atomic" + s.homepage = "http://github.com/ruby-concurrency/ruby-atomic" s.require_paths = ["lib"] s.licenses = ["Apache-2.0"] s.test_files = Dir["test/test*.rb"] @@ -21,4 +21,5 @@ Gem::Specification.new do |s| s.extensions = 'ext/extconf.rb' end s.files += `git ls-files`.lines.map(&:chomp) + s.post_install_message = 'This gem has been deprecated in lieu of Concurrent Ruby (http://concurrent-ruby.com).' end