Skip to content

Commit 9265961

Browse files
committed
Support changes for new gem packaging to rubyforge in the traditional "activerecord-sqlserver-adapter".
1 parent c647d24 commit 9265961

File tree

5 files changed

+29
-58
lines changed

5 files changed

+29
-58
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
nbproject/
22
debug.log
33
.DS_Store
4-
pkg/
4+
pkg/
5+
doc/
6+
tasks/
7+
Manifest

2000-2005-adapter.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ Gem::Specification.new do |s|
22
s.name = "2000-2005-adapter"
33
s.version = "2.2.18"
44
s.date = "2009-06-05"
5-
s.summary = "SQL Server 2000 & 2005 & 2008 Adapter For Rails."
5+
s.summary = "SQL Server 2000, 2005 and 2008 Adapter For Rails."
66
s.email = "ken@metaskills.net"
7-
s.homepage = "http://github.com/rails-sqlserver/2000-2005-adapter/"
8-
s.description = "SQL Server 2000 & 2005 Adapter For Rails."
7+
s.homepage = "http://github.com/rails-sqlserver"
8+
s.description = "SQL Server 2000, 2005 and 2008 Adapter For Rails."
99
s.has_rdoc = true
1010
s.authors = ["Ken Collins","Murray Steele","Shawn Balestracci","Joe Rafaniello","Tom Ward"]
1111
s.files = [

README.rdoc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
== Rails SQL Server 2000 & 2005 & 2008 Adapter
2+
== Rails SQL Server 2000, 2005 and 2008 Adapter
33

44
The SQL Server adapter for rails is back for ActiveRecord 2.2 and up! We are currently passing all tests and hope to continue to do so moving forward.
55

@@ -24,13 +24,13 @@ The SQL Server adapter for rails is back for ActiveRecord 2.2 and up! We are cur
2424

2525
==== SQL Server 2008 Support
2626

27-
Because this adapter is primarily coded to SQL Server 2000/2005, it does not take advantage of many of the things in 2008 that would speed up the code. At some point in the future there we be a branch of this code that is specifically targeted for 2008. That adapter version will remove much of the dirty innards of this version that are meant to code around many of their short comings in 2000/2005, the biggest being no limit/offset.
27+
Because this adapter is primarily coded to SQL Server 2000/2005, it does not take advantage of many of the things in 2008 that would speed up the code. At some point in the future there will be a branch of this code that is specifically targeted for 2008. That adapter version will remove much of the dirty innards of this version that are meant to code around many previous SQL Server 2000/2005 short comings, the biggest being no limit/offset.
2828

2929

3030

3131
==== Date/Time Data Type Hinting
3232

33-
Both SQL Server 2000 and 2005 do not have native data types for just 'date' or 'time', it only has 'datetime'. To pass the ActiveRecord tests we implemented two simple class methods that can teach your models to coerce column information to be cast correctly. Simply past a list of symbols to either the <tt>coerce_sqlserver_date</tt> or <tt>coerce_sqlserver_time</tt> methods that correspond to 'datetime' columns that need to be cast correctly.
33+
Both SQL Server 2000 and 2005 do not include native data types for just 'date' or 'time', it only has 'datetime'. To pass the ActiveRecord tests we implemented two simple class methods that can teach your models to coerce column information to be cast correctly. Simply past a list of symbols to either the <tt>coerce_sqlserver_date</tt> or <tt>coerce_sqlserver_time</tt> methods that correspond to 'datetime' columns that need to be cast correctly.
3434

3535
class Topic < ActiveRecord::Base
3636
coerce_sqlserver_date :last_read
@@ -130,17 +130,17 @@ It is our goal to match the adapter version with each version of rails. However
130130

131131
First, you will need Ruby DBI and Ruby ODBC. If you are using the adapter under 1.9, then you need at least ruby-odbc version 0.9996. To my knowledge the ADO DBD for DBI is no longer supported. The installation below is not a comprehensive walk thru on how to get all the required moving parts like FreeTDS installed and/or configured. It will also assume gem installations of both the dependent libraries and the adapter itself.
132132

133-
It should be noted that this version of the adapter was developed using both the ancient 0.0.23 version of DBI up to the current stable release of 0.4.1. Note that DBI 0.4.1 is the minimal for ruby 1.9 compatibility. Because later versions of DBI will be changing many things, IT IS HIGHLY RECOMMENDED that you max your install to version 0.4.0 which the examples below show. For the time being we are not supporting DBI versions higher than 0.4.0. The good news is that if you were using a very old DBI with ADO, technically this adapter will still work for you, but be warned your path is getting old and may not be supported for long.
133+
It should be noted that this version of the adapter was developed using both the ancient 0.0.23 version of DBI up to the current stable release of 0.4.1. Note that DBI 0.4.1 is the minimal for ruby 1.9 compatibility. Because later versions of DBI will be changing many things, IT IS HIGHLY RECOMMENDED that you max your install to version 0.4.1 which the examples below show. For the time being we are not supporting DBI versions higher than 0.4.1. The good news is that if you were using a very old DBI with ADO, technically this adapter will still work for you, but be warned your path is getting old and may not be supported for long.
134134

135135
$ gem install dbi --version 0.4.1
136136
$ gem install dbd-odbc --version 0.2.4
137-
$ gem install rails-sqlserver-2000-2005-adapter -s http://gems.github.com
137+
$ gem install activerecord-sqlserver-adapter
138138

139139
Optionally configure your gem dependencies in your rails environment.rb file.
140140

141-
config.gem 'dbi', :version => '0.4.0'
141+
config.gem 'dbi', :version => '0.4.1'
142142
config.gem 'dbd-odbc', :version => '0.2.4', :lib => 'dbd/ODBC'
143-
config.gem 'rails-sqlserver-2000-2005-adapter', :source => 'http://gems.github.com'
143+
config.gem 'activerecord-sqlserver-adapter', :version => 'x.x.xx'
144144

145145
Here are some external links for libraries and/or tutorials on how to install any other additional components to use this adapter. If you know of a good one that we can include here, just let us know.
146146

@@ -152,6 +152,7 @@ Here are some external links for libraries and/or tutorials on how to install an
152152

153153
If you’d like to contribute a feature or bugfix, thanks! To make sure your fix/feature has a high chance of being added, please read the following guidelines. First, ask on the Google list, IRC, or post a ticket in Lighthouse. Second, make sure there are tests! We will not accept any patch that is not tested. Please read the RUNNING_UNIT_TESTS file for the details of how to run the unit tests.
154154

155+
* Github: http://github.com/rails-sqlserver
155156
* Lighthouse: http://rails-sqlserver.lighthouseapp.com/projects/20277-sql-server-05-adapter/tickets
156157
* Google Group: http://groups.google.com/group/rails-sqlserver-adapter
157158
* IRC Room: #rails-sqlserver on irc.freenode.net

Rakefile

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,18 @@
11
require 'rubygems'
22
require 'rake'
33
require 'rake/testtask'
4-
5-
6-
desc 'Create the SQL Server test databases'
7-
task :create_databases do
8-
# Define a user named 'rails' in SQL Server with all privileges granted
9-
# Use an empty password for user 'rails', or alternatively use the OSQLPASSWORD environment variable
10-
# which allows you to set a default password for the current session.
11-
%x( osql -S localhost -U rails -Q "create database activerecord_unittest" -P )
12-
%x( osql -S localhost -U rails -Q "create database activerecord_unittest2" -P )
13-
%x( osql -S localhost -U rails -d activerecord_unittest -Q "exec sp_grantdbaccess 'rails'" -P )
14-
%x( osql -S localhost -U rails -d activerecord_unittest2 -Q "exec sp_grantdbaccess 'rails'" -P )
15-
%x( osql -S localhost -U rails -d activerecord_unittest -Q "grant BACKUP DATABASE, BACKUP LOG, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, CREATE VIEW to 'rails';" -P )
16-
%x( osql -S localhost -U rails -d activerecord_unittest2 -Q "grant BACKUP DATABASE, BACKUP LOG, CREATE DEFAULT, CREATE FUNCTION, CREATE PROCEDURE, CREATE RULE, CREATE TABLE, CREATE VIEW to 'rails';" -P )
17-
end
18-
19-
desc 'Drop the SQL Server test databases'
20-
task :drop_databases do
21-
%x( osql -S localhost -U rails -Q "drop database activerecord_unittest" -P )
22-
%x( osql -S localhost -U rails -Q "drop database activerecord_unittest2" -P )
23-
end
24-
25-
desc 'Recreate the SQL Server test databases'
26-
task :recreate_databases => [:drop_databases, :create_databases]
27-
28-
29-
for adapter in %w( sqlserver sqlserver_odbc )
30-
31-
Rake::TestTask.new("test_#{adapter}") { |t|
32-
t.libs << "test"
33-
t.libs << "test/connections/native_#{adapter}"
34-
t.libs << "../../../rails/activerecord/test/"
35-
t.test_files = (
36-
Dir.glob("test/cases/**/*_test_sqlserver.rb").sort +
37-
Dir.glob("../../../rails/activerecord/test/**/*_test.rb").sort )
38-
t.verbose = true
39-
}
40-
41-
namespace adapter do
42-
task :test => "test_#{adapter}"
43-
end
44-
4+
require 'echoe'
5+
6+
Echoe.new('activerecord-sqlserver-adapter','2.2.18') do |p|
7+
p.summary = "SQL Server 2000, 2005 and 2008 Adapter For Rails."
8+
p.description = "SQL Server 2000, 2005 and 2008 Adapter For Rails."
9+
p.author = ["Ken Collins","Murray Steele","Shawn Balestracci","Joe Rafaniello","Tom Ward"]
10+
p.email = "ken@metaskills.net"
11+
p.url = "http://github.com/rails-sqlserver"
12+
p.runtime_dependencies = ["dbi =0.4.1","dbd-odbc =0.2.4"]
13+
p.include_gemspec = false
14+
p.ignore_pattern = ["autotest/*","*.gemspec","lib/rails-sqlserver-2000-2005-adapter.rb"]
15+
p.project = 'arsqlserver'
4516
end
4617

47-
desc 'Test with unicode types enabled.'
48-
Rake::TestTask.new(:test_unicode_types) do |t|
49-
ENV['ENABLE_DEFAULT_UNICODE_TYPES'] = 'true'
50-
test = Rake::Task['test_sqlserver_odbc']
51-
test.invoke
52-
end
18+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load(ext) }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
require 'active_record/connection_adapters/sqlserver_adapter'

0 commit comments

Comments
 (0)