Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed JRuby (1.9 mode) incompatibilty

For further information see the ticket for JRUBY-6389:
http://jira.codehaus.org/browse/JRUBY-6389

This potentially closes #6.

Also added travis config for jruby-head and jruby 1.8 mode
  • Loading branch information...
commit 40baed6cf7326025058a131c2b76047345618539 1 parent 6678f5e
@dennisreimann dennisreimann authored
Showing with 9 additions and 8 deletions.
  1. +2 −0  .travis.yml
  2. +7 −8 lib/openid/store/filesystem.rb
View
2  .travis.yml
@@ -4,5 +4,7 @@ rvm:
- 1.9.2
- 1.9.3
- ree
+ - jruby-18mode
- jruby-19mode
+ - jruby-head
script: rake
View
15 lib/openid/store/filesystem.rb
@@ -13,10 +13,9 @@ class Filesystem < Interface
# Create a Filesystem store instance, putting all data in +directory+.
def initialize(directory)
- p_dir = Pathname.new(directory)
- @nonce_dir = p_dir.join('nonces')
- @association_dir = p_dir.join('associations')
- @temp_dir = p_dir.join('temp')
+ @nonce_dir = File.join(directory, 'nonces')
+ @association_dir = File.join(directory, 'associations')
+ @temp_dir = File.join(directory, 'temp')
self.ensure_dir(@nonce_dir)
self.ensure_dir(@association_dir)
@@ -40,7 +39,7 @@ def get_association_filename(server_url, handle)
handle_hash = ''
end
filename = [proto,domain,url_hash,handle_hash].join('-')
- @association_dir.join(filename)
+ File.join(@association_dir, filename)
end
# Store an association in the assoc directory
@@ -155,7 +154,7 @@ def use_nonce(server_url, timestamp, salt)
nonce_fn = '%08x-%s-%s-%s-%s'%[timestamp, proto, domain, url_hash, salt_hash]
- filename = @nonce_dir.join(nonce_fn)
+ filename = File.join(@nonce_dir, nonce_fn)
begin
fd = File.new(filename, File::CREAT | File::EXCL | File::WRONLY, 0200)
@@ -174,7 +173,7 @@ def cleanup
end
def cleanup_associations
- association_filenames = Dir[@association_dir.join("*").to_s]
+ association_filenames = Dir[File.join(@association_dir, "*")]
count = 0
association_filenames.each do |af|
begin
@@ -204,7 +203,7 @@ def cleanup_associations
end
def cleanup_nonces
- nonces = Dir[@nonce_dir.join("*").to_s]
+ nonces = Dir[File.join(@nonce_dir, "*")]
now = Time.now.to_i
count = 0
Please sign in to comment.
Something went wrong with that request. Please try again.