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

Commit b1b9901

Browse files
alexdowadjdantonio
authored andcommitted
Updated README, added badges, integrated Coveralls and Code Climate.
1 parent 0318aa5 commit b1b9901

File tree

8 files changed

+100
-24
lines changed

8 files changed

+100
-24
lines changed

.coveralls.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
repo_token: YHujQy7tqpw5P0TuWjwk6Vd5Vuw8LcGvo

.gitignore

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
1-
.*.sw?
2-
lib/atomic_reference.jar
3-
/nbproject
1+
Gemfile.lock
2+
*.gem
3+
lib/1.8
4+
lib/1.9
5+
lib/2.0
6+
.rvmrc
7+
.ruby-version
8+
.ruby-gemset
9+
.bundle/*
10+
.yardoc/*
11+
yardoc/*
12+
tmp/*
13+
man/*
14+
*.tmproj
15+
rdoc/*
16+
*.orig
17+
*.BACKUP.*
18+
*.BASE.*
19+
*.LOCAL.*
20+
*.REMOTE.*
21+
git_pull.txt
22+
coverage
23+
critic
24+
.DS_Store
25+
TAGS
26+
tmtags
27+
*.sw?
28+
.idea
29+
.rbx/*
30+
lib/*.bundle
31+
lib/*.so
32+
lib/*.jar
433
ext/*.bundle
534
ext/*.so
635
ext/*.jar

.travis.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
language: ruby
22
rvm:
3+
- 2.1.4
34
- 2.0.0
45
- 1.9.3
5-
- 1.8.7
6-
- jruby-18mode # JRuby in 1.8 mode
7-
- jruby-19mode # JRuby in 1.9 mode
6+
- ruby-head
7+
- jruby-18mode
8+
- jruby-19mode
9+
- jruby-head
810
- rbx-2
911
jdk:
1012
- oraclejdk8
13+
branches:
14+
only:
15+
- master
16+
matrix:
17+
allow_failures:
18+
- rvm: rbx-2
19+
- rvm: ruby-head
20+
- rvm: jruby-head
21+
- rvm: 1.9.3

Gemfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
source "https://rubygems.org"
1+
source 'https://rubygems.org'
22

3-
gem 'rake-compiler'
4-
gem 'minitest', '>= 5.0.0', :group => :development
3+
gemspec
4+
5+
group :development do
6+
gem 'rake', '~> 10.3.2'
7+
gem 'rake-compiler', '~> 0.9.2'
8+
end
9+
10+
group :testing do
11+
gem 'minitest', '>= 5.0.0', :group => :development
12+
gem 'coveralls', '~> 0.7.0', :require => false
13+
end

README.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,35 @@
1-
atomic: An atomic reference implementation for JRuby, Rubinius, and MRI.
2-
========================================================================
1+
# Ruby Atomic
32

4-
[![Build Status](https://travis-ci.org/headius/ruby-atomic.png?branch=master)](https://travis-ci.org/headius/ruby-atomic)
3+
[![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)
54

6-
Summary
7-
=======
5+
An atomic reference implementation for JRuby, Rubinius, and MRI.
6+
7+
# Deprecated!
8+
9+
*This gem has been deprecated in lieu of [Concurrent Ruby](http://www.concurrent-ruby.com).
10+
This gem will be retained in GitHUb and Rubygems.org indefinitely but no new development
11+
will occur, including updates to support new versions of Ruby, JRuby, and Java. All users
12+
of this gem are encouraged to update their projects to use `concurrent-ruby` instead.*
13+
14+
All code from this gem has been merged into `concurrent-ruby` and its companion gems.
15+
All abstrations in this library are available in `concurrent-ruby` but have been moved
16+
under the `Concurrent` module to avoid namespace collisions.
17+
18+
```ruby
19+
# old way
20+
require 'atomic'
21+
my_atomic = Atomic.new(0)
22+
23+
# new way
24+
require 'concurrent'
25+
my_atomic = Concurrent::Atomic.new(0)
26+
```
27+
28+
# Old Documentation
29+
30+
*For historic purposes only...*
31+
32+
## Summary
833

934
This library provides:
1035

@@ -15,10 +40,9 @@ The Atomic class provides accessors for the contained "value" plus two update me
1540
* 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.
1641
* 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.
1742

18-
The atomic repository is at http://github.com/headius/ruby-atomic.
43+
The atomic repository is at http://github.com/ruby-concurrency/ruby-atomic.
1944

20-
Usage
21-
=====
45+
## Usage
2246

2347
The simplest way to use "atomic" is to call the "update" or "try_update" methods.
2448

@@ -47,7 +71,6 @@ my_atomic.compare_and_swap(2, 3) # => true, updated to 3
4771
my_atomic.compare_and_swap(2, 3) # => false, current is not 2
4872
```
4973

50-
Building
51-
========
74+
## Building
5275

5376
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.

atomic.gemspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
Gem::Specification.new do |s|
66
s.name = %q{atomic}
7-
s.version = "1.1.16"
7+
s.version = "1.1.17"
88
s.authors = ["Charles Oliver Nutter", "MenTaLguY", "Sokolov Yura"]
99
s.date = Time.now.strftime('%Y-%m-%d')
1010
s.summary = "An atomic reference implementation for JRuby, Rubinius, and MRI"
1111
s.description = s.summary
1212
13-
s.homepage = "http://github.com/headius/ruby-atomic"
13+
s.homepage = "http://github.com/ruby-concurrency/ruby-atomic"
1414
s.require_paths = ["lib"]
1515
s.licenses = ["Apache-2.0"]
1616
s.test_files = Dir["test/test*.rb"]
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
2121
s.extensions = 'ext/extconf.rb'
2222
end
2323
s.files += `git ls-files`.lines.map(&:chomp)
24+
s.post_install_message = 'This gem has been deprecated in lieu of Concurrent Ruby (http://concurrent-ruby.com).'
2425
end

ext/atomic_reference.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ static VALUE ir_set(VALUE self, VALUE new_value) {
6060
}
6161

6262
static VALUE ir_get_and_set(VALUE self, VALUE new_value) {
63-
VALUE old_value;
64-
old_value = (VALUE) DATA_PTR(self);
65-
DATA_PTR(self) = (void *) new_value;
63+
VALUE old_value = ir_get(self);
64+
ir_set(self, new_value);
6665
return old_value;
6766
}
6867

test/test_atomic.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13+
require 'coveralls'
14+
Coveralls.wear!
15+
1316
require 'minitest/autorun'
1417
require 'atomic'
1518

0 commit comments

Comments
 (0)