dm-sqlserver-adapter 1.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +36 -0
- data/Gemfile +87 -0
- data/LICENSE +20 -0
- data/Rakefile +27 -0
- data/VERSION +1 -0
- data/dm-sqlserver-adapter.gemspec +66 -0
- data/lib/dm-sqlserver-adapter.rb +1 -0
- data/lib/dm-sqlserver-adapter/adapter.rb +113 -0
- data/lib/dm-sqlserver-adapter/spec/setup.rb +18 -0
- data/spec/adapter_spec.rb +22 -0
- data/spec/rcov.opts +5 -0
- data/spec/spec.opts +3 -0
- data/spec/spec_helper.rb +5 -0
- data/tasks/local_gemfile.rake +18 -0
- data/tasks/spec.rake +38 -0
- data/tasks/yard.rake +9 -0
- data/tasks/yardstick.rake +19 -0
- metadata +123 -0
data/.gitignore
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
## MAC OS
|
2
|
+
.DS_Store
|
3
|
+
|
4
|
+
## TEXTMATE
|
5
|
+
*.tmproj
|
6
|
+
tmtags
|
7
|
+
|
8
|
+
## EMACS
|
9
|
+
*~
|
10
|
+
\#*
|
11
|
+
.\#*
|
12
|
+
|
13
|
+
## VIM
|
14
|
+
*.swp
|
15
|
+
|
16
|
+
## Rubinius
|
17
|
+
*.rbc
|
18
|
+
|
19
|
+
## PROJECT::GENERAL
|
20
|
+
*.gem
|
21
|
+
coverage
|
22
|
+
rdoc
|
23
|
+
pkg
|
24
|
+
tmp
|
25
|
+
doc
|
26
|
+
log
|
27
|
+
.yardoc
|
28
|
+
measurements
|
29
|
+
|
30
|
+
## BUNDLER
|
31
|
+
.bundle
|
32
|
+
Gemfile.local
|
33
|
+
Gemfile.lock
|
34
|
+
|
35
|
+
## PROJECT::SPECIFIC
|
36
|
+
spec/db/
|
data/Gemfile
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
# If you're working on more than one datamapper gem at a time, then it's
|
2
|
+
# recommended to create a local Gemfile and use this instead of the git
|
3
|
+
# sources. This will make sure that you are developing against your
|
4
|
+
# other local datamapper sources that you currently work on. Gemfile.local
|
5
|
+
# will behave identically to the standard Gemfile apart from the fact that
|
6
|
+
# it fetches the gems from local paths. This means that you can use the
|
7
|
+
# same environment variables, like ADAPTER when running bundle commands.
|
8
|
+
# Gemfile.local is added to .gitignore, so you don't need to worry about
|
9
|
+
# accidentally checking local development paths into git.
|
10
|
+
#
|
11
|
+
# bundle exec rake local_gemfile
|
12
|
+
#
|
13
|
+
# will give you a Gemfile.local file that points to your local clones of
|
14
|
+
# the various datamapper gems. It's assumed that all datamapper repo clones
|
15
|
+
# reside in the same directory. You can use the Gemfile.local like so for
|
16
|
+
# running any bundle command:
|
17
|
+
#
|
18
|
+
# BUNDLE_GEMFILE=Gemfile.local bundle foo
|
19
|
+
#
|
20
|
+
# To speed up running bundle tasks, it's recommended to run
|
21
|
+
#
|
22
|
+
# bundle lock
|
23
|
+
#
|
24
|
+
# after running 'bundle install' for the first time. This will make 'bundle exec' run
|
25
|
+
# a lot faster compared to the unlocked version. With an unlocked bundle you would
|
26
|
+
# typically just run 'bundle install' from time to time to fetch the latest sources from
|
27
|
+
# upstream. When you locked your bundle, you need to run
|
28
|
+
#
|
29
|
+
# bundle install --relock
|
30
|
+
#
|
31
|
+
# to make sure to fetch the latest updates and then lock the bundle again. Gemfile.lock
|
32
|
+
# is added to the .gitignore file, so you don't need to worry about accidentally checking
|
33
|
+
# it into version control.
|
34
|
+
|
35
|
+
source 'http://rubygems.org'
|
36
|
+
|
37
|
+
DATAMAPPER = 'git://github.com/datamapper'
|
38
|
+
DM_VERSION = '~> 1.0.0.rc1'
|
39
|
+
DO_VERSION = '~> 0.10.2'
|
40
|
+
|
41
|
+
group :runtime do # Runtime dependencies (as in the gemspec)
|
42
|
+
|
43
|
+
gem 'do_sqlserver', DO_VERSION, :git => "#{DATAMAPPER}/do.git"
|
44
|
+
gem 'dm-do-adapter', DM_VERSION, :git => "#{DATAMAPPER}/dm-do-adapter.git"
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
group(:development) do # Development dependencies (as in the gemspec)
|
49
|
+
|
50
|
+
gem 'dm-migrations', DM_VERSION, :git => "#{DATAMAPPER}/dm-migrations.git"
|
51
|
+
|
52
|
+
gem 'rake', '~> 0.8.7'
|
53
|
+
gem 'rspec', '~> 1.3'
|
54
|
+
gem 'jeweler', '~> 1.4'
|
55
|
+
|
56
|
+
end
|
57
|
+
|
58
|
+
group :datamapper do # We need this because we want to pin these dependencies to their git master sources
|
59
|
+
|
60
|
+
if ENV['EXTLIB']
|
61
|
+
gem 'extlib', '~> 0.9.15', :git => "#{DATAMAPPER}/extlib.git", :require => nil
|
62
|
+
else
|
63
|
+
gem 'activesupport', '~> 3.0.0.beta3', :git => 'git://github.com/rails/rails.git', :require => nil
|
64
|
+
end
|
65
|
+
|
66
|
+
gem 'dm-core', DM_VERSION, :git => "#{DATAMAPPER}/dm-core.git"
|
67
|
+
gem 'data_objects', DO_VERSION, :git => "#{DATAMAPPER}/do.git"
|
68
|
+
|
69
|
+
plugins = ENV['PLUGINS'] || ENV['PLUGIN']
|
70
|
+
plugins = (plugins.to_s.gsub(',',' ').split(' ') + ['dm-migrations']).uniq
|
71
|
+
|
72
|
+
plugins.each do |plugin|
|
73
|
+
gem plugin, DM_VERSION, :git => "#{DATAMAPPER}/#{plugin}.git"
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|
78
|
+
group :quality do # These gems contain rake tasks that check the quality of the source code
|
79
|
+
|
80
|
+
gem 'metric_fu', '~> 1.3'
|
81
|
+
gem 'rcov', '~> 0.9.7'
|
82
|
+
gem 'reek', '~> 1.2.7'
|
83
|
+
gem 'roodi', '~> 2.1'
|
84
|
+
gem 'yard', '~> 0.5'
|
85
|
+
gem 'yardstick', '~> 0.1'
|
86
|
+
|
87
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 Dan Kubb
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
|
6
|
+
require 'jeweler'
|
7
|
+
|
8
|
+
Jeweler::Tasks.new do |gem|
|
9
|
+
gem.name = 'dm-sqlserver-adapter'
|
10
|
+
gem.summary = 'Microsoft SQL Server Adapter for DataMapper'
|
11
|
+
gem.description = gem.summary
|
12
|
+
gem.authors = ["Dan Kubb"]
|
13
|
+
gem.email = %q{dan.kubb@gmail.com}
|
14
|
+
gem.homepage = 'http://github.com/datamapper/dm-sqlserver-adapter'
|
15
|
+
|
16
|
+
gem.add_dependency 'do_sqlserver', '~> 0.10.1'
|
17
|
+
gem.add_dependency 'dm-do-adapter', '~> 1.0.0.rc1'
|
18
|
+
|
19
|
+
gem.add_development_dependency 'rspec', '~> 1.3'
|
20
|
+
end
|
21
|
+
|
22
|
+
Jeweler::GemcutterTasks.new
|
23
|
+
|
24
|
+
FileList['tasks/**/*.rake'].each { |task| import task }
|
25
|
+
rescue LoadError
|
26
|
+
puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
|
27
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0.rc1
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{dm-sqlserver-adapter}
|
8
|
+
s.version = "1.0.0.rc1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Dan Kubb"]
|
12
|
+
s.date = %q{2010-05-19}
|
13
|
+
s.description = %q{Microsoft SQL Server Adapter for DataMapper}
|
14
|
+
s.email = %q{dan.kubb@gmail.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".gitignore",
|
20
|
+
"Gemfile",
|
21
|
+
"LICENSE",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"dm-sqlserver-adapter.gemspec",
|
25
|
+
"lib/dm-sqlserver-adapter.rb",
|
26
|
+
"lib/dm-sqlserver-adapter/adapter.rb",
|
27
|
+
"lib/dm-sqlserver-adapter/spec/setup.rb",
|
28
|
+
"spec/adapter_spec.rb",
|
29
|
+
"spec/rcov.opts",
|
30
|
+
"spec/spec.opts",
|
31
|
+
"spec/spec_helper.rb",
|
32
|
+
"tasks/local_gemfile.rake",
|
33
|
+
"tasks/spec.rake",
|
34
|
+
"tasks/yard.rake",
|
35
|
+
"tasks/yardstick.rake"
|
36
|
+
]
|
37
|
+
s.homepage = %q{http://github.com/datamapper/dm-sqlserver-adapter}
|
38
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
39
|
+
s.require_paths = ["lib"]
|
40
|
+
s.rubygems_version = %q{1.3.6}
|
41
|
+
s.summary = %q{Microsoft SQL Server Adapter for DataMapper}
|
42
|
+
s.test_files = [
|
43
|
+
"spec/adapter_spec.rb",
|
44
|
+
"spec/spec_helper.rb"
|
45
|
+
]
|
46
|
+
|
47
|
+
if s.respond_to? :specification_version then
|
48
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
49
|
+
s.specification_version = 3
|
50
|
+
|
51
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
52
|
+
s.add_runtime_dependency(%q<do_sqlserver>, ["~> 0.10.1"])
|
53
|
+
s.add_runtime_dependency(%q<dm-do-adapter>, ["~> 1.0.0.rc1"])
|
54
|
+
s.add_development_dependency(%q<rspec>, ["~> 1.3"])
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<do_sqlserver>, ["~> 0.10.1"])
|
57
|
+
s.add_dependency(%q<dm-do-adapter>, ["~> 1.0.0.rc1"])
|
58
|
+
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
59
|
+
end
|
60
|
+
else
|
61
|
+
s.add_dependency(%q<do_sqlserver>, ["~> 0.10.1"])
|
62
|
+
s.add_dependency(%q<dm-do-adapter>, ["~> 1.0.0.rc1"])
|
63
|
+
s.add_dependency(%q<rspec>, ["~> 1.3"])
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'dm-sqlserver-adapter/adapter'
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'do_sqlserver'
|
2
|
+
require 'dm-do-adapter'
|
3
|
+
|
4
|
+
DataObjects::Sqlserver = DataObjects::SqlServer
|
5
|
+
|
6
|
+
module DataMapper
|
7
|
+
module Adapters
|
8
|
+
class SqlserverAdapter < DataObjectsAdapter
|
9
|
+
module SQL #:nodoc:
|
10
|
+
private
|
11
|
+
|
12
|
+
# Constructs INSERT statement for given query,
|
13
|
+
#
|
14
|
+
# @return [String] INSERT statement as a string
|
15
|
+
#
|
16
|
+
# @api private
|
17
|
+
def insert_statement(model, properties, serial)
|
18
|
+
statement = ""
|
19
|
+
# Check if there is a serial property being set directly
|
20
|
+
require_identity_insert = !properties.empty? && properties.any? { |property| property.serial? }
|
21
|
+
set_identity_insert(model, statement, true) if require_identity_insert
|
22
|
+
statement << super
|
23
|
+
set_identity_insert(model, statement, false) if require_identity_insert
|
24
|
+
statement
|
25
|
+
end
|
26
|
+
|
27
|
+
def set_identity_insert(model, statement, enable = true)
|
28
|
+
statement << " SET IDENTITY_INSERT #{quote_name(model.storage_name(name))} #{enable ? 'ON' : 'OFF'} "
|
29
|
+
end
|
30
|
+
|
31
|
+
def select_statement(query)
|
32
|
+
name = self.name
|
33
|
+
qualify = query.links.any?
|
34
|
+
fields = query.fields
|
35
|
+
offset = query.offset
|
36
|
+
limit = query.limit
|
37
|
+
order_by = query.order
|
38
|
+
group_by = if qualify || query.unique?
|
39
|
+
fields.select { |property| property.kind_of?(Property) }
|
40
|
+
end
|
41
|
+
|
42
|
+
conditions_statement, bind_values = conditions_statement(query.conditions, qualify)
|
43
|
+
|
44
|
+
use_limit_offset_subquery = limit && offset > 0
|
45
|
+
|
46
|
+
columns_statement = columns_statement(fields, qualify)
|
47
|
+
from_statement = " FROM #{quote_name(query.model.storage_name(name))}"
|
48
|
+
where_statement = " WHERE #{conditions_statement}" unless conditions_statement.blank?
|
49
|
+
join_statement = join_statement(query, bind_values, qualify)
|
50
|
+
order_statement = order_statement(order_by, qualify)
|
51
|
+
no_group_by = group_by ? group_by.empty? : true
|
52
|
+
no_order_by = order_by ? order_by.empty? : true
|
53
|
+
|
54
|
+
if use_limit_offset_subquery
|
55
|
+
# If using qualifiers, we must qualify elements outside the subquery
|
56
|
+
# with 'RowResults' -- this is a different scope to the subquery.
|
57
|
+
# Otherwise, we hit upon "multi-part identifier cannot be bound"
|
58
|
+
# error from SQL Server.
|
59
|
+
statement = "SELECT #{columns_statement(fields, 'RowResults')}"
|
60
|
+
statement << " FROM ( SELECT Row_Number() OVER (ORDER BY #{order_statement}) AS RowID,"
|
61
|
+
statement << " #{columns_statement}"
|
62
|
+
statement << from_statement
|
63
|
+
statement << join_statement if qualify
|
64
|
+
statement << where_statement if where_statement
|
65
|
+
statement << ") AS RowResults"
|
66
|
+
statement << " WHERE RowId > #{offset} AND RowId <= #{offset + limit}"
|
67
|
+
statement << " GROUP BY #{columns_statement(group_by, 'RowResults')}" unless no_group_by
|
68
|
+
statement << " ORDER BY #{order_statement(order_by, 'RowResults')}" unless no_order_by
|
69
|
+
else
|
70
|
+
statement = "SELECT #{columns_statement}"
|
71
|
+
statement << from_statement
|
72
|
+
statement << join_statement if qualify
|
73
|
+
statement << where_statement if where_statement
|
74
|
+
statement << " GROUP BY #{columns_statement(group_by, qualify)}" unless no_group_by
|
75
|
+
statement << " ORDER BY #{order_statement}" unless no_order_by
|
76
|
+
end
|
77
|
+
|
78
|
+
add_limit_offset!(statement, limit, offset, bind_values) unless use_limit_offset_subquery
|
79
|
+
|
80
|
+
return statement, bind_values
|
81
|
+
end
|
82
|
+
|
83
|
+
# SQL Server does not support LIMIT and OFFSET
|
84
|
+
# Functionality therefore must be mimicked through the use of nested selects.
|
85
|
+
# See also:
|
86
|
+
# - http://stackoverflow.com/questions/2840/paging-sql-server-2005-results
|
87
|
+
# - http://stackoverflow.com/questions/216673/emulate-sqlserver-limit-clause-in-microsoft-sql-server-2000
|
88
|
+
#
|
89
|
+
def add_limit_offset!(statement, limit, offset, bind_values)
|
90
|
+
# Limit and offset is handled by subqueries (see #select_statement).
|
91
|
+
if limit
|
92
|
+
# If there is just a limit on rows to return, but no offset, then we
|
93
|
+
# can use TOP clause.
|
94
|
+
statement.sub!(/^\s*SELECT(\s+DISTINCT)?/i) { "SELECT#{$1} TOP #{limit}" }
|
95
|
+
# bind_values << limit
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# @api private
|
100
|
+
# TODO: Not actually supported out of the box. Is theoretically possible
|
101
|
+
# via CLR integration, custom functions.
|
102
|
+
def regexp_operator(operand)
|
103
|
+
'REGEXP'
|
104
|
+
end
|
105
|
+
|
106
|
+
end #module SQL
|
107
|
+
|
108
|
+
include SQL
|
109
|
+
end # class SqlserverAdapter
|
110
|
+
|
111
|
+
const_added(:SqlserverAdapter)
|
112
|
+
end # module Adapters
|
113
|
+
end # module DataMapper
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'dm-sqlserver-adapter'
|
2
|
+
require 'dm-core/spec/setup'
|
3
|
+
|
4
|
+
module DataMapper
|
5
|
+
module Spec
|
6
|
+
module Adapters
|
7
|
+
|
8
|
+
class SqlserverAdapter < Adapter
|
9
|
+
def connection_uri
|
10
|
+
"#{super};instance=SQLEXPRESS"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
use SqlserverAdapter
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'dm-core/spec/shared/adapter_spec'
|
4
|
+
require 'dm-do-adapter/spec/shared_spec'
|
5
|
+
|
6
|
+
require 'dm-migrations'
|
7
|
+
require 'dm-sqlserver-adapter/spec/setup'
|
8
|
+
|
9
|
+
ENV['ADAPTER'] = 'sqlserver'
|
10
|
+
ENV['ADAPTER_SUPPORTS'] = 'all'
|
11
|
+
|
12
|
+
describe 'DataMapper::Adapters::SqlserverAdapter' do
|
13
|
+
|
14
|
+
before :all do
|
15
|
+
@adapter = DataMapper::Spec.adapter
|
16
|
+
@repository = DataMapper.repository(@adapter.name)
|
17
|
+
end
|
18
|
+
|
19
|
+
it_should_behave_like "An Adapter"
|
20
|
+
it_should_behave_like "A DataObjects Adapter"
|
21
|
+
|
22
|
+
end
|
data/spec/rcov.opts
ADDED
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
desc "Support bundling from local source code (allows BUNDLE_GEMFILE=Gemfile.local bundle foo)"
|
2
|
+
task :local_gemfile do |t|
|
3
|
+
|
4
|
+
root = Pathname(__FILE__).dirname.parent
|
5
|
+
datamapper = root.parent
|
6
|
+
|
7
|
+
source_regex = /DATAMAPPER = 'git:\/\/github.com\/datamapper'/
|
8
|
+
gem_source_regex = /:git => \"#\{DATAMAPPER\}\/(.+?)(?:\.git)?\"/
|
9
|
+
|
10
|
+
root.join('Gemfile.local').open('w') do |f|
|
11
|
+
root.join('Gemfile').open.each do |line|
|
12
|
+
line.sub!(source_regex, "DATAMAPPER = '#{datamapper}'")
|
13
|
+
line.sub!(gem_source_regex, ':path => "#{DATAMAPPER}/\1"')
|
14
|
+
f.puts line
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
data/tasks/spec.rake
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
spec_defaults = lambda do |spec|
|
2
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
3
|
+
spec.libs << 'lib' << 'spec'
|
4
|
+
spec.spec_opts << '--options' << 'spec/spec.opts'
|
5
|
+
end
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
|
10
|
+
Spec::Rake::SpecTask.new(:spec, &spec_defaults)
|
11
|
+
rescue LoadError
|
12
|
+
task :spec do
|
13
|
+
abort 'rspec is not available. In order to run spec, you must: gem install rspec'
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
begin
|
18
|
+
require 'rcov'
|
19
|
+
require 'spec/rake/verify_rcov'
|
20
|
+
|
21
|
+
Spec::Rake::SpecTask.new(:rcov) do |rcov|
|
22
|
+
spec_defaults.call(rcov)
|
23
|
+
rcov.rcov = true
|
24
|
+
rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
|
25
|
+
end
|
26
|
+
|
27
|
+
RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
|
28
|
+
rcov.threshold = 100
|
29
|
+
end
|
30
|
+
rescue LoadError
|
31
|
+
%w[ rcov verify_rcov ].each do |name|
|
32
|
+
task name do
|
33
|
+
abort "rcov is not available. In order to run #{name}, you must: gem install rcov"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
task :default => :spec
|
data/tasks/yard.rake
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
begin
|
2
|
+
require 'pathname'
|
3
|
+
require 'yardstick/rake/measurement'
|
4
|
+
require 'yardstick/rake/verify'
|
5
|
+
|
6
|
+
# yardstick_measure task
|
7
|
+
Yardstick::Rake::Measurement.new
|
8
|
+
|
9
|
+
# verify_measurements task
|
10
|
+
Yardstick::Rake::Verify.new do |verify|
|
11
|
+
verify.threshold = 100
|
12
|
+
end
|
13
|
+
rescue LoadError
|
14
|
+
%w[ yardstick_measure verify_measurements ].each do |name|
|
15
|
+
task name.to_s do
|
16
|
+
abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,123 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dm-sqlserver-adapter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: true
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- rc1
|
10
|
+
version: 1.0.0.rc1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Dan Kubb
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-05-19 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: do_sqlserver
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 10
|
31
|
+
- 1
|
32
|
+
version: 0.10.1
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: dm-do-adapter
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 1
|
44
|
+
- 0
|
45
|
+
- 0
|
46
|
+
- rc1
|
47
|
+
version: 1.0.0.rc1
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: rspec
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 1
|
59
|
+
- 3
|
60
|
+
version: "1.3"
|
61
|
+
type: :development
|
62
|
+
version_requirements: *id003
|
63
|
+
description: Microsoft SQL Server Adapter for DataMapper
|
64
|
+
email: dan.kubb@gmail.com
|
65
|
+
executables: []
|
66
|
+
|
67
|
+
extensions: []
|
68
|
+
|
69
|
+
extra_rdoc_files:
|
70
|
+
- LICENSE
|
71
|
+
files:
|
72
|
+
- .gitignore
|
73
|
+
- Gemfile
|
74
|
+
- LICENSE
|
75
|
+
- Rakefile
|
76
|
+
- VERSION
|
77
|
+
- dm-sqlserver-adapter.gemspec
|
78
|
+
- lib/dm-sqlserver-adapter.rb
|
79
|
+
- lib/dm-sqlserver-adapter/adapter.rb
|
80
|
+
- lib/dm-sqlserver-adapter/spec/setup.rb
|
81
|
+
- spec/adapter_spec.rb
|
82
|
+
- spec/rcov.opts
|
83
|
+
- spec/spec.opts
|
84
|
+
- spec/spec_helper.rb
|
85
|
+
- tasks/local_gemfile.rake
|
86
|
+
- tasks/spec.rake
|
87
|
+
- tasks/yard.rake
|
88
|
+
- tasks/yardstick.rake
|
89
|
+
has_rdoc: true
|
90
|
+
homepage: http://github.com/datamapper/dm-sqlserver-adapter
|
91
|
+
licenses: []
|
92
|
+
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options:
|
95
|
+
- --charset=UTF-8
|
96
|
+
require_paths:
|
97
|
+
- lib
|
98
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
version: "0"
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
segments:
|
110
|
+
- 1
|
111
|
+
- 3
|
112
|
+
- 1
|
113
|
+
version: 1.3.1
|
114
|
+
requirements: []
|
115
|
+
|
116
|
+
rubyforge_project:
|
117
|
+
rubygems_version: 1.3.6
|
118
|
+
signing_key:
|
119
|
+
specification_version: 3
|
120
|
+
summary: Microsoft SQL Server Adapter for DataMapper
|
121
|
+
test_files:
|
122
|
+
- spec/adapter_spec.rb
|
123
|
+
- spec/spec_helper.rb
|