sam / do fork watch download tarball
public
Rubygem
Description: DataObjects
Homepage: http://rubyforge.org/projects/dorb
Clone URL: git://github.com/sam/do.git
Update Rakefile for do_sqlite3, do_postgres, and do_mysql to be similar

* Libs will now be compiled before spec is run
* Specs will run using the new libs, not the installed ones
* Specs can run on systems without the DO driver installed
* Added rake clean task to Rakefiles
* Updated require to use full path
dkubb (author)
Sat Apr 26 20:57:19 -0700 2008
commit  8a3333c0d88027190ca8e5c8d19923d89d5916a2
tree    82587570da591bf032d1868aba65cb77b25e092d
parent  56ea6d6f693b6be125b4058b8120309b4f071287
...
13
14
15
16
 
17
18
19
20
 
21
22
23
24
 
25
26
 
27
28
29
30
 
31
32
33
34
 
35
36
37
38
 
39
40
41
...
44
45
46
47
 
48
49
50
 
51
52
53
...
63
64
65
66
 
67
68
69
...
71
72
73
74
75
 
...
13
14
15
 
16
17
18
19
 
20
21
22
23
 
24
25
 
26
27
28
29
 
30
31
32
33
 
34
35
36
37
 
38
39
40
41
...
44
45
46
 
47
48
49
 
50
51
52
53
...
63
64
65
 
66
67
68
69
...
71
72
73
 
74
75
0
@@ -13,29 +13,29 @@ DIR = Pathname(__FILE__).dirname.expand_path.to_s
0
 projects = %w[data_objects do_jdbc do_mysql do_postgres do_sqlite3]
0
 
0
 namespace :ci do
0
-
0
+
0
   projects.each do |gem_name|
0
     task gem_name do
0
       ENV['gem_name'] = gem_name
0
-
0
+
0
       Rake::Task["ci:run_all"].invoke
0
     end
0
   end
0
-
0
+
0
   task :run_all => [:spec, :install, :doc, :publish]
0
-
0
+
0
   task :spec => :define_tasks do
0
     Rake::Task["#{ENV['gem_name']}:spec"].invoke
0
   end
0
-
0
+
0
   task :doc => :define_tasks do
0
     Rake::Task["#{ENV['gem_name']}:doc"].invoke
0
   end
0
-
0
+
0
   task :install do
0
     sh %{cd #{ENV['gem_name']} && rake install}
0
   end
0
-
0
+
0
   task :publish do
0
     out = ENV['CC_BUILD_ARTIFACTS'] || "out"
0
     mkdir_p out unless File.directory? out if out
0
@@ -44,10 +44,10 @@ namespace :ci do
0
     mv "coverage", "#{out}/coverage_report" if out && File.exists?("coverage")
0
     mv "rspec_report.html", "#{out}/rspec_report.html" if out
0
   end
0
-
0
+
0
   task :define_tasks do
0
     gem_name = ENV['gem_name']
0
-
0
+
0
     file "#{gem_name}/Makefile" => FileList["#{DIR}/#{gem_name}/ext/**/extconf.rb", "#{DIR}/#{gem_name}/ext/**/*.c", "#{DIR}/#{gem_name}/ext/**/*.h"] do
0
       system("cd #{gem_name} && ruby ext/extconf.rb")
0
       system("cd #{gem_name} && make all") || system("cd #{gem_name} && nmake all")
0
@@ -63,7 +63,7 @@ namespace :ci do
0
         t.rcov_opts << '--only-uncovered'
0
       end
0
     end
0
-
0
+
0
     Rake::RDocTask.new("#{gem_name}:doc") do |t|
0
       t.rdoc_dir = 'rdoc'
0
       t.title = gem_name
0
@@ -71,4 +71,4 @@ namespace :ci do
0
       t.rdoc_files.include("#{gem_name}/lib/**/*.rb", "#{gem_name}/ext/**/*.c")
0
     end
0
   end
0
-end
0
\ No newline at end of file
0
+end
...
1
2
 
3
4
5
6
7
8
9
10
11
12
 
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
 
 
 
 
 
 
 
 
 
 
 
28
29
30
...
32
33
34
35
 
36
37
38
 
39
40
41
 
 
42
...
1
 
2
3
4
 
 
 
 
 
 
 
 
5
6
7
 
 
 
 
 
 
 
 
 
 
 
 
 
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
24
25
26
 
27
28
29
 
30
31
 
 
32
33
34
0
@@ -1,30 +1,22 @@
0
 require 'rubygems'
0
-require 'spec'
0
+require 'rake/clean'
0
 require 'rake/gempackagetask'
0
 require 'spec/rake/spectask'
0
-
0
-
0
-GEM = "data_objects"
0
-VERSION = "0.9.0"
0
-AUTHOR = "Yehuda Katz"
0
-EMAIL = "wycats@gmail.com"
0
-HOMEPAGE = "http://dataobjects.devjavu.com"
0
-SUMMARY = "The Core DataObjects class"
0
+require 'pathname'
0
 
0
 spec = Gem::Specification.new do |s|
0
- s.name = GEM
0
- s.version = VERSION
0
- s.platform = Gem::Platform::RUBY
0
- s.has_rdoc = true
0
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
0
- s.summary = SUMMARY
0
- s.description = s.summary
0
- s.author = AUTHOR
0
- s.email = EMAIL
0
- s.homepage = HOMEPAGE
0
- s.require_path = 'lib'
0
- s.autorequire = GEM
0
- s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
0
+ s.name = 'data_objects'
0
+ s.version = '0.9.0'
0
+ s.platform = Gem::Platform::RUBY
0
+ s.has_rdoc = true
0
+ s.extra_rdoc_files = %w[ README LICENSE TODO ]
0
+ s.summary = 'The Core DataObjects class'
0
+ s.description = s.summary
0
+ s.author = 'Yehuda Katz'
0
+ s.email = 'wycats@gmail.com'
0
+ s.homepage = 'http://rubyforge.org/projects/dorb'
0
+ s.require_path = 'lib'
0
+ s.files = FileList[ 'spec/**/*.rb', 'Rakefile', *s.extra_rdoc_files ]
0
 end
0
 
0
 Rake::GemPackageTask.new(spec) do |pkg|
0
@@ -32,11 +24,11 @@ Rake::GemPackageTask.new(spec) do |pkg|
0
 end
0
 
0
 task :install => [:package] do
0
- sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{GEM}-#{VERSION}}
0
+ sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{spec.name}-#{spec.version}}, :verbose => false
0
 end
0
 
0
-desc "Run all specs in spec directory (excluding plugin specs)"
0
+desc 'Run specifications'
0
 Spec::Rake::SpecTask.new(:spec) do |t|
0
- t.spec_opts = ['--options', "spec/spec.opts"] if File.exists?("spec/spec.opts")
0
- t.spec_files = FileList['spec/*_spec.rb']
0
+ t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
0
+ t.spec_files = Pathname.glob(Pathname.new(__FILE__).dirname + 'spec/**/*_spec.rb')
0
 end
...
1
2
3
4
5
6
...
 
 
 
 
 
0
0
@@ -1,5 +0,0 @@
0
-TODO:
0
-Fix LICENSE with your name
0
-Fix Rakefile with your name and contact info
0
-Add your code to lib/do_sqlite3.rb
0
-Add your Merb rake tasks to lib/do_sqlite3/merbtasks.rb
0
\ No newline at end of file
...
1
2
3
4
5
6
7
 
 
 
 
 
 
 
8
9
10
...
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
0
@@ -1,10 +1,10 @@
0
-require File.dirname(__FILE__) + "/connection"
0
-require File.dirname(__FILE__) + "/transaction"
0
-require File.dirname(__FILE__) + "/command"
0
-require File.dirname(__FILE__) + "/result"
0
-require File.dirname(__FILE__) + "/reader"
0
-require File.dirname(__FILE__) + "/field"
0
-require File.dirname(__FILE__) + "/quoting"
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'connection'))
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'transaction'))
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'command'))
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'result'))
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'reader'))
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'field'))
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'quoting'))
0
 
0
 
0
 module DataObjects
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
 
0
 describe DataObjects::Command do
0
   before do
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
 
0
 describe DataObjects::Connection do
0
   before do
...
1
2
 
3
...
 
1
2
3
0
@@ -1 +1 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
\ No newline at end of file
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
\ No newline at end of file
...
1
2
3
4
5
...
 
 
1
2
3
0
@@ -1,5 +1,3 @@
0
-require File.dirname(__FILE__) + '/../lib/data_objects'
0
-
0
 module DataObjects
0
   
0
   module Mock
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
 
0
 describe DataObjects::Reader do
0
   
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
 
0
 describe DataObjects::Result do
0
   
...
1
2
3
4
 
 
 
...
1
2
 
 
3
4
5
0
@@ -1,4 +1,5 @@
0
 require 'rubygems'
0
 require 'spec'
0
-require File.dirname(__FILE__) + "/../lib/data_objects"
0
-require File.dirname(__FILE__) + "/do_mock"
0
+
0
+require File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib', 'data_objects'))
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'do_mock'))
...
40
41
42
43
44
 
...
40
41
42
 
43
44
0
@@ -40,4 +40,4 @@ desc "Run all specs in spec directory (excluding plugin specs)"
0
 Spec::Rake::SpecTask.new(:spec) do |t|
0
   t.spec_opts = ['--options', "spec/spec.opts"] if File.exists?("spec/spec.opts")
0
   t.spec_files = FileList['spec/*_spec.rb']
0
-end
0
\ No newline at end of file
0
+end
...
1
2
3
4
5
6
 
7
8
 
 
 
 
...
1
 
 
2
3
 
4
5
6
7
8
9
10
0
@@ -1,8 +1,10 @@
0
 $TESTING=true
0
-$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
0
-$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'data_objects', 'lib')
0
 
0
 require 'rubygems'
0
-require 'data_objects'
0
+require 'spec'
0
 require 'date'
0
 
0
+$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
0
+$:.unshift File.join(File.dirname(__FILE__), '..', '..', 'data_objects', 'lib')
0
+
0
+require 'data_objects'
...
1
2
3
4
5
6
7
 
 
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
 
 
23
24
25
26
27
28
29
30
31
32
33
34
35
 
 
 
 
 
 
 
 
 
 
 
36
37
38
39
 
 
 
40
41
42
...
44
45
46
47
 
48
49
50
 
 
51
52
53
54
55
56
 
 
 
 
57
...
1
2
3
 
4
 
 
5
6
7
8
 
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
12
13
 
 
 
 
 
 
 
 
 
 
 
14
15
16
17
18
19
20
21
22
23
24
25
 
 
 
26
27
28
29
30
31
...
33
34
35
 
36
37
 
 
38
39
40
41
 
 
 
 
42
43
44
45
46
0
@@ -1,42 +1,31 @@
0
 require 'rubygems'
0
 require 'rake/clean'
0
 require 'rake/gempackagetask'
0
-require 'pathname'
0
 require 'spec/rake/spectask'
0
-require 'ostruct'
0
-require File.dirname(__FILE__) + '/../ext_helper.rb'
0
+require 'pathname'
0
+require Pathname(__FILE__).dirname.expand_path.parent + 'ext_helper'
0
 
0
 # House-keeping
0
-CLEAN.include '**/*.o', '**/*.so', '**/*.bundle', '**/*.a',
0
- '**/*.log', "{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}",
0
- "ext/Makefile", 'lib'
0
-
0
-project = OpenStruct.new(
0
- :name => 'do_mysql',
0
- :version => '0.9.0',
0
- :author => 'Scott Bauer',
0
- :email => 'bauer.mail@gmail.com',
0
- :rubyforge => 'dorb',
0
- :homepage => 'http://rubyforge.org/projects/dorb',
0
- :summary => 'A DataObject.rb driver for MySQL'
0
-)
0
+CLEAN.include '**/*.o', '**/*.so', '**/*.bundle', '**/*.a',
0
+ '**/*.log', '{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}',
0
+ 'ext/Makefile', 'lib'
0
 
0
 spec = Gem::Specification.new do |s|
0
- s.name = project.name
0
- s.version = project.version
0
- s.platform = Gem::Platform::RUBY
0
- s.has_rdoc = true
0
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
0
- s.summary = project.summary
0
- s.description = s.summary
0
- s.author = project.author
0
- s.email = project.email
0
- s.rubyforge_project = project.rubyforge
0
- s.homepage = project.homepage
0
+ s.name = 'do_mysql'
0
+ s.version = '0.9.0'
0
+ s.platform = Gem::Platform::RUBY
0
+ s.has_rdoc = true
0
+ s.extra_rdoc_files = %w[ README LICENSE TODO ]
0
+ s.summary = 'A DataObject.rb driver for MySQL'
0
+ s.description = s.summary
0
+ s.author = 'Scott Bauer'
0
+ s.email = 'bauer.mail@gmail.com'
0
+ s.homepage = 'http://rubyforge.org/projects/dorb'
0
+ s.rubyforge_project = 'dorb'
0
   s.add_dependency('data_objects', '>= 0.9.0')
0
- s.require_path = 'lib'
0
- s.extensions = ["ext/extconf.rb"]
0
- s.files = FileList['ext/*.rb', 'ext/*.c', 'spec/**/*.rb', 'README', 'LICENSE', 'Rakefile', 'TODO']
0
+ s.require_path = 'lib'
0
+ s.extensions = %w[ ext/extconf.rb ]
0
+ s.files = FileList[ 'ext/*.rb', 'ext/*.c', 'spec/**/*.rb', 'Rakefile', *s.extra_rdoc_files ]
0
 end
0
 
0
 Rake::GemPackageTask.new(spec) do |pkg|
0
@@ -44,14 +33,14 @@ Rake::GemPackageTask.new(spec) do |pkg|
0
 end
0
 
0
 # Use of ext_helper to properly setup compile tasks and native gem generation
0
-setup_extension project.name, spec
0
+setup_extension spec.name, spec
0
 
0
-task :install => [:package] do
0
- sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{project.name}-#{project.version}}
0
+task :install => [ :package ] do
0
+ sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{spec.name}-#{spec.version}}, :verbose => false
0
 end
0
 
0
-desc "Run specifications"
0
-Spec::Rake::SpecTask.new(:spec => [:compile]) do |t|
0
- t.spec_opts = ["--format", "specdoc", "--colour"]
0
- t.spec_files = Pathname.glob(Pathname.new(__FILE__).parent.join("spec").join("**").join("*_spec.rb"))
0
+desc 'Run specifications'
0
+Spec::Rake::SpecTask.new(:spec => [ :compile ]) do |t|
0
+ t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
0
+ t.spec_files = Pathname.glob(Pathname.new(__FILE__).dirname + 'spec/**/*_spec.rb')
0
 end
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
 
0
 def setup_test_environment
0
   @connection = DataObjects::Mysql::Connection.new("mysql://root@127.0.0.1:3306/do_mysql_test")
...
3
4
5
6
 
 
7
8
 
9
10
11
12
 
13
...
3
4
5
 
6
7
8
 
9
10
11
12
 
13
14
0
@@ -3,11 +3,12 @@ $TESTING=true
0
 require 'rubygems'
0
 require 'spec'
0
 require 'date'
0
-# push data_objects from repository in the load path
0
+
0
+# put data_objects from repository in the load path
0
 # DO NOT USE installed gem of data_objects!
0
-$:.push File.join(File.dirname(__FILE__), '../../data_objects', 'lib')
0
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'data_objects', 'lib'))
0
 require 'data_objects'
0
 
0
 # put the pre-compiled extension in the path to be found
0
-$:.push File.join(File.dirname(__FILE__), '..', 'lib')
0
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
0
 require 'do_mysql'
...
1
2
3
4
5
 
...
1
2
3
 
4
5
0
@@ -1,4 +1,4 @@
0
 do_postgres
0
 =================
0
 
0
-Data Objects PostgreSQL adapter
0
\ No newline at end of file
0
+Data Objects PostgreSQL adapter
...
1
2
3
4
5
6
7
8
 
 
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
 
 
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
42
43
...
45
46
47
48
 
49
50
51
 
 
52
53
54
55
56
57
 
 
 
 
58
...
1
2
3
 
 
4
 
 
5
6
7
8
 
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
12
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
33
34
35
 
36
37
 
 
38
39
40
41
 
 
 
 
42
43
44
45
46
0
@@ -1,43 +1,31 @@
0
 require 'rubygems'
0
 require 'rake/clean'
0
 require 'rake/gempackagetask'
0
-require 'spec'
0
-require 'pathname'
0
 require 'spec/rake/spectask'
0
-require 'ostruct'
0
-require File.dirname(__FILE__) + '/../ext_helper.rb'
0
+require 'pathname'
0
+require Pathname(__FILE__).dirname.expand_path.parent + 'ext_helper'
0
 
0
 # House-keeping
0
-CLEAN.include '**/*.o', '**/*.so', '**/*.bundle', '**/*.a',
0
- '**/*.log', "{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}",
0
- "ext/Makefile", 'lib'
0
-
0
-project = OpenStruct.new(
0
- :name => 'do_postgres',
0
- :version => '0.9.0',
0
- :author => 'Yehuda Katz',
0
- :email => 'wycats@gmail.com',
0
- :rubyforge => 'dorb',
0
- :homepage => 'http://rubyforge.org/projects/dorb',
0
- :summary => 'A DataObject.rb driver for PostgreSQL'
0
-)
0
+CLEAN.include '**/*.o', '**/*.so', '**/*.bundle', '**/*.a',
0
+ '**/*.log', '{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}',
0
+ 'ext/Makefile', 'lib'
0
 
0
 spec = Gem::Specification.new do |s|
0
- s.name = project.name
0
- s.version = project.version
0
- s.platform = Gem::Platform::RUBY
0
- s.has_rdoc = true
0
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
0
- s.summary = project.summary
0
- s.description = s.summary
0
- s.author = project.author
0
- s.email = project.email
0
- s.rubyforge_project = project.rubyforge
0
- s.homepage = project.homepage
0
- s.add_dependency('data_objects', '>=0.9.0')
0
- s.require_path = 'lib'
0
- s.extensions = ["ext/extconf.rb"]
0
- s.files = FileList['ext/*.rb', 'ext/*.c', 'ext/*.h', 'spec/**/*.rb', 'README', 'LICENSE', 'Rakefile', 'TODO']
0
+ s.name = 'do_postgres'
0
+ s.version = '0.9.0'
0
+ s.platform = Gem::Platform::RUBY
0
+ s.has_rdoc = true
0
+ s.extra_rdoc_files = %w[ README LICENSE TODO ]
0
+ s.summary = 'A DataObject.rb driver for PostgreSQL'
0
+ s.description = s.summary
0
+ s.author = 'Yehuda Katz'
0
+ s.email = 'wycats@gmail.com'
0
+ s.homepage = 'http://rubyforge.org/projects/dorb'
0
+ s.rubyforge_project = 'dorb'
0
+ s.add_dependency('data_objects', '>= 0.9.0')
0
+ s.require_path = 'lib'
0
+ s.extensions = %w[ ext/extconf.rb ]
0
+ s.files = FileList[ 'ext/*.rb', 'ext/*.c', 'ext/*.h', 'spec/**/*.rb', 'Rakefile', *s.extra_rdoc_files ]
0
 end
0
 
0
 Rake::GemPackageTask.new(spec) do |pkg|
0
@@ -45,14 +33,14 @@ Rake::GemPackageTask.new(spec) do |pkg|
0
 end
0
 
0
 # Use of ext_helper to properly setup compile tasks and native gem generation
0
-setup_extension project.name, spec
0
+setup_extension spec.name, spec
0
 
0
-task :install => [:package] do
0
- sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{project.name}-#{project.version}}, :verbose => false
0
+task :install => [ :package ] do
0
+ sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{spec.name}-#{spec.version}}, :verbose => false
0
 end
0
 
0
-desc "Run specifications"
0
-Spec::Rake::SpecTask.new(:spec => [:compile]) do |t|
0
- t.spec_opts = ["--format", "specdoc", "--colour"]
0
- t.spec_files = Pathname.glob(Pathname.new(__FILE__).parent.join("spec").join("**").join("*_spec.rb"))
0
+desc 'Run specifications'
0
+Spec::Rake::SpecTask.new(:spec => [ :compile ]) do |t|
0
+ t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
0
+ t.spec_files = Pathname.glob(Pathname.new(__FILE__).dirname + 'spec/**/*_spec.rb')
0
 end
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
 
0
 #
0
 #
...
4
5
6
7
 
8
9
 
10
11
12
13
 
14
15
...
4
5
6
 
7
8
 
9
10
11
12
 
13
14
 
0
@@ -4,12 +4,11 @@ require 'rubygems'
0
 require 'spec'
0
 require 'date'
0
 
0
-# push data_objects from repository in the load path
0
+# put data_objects from repository in the load path
0
 # DO NOT USE installed gem of data_objects!
0
-$:.push File.join(File.dirname(__FILE__), '../../data_objects', 'lib')
0
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'data_objects', 'lib'))
0
 require 'data_objects'
0
 
0
 # put the pre-compiled extension in the path to be found
0
-$:.push File.join(File.dirname(__FILE__), '..', 'lib')
0
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
0
 require 'do_postgres'
0
-
...
1
2
3
4
5
6
7
8
 
 
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
 
 
24
25
26
27
28
29
30
31
32
33
34
35
36
 
 
 
 
 
 
 
 
 
 
 
37
38
39
40
 
 
 
41
42
43
...
45
46
47
48
 
49
50
51
 
 
52
53
54
55
56
57
 
 
 
 
58
...
1
 
2
3
 
4
 
 
5
6
7
8
 
 
 
 
 
 
 
 
 
 
 
 
 
9
10
11
12
13
 
 
 
 
 
 
 
 
 
 
 
14
15
16
17
18
19
20
21
22
23
24
25
 
 
 
26
27
28
29
30
31
...
33
34
35
 
36
37
 
 
38
39
40
41
 
 
 
 
42
43
44
45
46
0
@@ -1,43 +1,31 @@
0
 require 'rubygems'
0
-require 'spec'
0
 require 'rake/clean'
0
 require 'rake/gempackagetask'
0
-require 'pathname'
0
 require 'spec/rake/spectask'
0
-require 'ostruct'
0
-require File.dirname(__FILE__) + '/../ext_helper.rb'
0
+require 'pathname'
0
+require Pathname(__FILE__).dirname.expand_path.parent + 'ext_helper'
0
 
0
 # House-keeping
0
-CLEAN.include '**/*.o', '**/*.so', '**/*.bundle', '**/*.a',
0
- '**/*.log', "{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}",
0
- "ext/Makefile", 'lib', '**/*.db'
0
-
0
-project = OpenStruct.new(
0
- :name => 'do_sqlite3',
0
- :version => '0.9.0',
0
- :author => 'Yehuda Katz',
0
- :email => 'wycats@gmail.com',
0
- :rubyforge => 'dorb',
0
- :homepage => 'http://rubyforge.org/projects/dorb',
0
- :summary => 'A DataObject.rb driver for SQLite3'
0
-)
0
+CLEAN.include '**/*.o', '**/*.so', '**/*.bundle', '**/*.a',
0
+ '**/*.log', '{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}',
0
+ 'ext/Makefile', 'lib', '**/*.db'
0
 
0
 spec = Gem::Specification.new do |s|
0
- s.name = project.name
0
- s.version = project.version
0
- s.platform = Gem::Platform::RUBY
0
- s.has_rdoc = true
0
- s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
0
- s.summary = project.summary
0
- s.description = s.summary
0
- s.author = project.author
0
- s.email = project.email
0
- s.homepage = project.homepage
0
- s.rubyforge_project = project.rubyforge
0
+ s.name = 'do_sqlite3'
0
+ s.version = '0.9.0'
0
+ s.platform = Gem::Platform::RUBY
0
+ s.has_rdoc = true
0
+ s.extra_rdoc_files = %w[ README LICENSE TODO ]
0
+ s.summary = 'A DataObject.rb driver for SQLite3'
0
+ s.description = s.summary
0
+ s.author = 'Yehuda Katz'
0
+ s.email = 'wycats@gmail.com'
0
+ s.homepage = 'http://rubyforge.org/projects/dorb'
0
+ s.rubyforge_project = 'dorb'
0
   s.add_dependency('data_objects', '>= 0.9.0')
0
- s.require_path = 'lib'
0
- s.extensions = ["ext/extconf.rb"]
0
- s.files = FileList['ext/*.rb', 'ext/*.c', 'ext/*.h', 'spec/**/*.rb', 'README', 'LICENSE', 'Rakefile', 'TODO']
0
+ s.require_path = 'lib'
0
+ s.extensions = %w[ ext/extconf.rb ]
0
+ s.files = FileList[ 'ext/*.rb', 'ext/*.c', 'spec/**/*.rb', 'Rakefile', *s.extra_rdoc_files ]
0
 end
0
 
0
 Rake::GemPackageTask.new(spec) do |pkg|
0
@@ -45,14 +33,14 @@ Rake::GemPackageTask.new(spec) do |pkg|
0
 end
0
 
0
 # Use of ext_helper to properly setup compile tasks and native gem generation
0
-setup_extension project.name, spec
0
+setup_extension spec.name, spec
0
 
0
-task :install => [:package] do
0
- sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{project.name}-#{project.version}}, :verbose => false
0
+task :install => [ :package ] do
0
+ sh %{#{'sudo' unless ENV['SUDOLESS']} gem install pkg/#{spec.name}-#{spec.version}}, :verbose => false
0
 end
0
 
0
-desc "Run specifications"
0
-Spec::Rake::SpecTask.new(:spec => [:compile]) do |t|
0
- t.spec_opts = ["--format", "specdoc", "--colour"]
0
- t.spec_files = Pathname.glob(Pathname.new(__FILE__).parent.join("spec").join("**").join("*_spec.rb"))
0
+desc 'Run specifications'
0
+Spec::Rake::SpecTask.new(:spec => [ :compile ]) do |t|
0
+ t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
0
+ t.spec_files = Pathname.glob(Pathname.new(__FILE__).dirname + 'spec/**/*_spec.rb')
0
 end
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-require File.dirname(__FILE__) + '/spec_helper'
0
+require File.expand_path(File.join(File.dirname(__FILE__), 'spec_helper'))
0
 
0
 describe "DataObjects::Sqlite3" do
0
   it "should raise error on bad connection string" do
...
4
5
6
7
 
8
9
 
10
11
12
13
 
14
15
...
4
5
6
 
7
8
 
9
10
11
12
 
13
14
 
0
@@ -4,12 +4,11 @@ require 'rubygems'
0
 require 'spec'
0
 require 'date'
0
 
0
-# push data_objects from repository in the load path
0
+# put data_objects from repository in the load path
0
 # DO NOT USE installed gem of data_objects!
0
-$:.push File.join(File.dirname(__FILE__), '../../data_objects', 'lib')
0
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'data_objects', 'lib'))
0
 require 'data_objects'
0
 
0
 # put the pre-compiled extension in the path to be found
0
-$:.push File.join(File.dirname(__FILE__), '..', 'lib')
0
+$:.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
0
 require 'do_sqlite3'
0
-

Comments

    No one has commented yet.