Skip to content

Commit ea5b88d

Browse files
committed
Alias ruby gem loadable_path to to_path
The sqlite3-ruby recently published an improvement to make it easier and more flexible to load extensions: sparklemotion/sqlite3-ruby#586 Ruby modules for SQLite extensions should implement the interface: interface _ExtensionSpecifier def to_path: () → String end A complementary change in Rails takes advantage of this interface to integrate the primary configuration file with the new sqlite3-ruby interface for extension loading: rails/rails#53827 The gem template provided here already has a similar method: def loadable_path The change proposed here is to modify the gem template to provide an alias to loadable_path as to_path.o # example SqliteVec.to_path # => returns same result as loadable_path As a result of this change, Ruby gems published with this tool will conform to the new interface supported in sqlite3-ruby and Rails.
1 parent 6ea6486 commit ea5b88d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gem.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ module {module_name}
300300
def self.load(db)
301301
db.load_extension(self.loadable_path)
302302
end
303+
class << self
304+
alias_method :to_path, :loadable_path
305+
end
303306
end
304307
305308
"#

0 commit comments

Comments
 (0)