This repository has been archived by the owner on Apr 17, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dm-postgres-adapter extracted from dm-core
- Loading branch information
0 parents
commit 640d0cd
Showing
11 changed files
with
212 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2010 Dan Kubb | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
require 'rubygems' | ||
require 'rake' | ||
|
||
begin | ||
gem 'jeweler', '~> 1.4' | ||
require 'jeweler' | ||
|
||
Jeweler::Tasks.new do |gem| | ||
gem.name = 'dm-postgres-adapter' | ||
gem.summary = 'PostgreSQL Adapter for DataMapper' | ||
gem.description = gem.summary | ||
gem.authors = ["Dan Kubb"] | ||
gem.email = %q{dan.kubb@gmail.com} | ||
gem.homepage = 'http://github.com/datamapper/dm-more/tree/master/adapters/%s' % gem.name | ||
|
||
gem.rubyforge_project = 'datamapper' | ||
|
||
gem.add_dependency 'data_objects', '~> 0.10.1' | ||
gem.add_dependency 'do_postgres', '~> 0.10.1' | ||
gem.add_dependency 'dm-core', '~> 0.10.3' | ||
|
||
gem.add_development_dependency 'rspec', '~> 1.3' | ||
gem.add_development_dependency 'yard', '~> 0.5' | ||
end | ||
|
||
Jeweler::GemcutterTasks.new | ||
|
||
FileList['tasks/**/*.rake'].each { |task| import task } | ||
rescue LoadError | ||
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.10.3 |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Generated by jeweler | ||
# DO NOT EDIT THIS FILE DIRECTLY | ||
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command | ||
# -*- encoding: utf-8 -*- | ||
|
||
Gem::Specification.new do |s| | ||
s.name = %q{dm-postgres-adapter} | ||
s.version = "0.10.3" | ||
|
||
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= | ||
s.authors = ["Dan Kubb"] | ||
s.date = %q{2010-02-03} | ||
s.description = %q{PostgreSQL Adapter for DataMapper} | ||
s.email = %q{dan.kubb@gmail.com} | ||
s.extra_rdoc_files = [ | ||
"LICENSE" | ||
] | ||
s.homepage = %q{http://github.com/datamapper/dm-more/tree/master/adapters/dm-postgres-adapter} | ||
s.rdoc_options = ["--charset=UTF-8"] | ||
s.require_paths = ["lib"] | ||
s.rubyforge_project = %q{datamapper} | ||
s.rubygems_version = %q{1.3.5} | ||
s.summary = %q{PostgreSQL Adapter for DataMapper} | ||
|
||
if s.respond_to? :specification_version then | ||
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION | ||
s.specification_version = 3 | ||
|
||
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then | ||
s.add_runtime_dependency(%q<data_objects>, ["~> 0.10.1"]) | ||
s.add_runtime_dependency(%q<do_postgres>, ["~> 0.10.1"]) | ||
s.add_runtime_dependency(%q<dm-core>, ["~> 0.10.3"]) | ||
s.add_development_dependency(%q<rspec>, ["~> 1.3"]) | ||
s.add_development_dependency(%q<yard>, ["~> 0.5"]) | ||
else | ||
s.add_dependency(%q<data_objects>, ["~> 0.10.1"]) | ||
s.add_dependency(%q<do_postgres>, ["~> 0.10.1"]) | ||
s.add_dependency(%q<dm-core>, ["~> 0.10.3"]) | ||
s.add_dependency(%q<rspec>, ["~> 1.3"]) | ||
s.add_dependency(%q<yard>, ["~> 0.5"]) | ||
end | ||
else | ||
s.add_dependency(%q<data_objects>, ["~> 0.10.1"]) | ||
s.add_dependency(%q<do_postgres>, ["~> 0.10.1"]) | ||
s.add_dependency(%q<dm-core>, ["~> 0.10.3"]) | ||
s.add_dependency(%q<rspec>, ["~> 1.3"]) | ||
s.add_dependency(%q<yard>, ["~> 0.5"]) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec', 'spec_helper')) | ||
|
||
require 'dm-core/spec/adapter_shared_spec' | ||
require 'data_objects_adapter/spec/data_objects_adapter_shared_spec' | ||
|
||
describe DataMapper::Adapters::PostgresAdapter do | ||
before :all do | ||
@adapter = DataMapper.setup(:default, 'postgres://root@localhost/dm_core_test') | ||
@repository = DataMapper.repository(@adapter.name) | ||
end | ||
|
||
it_should_behave_like "An Adapter" | ||
it_should_behave_like "A DataObjects Adapter" | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--exclude "spec" | ||
--sort coverage | ||
--callsites | ||
--xrefs | ||
--text-summary |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--colour | ||
--loadby random | ||
--backtrace |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# use local dm-core and dm-data_objects-adapter paths if running from a typical dev checkout. | ||
local_dm_core_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'dm-core', 'lib')) | ||
$LOAD_PATH.unshift(local_dm_core_lib) if File.directory?(local_dm_core_lib) | ||
|
||
local_do_adapter_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'dm-data_objects-adapter', 'lib')) | ||
$LOAD_PATH.unshift(local_do_adapter_lib) if File.directory?(local_do_adapter_lib) | ||
|
||
# Support running specs with 'rake spec' and 'spec' | ||
$LOAD_PATH.unshift('lib') unless $LOAD_PATH.include?('lib') | ||
|
||
require 'rubygems' | ||
require 'dm-core' | ||
require 'postgres_adapter' | ||
|
||
require DataMapper.root / 'spec' / 'lib' / 'pending_helpers' | ||
|
||
Spec::Runner.configure do |config| | ||
config.include(DataMapper::Spec::PendingHelpers) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
spec_defaults = lambda do |spec| | ||
spec.pattern = 'spec/**/*_spec.rb' | ||
spec.libs << 'lib' << 'spec' | ||
spec.spec_opts << '--options' << 'spec/spec.opts' | ||
end | ||
|
||
begin | ||
require 'spec/rake/spectask' | ||
|
||
Spec::Rake::SpecTask.new(:spec, &spec_defaults) | ||
rescue LoadError | ||
task :spec do | ||
abort 'rspec is not available. In order to run spec, you must: gem install rspec' | ||
end | ||
end | ||
|
||
begin | ||
require 'rcov' | ||
require 'spec/rake/verify_rcov' | ||
|
||
Spec::Rake::SpecTask.new(:rcov) do |rcov| | ||
spec_defaults.call(rcov) | ||
rcov.rcov = true | ||
rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/) | ||
end | ||
|
||
RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov| | ||
rcov.threshold = 100 | ||
end | ||
rescue LoadError | ||
%w[ rcov verify_rcov ].each do |name| | ||
task name do | ||
abort "rcov is not available. In order to run #{name}, you must: gem install rcov" | ||
end | ||
end | ||
end | ||
|
||
task :spec => :check_dependencies | ||
task :rcov => :check_dependencies | ||
|
||
task :default => :spec |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
begin | ||
require 'yard' | ||
|
||
YARD::Rake::YardocTask.new | ||
rescue LoadError | ||
task :yard do | ||
abort 'YARD is not available. In order to run yard, you must: gem install yard' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
begin | ||
require 'pathname' | ||
require 'yardstick/rake/measurement' | ||
require 'yardstick/rake/verify' | ||
|
||
# yardstick_measure task | ||
Yardstick::Rake::Measurement.new | ||
|
||
# verify_measurements task | ||
Yardstick::Rake::Verify.new do |verify| | ||
verify.threshold = 100 | ||
end | ||
rescue LoadError | ||
%w[ yardstick_measure verify_measurements ].each do |name| | ||
task name.to_s do | ||
abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick" | ||
end | ||
end | ||
end |