atomic 0.0.7-java → 0.0.8-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/atomic.gemspec +3 -3
  2. data/lib/atomic.rb +10 -1
  3. metadata +4 -4
data/atomic.gemspec CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{atomic}
5
- s.version = "0.0.7"
5
+ s.version = "0.0.8"
6
6
  s.authors = ["Charles Oliver Nutter", "MenTaLguY"]
7
7
  s.date = Time.now.strftime('%Y-%m-%d')
8
- s.description = "An atomic reference implementation for JRuby and green or GIL-threaded impls"
8
+ s.description = "An atomic reference implementation for JRuby, Rubinius, and MRI"
9
9
  s.email = ["headius@headius.com", "mental@rydia.net"]
10
10
  s.homepage = "http://github.com/headius/ruby-atomic"
11
11
  s.require_paths = ["lib"]
12
- s.summary = "An atomic reference implementation for JRuby and green or GIL-threaded impls"
12
+ s.summary = "An atomic reference implementation for JRuby, Rubinius, and MRI"
13
13
  s.test_files = Dir["test/test*.rb"]
14
14
  if defined?(JRUBY_VERSION)
15
15
  s.files = Dir['{lib,examples,test}/**/*'] + Dir['{*.txt,*.gemspec,Rakefile}']
data/lib/atomic.rb CHANGED
@@ -55,8 +55,17 @@ class Atomic
55
55
  end
56
56
 
57
57
  begin
58
- require 'atomic_reference'
58
+ ruby_engine = defined?(RUBY_ENGINE)? RUBY_ENGINE : 'ruby'
59
+ case ruby_engine
60
+ when 'jruby', 'ruby'
61
+ require 'atomic_reference'
62
+ when 'rbx'
63
+ Atomic::InternalReference = Rubinius::AtomicReference
64
+ else
65
+ raise LoadError
66
+ end
59
67
  rescue LoadError
68
+ warn 'unsupported Ruby engine, using less-efficient Atomic impl'
60
69
  # Portable/generic (but not very memory or scheduling-efficient) fallback
61
70
  class Atomic::InternalReference #:nodoc: all
62
71
  def initialize(value)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: atomic
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: java
7
7
  authors:
8
8
  - Charles Oliver Nutter
@@ -11,10 +11,10 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-11-28 00:00:00 Z
14
+ date: 2011-11-29 00:00:00 Z
15
15
  dependencies: []
16
16
 
17
- description: An atomic reference implementation for JRuby and green or GIL-threaded impls
17
+ description: An atomic reference implementation for JRuby, Rubinius, and MRI
18
18
  email:
19
19
  - headius@headius.com
20
20
  - mental@rydia.net
@@ -60,6 +60,6 @@ rubyforge_project:
60
60
  rubygems_version: 1.8.9
61
61
  signing_key:
62
62
  specification_version: 3
63
- summary: An atomic reference implementation for JRuby and green or GIL-threaded impls
63
+ summary: An atomic reference implementation for JRuby, Rubinius, and MRI
64
64
  test_files:
65
65
  - test/test_atomic.rb