Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Commit

Permalink
Merge b1b9901 into 9e720c8
Browse files Browse the repository at this point in the history
  • Loading branch information
jdantonio committed Dec 6, 2014
2 parents 9e720c8 + b1b9901 commit 779aede
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 21 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
repo_token: YHujQy7tqpw5P0TuWjwk6Vd5Vuw8LcGvo
35 changes: 32 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
.*.sw?
lib/atomic_reference.jar
/nbproject
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
Expand Down
17 changes: 14 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
language: ruby
rvm:
- 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-18mode
- jruby-19mode
- jruby-head
- rbx-2
jdk:
- oraclejdk8
branches:
only:
- master
matrix:
allow_failures:
- rvm: rbx-2
- rvm: ruby-head
- rvm: jruby-head
- rvm: 1.9.3
15 changes: 12 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
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
gem 'coveralls', '~> 0.7.0', :require => false
end
43 changes: 33 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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) [![Coverage Status](https://img.shields.io/coveralls/ruby-concurrency/atomic.svg)](https://coveralls.io/r/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:

Expand All @@ -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.

Expand Down Expand Up @@ -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.
5 changes: 3 additions & 2 deletions atomic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

Gem::Specification.new do |s|
s.name = %q{atomic}
s.version = "1.1.16"
s.version = "1.1.17"
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"]
Expand All @@ -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
3 changes: 3 additions & 0 deletions test/test_atomic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

require 'coveralls'
Coveralls.wear!

require 'minitest/autorun'
require 'atomic'

Expand Down

0 comments on commit 779aede

Please sign in to comment.