Fix compat with ruby < 2.5
This commit is contained in:
parent
81473fb2b4
commit
5a07820472
@ -1,4 +1,5 @@
|
|||||||
require "pg_ldap_sync/application"
|
require "pg_ldap_sync/application"
|
||||||
|
require "pg_ldap_sync/compat"
|
||||||
require "pg_ldap_sync/version"
|
require "pg_ldap_sync/version"
|
||||||
|
|
||||||
module PgLdapSync
|
module PgLdapSync
|
||||||
|
9
lib/pg_ldap_sync/compat.rb
Normal file
9
lib/pg_ldap_sync/compat.rb
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/env ruby
|
||||||
|
|
||||||
|
class Hash
|
||||||
|
def transform_keys
|
||||||
|
map do |k, v|
|
||||||
|
[yield(k), v]
|
||||||
|
end.to_h
|
||||||
|
end unless method_defined? :transform_keys
|
||||||
|
end
|
Reference in New Issue
Block a user