Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Merge pull request #298 from tpitale/handle-addressable-2.4
Browse files Browse the repository at this point in the history
Restore addressable v2.4
  • Loading branch information
tpitale committed May 25, 2016
2 parents fc68d0e + 4c24125 commit 226c5af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dm-core.gemspec
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
gem.test_files = `git ls-files -- spec/*`.split($/)
gem.extra_rdoc_files = %w[LICENSE README.md]

gem.add_runtime_dependency('addressable', '~> 2.3.0', '>= 2.3.5')
gem.add_runtime_dependency('addressable', '~> 2.3', '>= 2.3.5')

gem.add_development_dependency('rake', '~> 10.0.3')
gem.add_development_dependency('rspec', '~> 1.3.2')
Expand Down
9 changes: 8 additions & 1 deletion lib/dm-core/adapters.rb
Expand Up @@ -237,7 +237,14 @@ def legacy_path(name)
#
# @api private
def normalize_adapter_name(name)
(original = name.to_s) == 'sqlite3' ? 'sqlite' : original
case (original = name.to_s)
when 'sqlite3'
'sqlite'
when 'inmemory' # Addressable >= v2.4 does not support underscores in scheme
'in_memory'
else
original
end
end

end
Expand Down
4 changes: 2 additions & 2 deletions spec/public/setup_spec.rb
Expand Up @@ -4,7 +4,7 @@
describe '.setup' do
describe 'using connection string' do
before :all do
@return = DataMapper.setup(:setup_test, 'in_memory://user:pass@hostname:1234/path?foo=bar&baz=foo#fragment')
@return = DataMapper.setup(:setup_test, 'inmemory://user:pass@hostname:1234/path?foo=bar&baz=foo#fragment')

@options = @return.options
end
Expand All @@ -22,7 +22,7 @@
end

{
:adapter => 'in_memory',
:adapter => 'inmemory',
:user => 'user',
:password => 'pass',
:host => 'hostname',
Expand Down

0 comments on commit 226c5af

Please sign in to comment.