-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecation in preparation for pg as an optional dependency, refs #640
- Loading branch information
1 parent
304328f
commit a9e3ca0
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
# frozen_string_literal: true | ||
# | ||
module Valkyrie::Persistence | ||
# Implements the DataMapper Pattern to store metadata into Postgres | ||
module Postgres | ||
# Deprecation to allow us to make pg an optional dependency | ||
path = Bundler.definition.gemfiles.first | ||
matches = File.readlines(path).select { |l| l =~ /gem ['"]pg\b/ } | ||
if matches.empty? | ||
warn "[DEPRECATION] pg will not be included as a dependency in Valkyrie's gemspec as of the next major release. Please add the gem directly to your Gemfile if you use a postgres adapter." | ||
end | ||
|
||
require 'valkyrie/persistence/postgres/metadata_adapter' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters