Permalink
Browse files

Call #to_str on the argument given to DB#{new, create, load}

This matches the behavior of `File.open`. In particular, it allows us
to pass Pathname objects (from the pathname standard library) to the
DB functions.
  • Loading branch information...
1 parent 0693805 commit 9a230873f2364e0dc96f76d230a1d399ebab484f @DataWraith DataWraith committed Oct 16, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/leveldb.rb
View
@@ -8,19 +8,19 @@ class << self
## Loads or creates a LevelDB database as necessary, stored on disk at
## +pathname+.
def new pathname
- make pathname, true, false
+ make pathname.to_str, true, false
end
## Creates a new LevelDB database stored on disk at +pathname+. Throws an
## exception if the database already exists.
def create pathname
- make pathname, true, true
+ make pathname.to_str, true, true
end
## Loads a LevelDB database stored on disk at +pathname+. Throws an
## exception unless the database already exists.
def load pathname
- make pathname, false, false
+ make pathname.to_str, false, false
end
end

0 comments on commit 9a23087

Please sign in to comment.