Skip to content
Newer
Older
100644 168 lines (140 sloc) 4.5 KB
35bfc5a @ciconia Added general Rakefile.
ciconia authored Dec 26, 2007
1 require "rake"
2 require "rake/clean"
3 require "rake/gempackagetask"
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 6, 2008
4 require "spec/rake/spectask"
9d6e0be @jeremyevans Use the hanna RDoc template if available, fallback to the default tem…
authored Sep 11, 2008
5 begin
6 require "hanna/rdoctask"
7 rescue LoadError
8 require "rake/rdoctask"
9 end
10 require "fileutils"
35bfc5a @ciconia Added general Rakefile.
ciconia authored Dec 26, 2007
11
12 include FileUtils
13
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
14 NAME = 'sequel'
233af21 @jeremyevans Bump version to 2.5.0
authored Sep 3, 2008
15 VERS = '2.5.0'
8e4f911 @jeremyevans Remove the generated html files when cleaning
authored Aug 6, 2008
16 CLEAN.include ["**/.*.sw?", "pkg", ".config", "rdoc", "coverage", "www/public/*.html"]
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
17 RDOC_OPTS = ["--quiet", "--line-numbers", "--inline-source", '--title', \
18 'Sequel: The Database Toolkit for Ruby', '--main', 'README']
b2ea1ba @ciconia Fixed Rakefile.
ciconia authored Dec 26, 2007
19
189fe30 @jeremyevans Use boof's website design for sequel.rubyforge.org
authored Aug 5, 2008
20 # Gem Packaging and Release
21
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
22 desc "Packages sequel"
23 task :package=>[:clean]
24 spec = Gem::Specification.new do |s|
25 s.name = NAME
26 s.rubyforge_project = 'sequel'
27 s.version = VERS
28 s.platform = Gem::Platform::RUBY
29 s.has_rdoc = true
30 s.extra_rdoc_files = ["README", "CHANGELOG", "COPYING"] + Dir["doc/*.rdoc"]
31 s.rdoc_options += RDOC_OPTS
32 s.summary = "The Database Toolkit for Ruby"
33 s.description = s.summary
34 s.author = "Jeremy Evans"
35 s.email = "code@jeremyevans.net"
36 s.homepage = "http://sequel.rubyforge.org"
37 s.required_ruby_version = ">= 1.8.4"
38 s.files = %w(COPYING CHANGELOG README Rakefile) + Dir.glob("{bin,doc,spec,lib}/**/*")
39 s.require_path = "lib"
40 s.bindir = 'bin'
a52cfb5 @jeremyevans Bump version to 2.3.0, Enable sequel binary and fix sequel -v
authored Jul 25, 2008
41 s.executables << 'sequel'
35bfc5a @ciconia Added general Rakefile.
ciconia authored Dec 26, 2007
42 end
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
43 Rake::GemPackageTask.new(spec) do |p|
44 p.need_tar = true
45 p.gem_spec = spec
35bfc5a @ciconia Added general Rakefile.
ciconia authored Dec 26, 2007
46 end
47
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
48 desc "Install sequel gem"
49 task :install=>[:package] do
50 sh %{sudo gem install pkg/#{NAME}-#{VERS} --local}
35bfc5a @ciconia Added general Rakefile.
ciconia authored Dec 26, 2007
51 end
52
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
53 desc "Install sequel gem without RDoc"
54 task :install_no_docs=>[:package] do
55 sh %{sudo gem install pkg/#{NAME}-#{VERS} --no-rdoc --no-ri --local}
35bfc5a @ciconia Added general Rakefile.
ciconia authored Dec 26, 2007
56 end
57
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
58 desc "Uninstall sequel gem"
59 task :uninstall=>[:clean] do
60 sh %{sudo gem uninstall #{NAME}}
48d9aa3 @jeremyevans Add descriptions to all rake tasks, and a top level rake release task…
authored Apr 30, 2008
61 end
62
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
63 desc "Upload sequel and sequel_core gems to rubyforge"
64 task :release=>[:package] do
65 sh %{rubyforge login}
66 sh %{rubyforge add_release sequel #{NAME} #{VERS} pkg/#{NAME}-#{VERS}.tgz}
67 sh %{rubyforge add_file sequel #{NAME} #{VERS} pkg/#{NAME}-#{VERS}.gem}
c988cc8 @jeremyevans (Re)?move some files and fix RDoc clean tasks
authored May 22, 2008
68 end
69
189fe30 @jeremyevans Use boof's website design for sequel.rubyforge.org
authored Aug 5, 2008
70 ### RDoc
71
d768d94 @ciconia Added doc rake task for core+model. Some order in rake files.
ciconia authored Dec 30, 2007
72 Rake::RDocTask.new do |rdoc|
d1fadee @jeremyevans Refactor RDoc creation and options in Rakefiles
authored May 22, 2008
73 rdoc.rdoc_dir = "rdoc"
d768d94 @ciconia Added doc rake task for core+model. Some order in rake files.
ciconia authored Dec 30, 2007
74 rdoc.options += RDOC_OPTS
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
75 rdoc.rdoc_files.add %w"README CHANGELOG COPYING lib/**/*.rb doc/*.rdoc"
d768d94 @ciconia Added doc rake task for core+model. Some order in rake files.
ciconia authored Dec 30, 2007
76 end
77
189fe30 @jeremyevans Use boof's website design for sequel.rubyforge.org
authored Aug 5, 2008
78 ### Website
79
bedb708 @jeremyevans Split website update Rakefile tasks into RDoc and Non-RDoc parts
authored Sep 11, 2008
80 desc "Update Non-RDoc section of sequel.rubyforge.org"
81 task :website_base do
189fe30 @jeremyevans Use boof's website design for sequel.rubyforge.org
authored Aug 5, 2008
82 sh %{www/make_www.rb}
83 sh %{scp -r www/public/* rubyforge.org:/var/www/gforge-projects/sequel/}
bedb708 @jeremyevans Split website update Rakefile tasks into RDoc and Non-RDoc parts
authored Sep 11, 2008
84 end
85
86 desc "Update RDoc section of sequel.rubyforge.org"
87 task :website_rdoc=>[:rerdoc] do
189fe30 @jeremyevans Use boof's website design for sequel.rubyforge.org
authored Aug 5, 2008
88 sh %{scp -r rdoc/* rubyforge.org:/var/www/gforge-projects/sequel/rdoc/}
7612b7e @ciconia intermediate step
ciconia authored Jan 2, 2008
89 end
90
bedb708 @jeremyevans Split website update Rakefile tasks into RDoc and Non-RDoc parts
authored Sep 11, 2008
91 desc "Update sequel.rubyforge.org"
92 task :website=>[:website_base, :website_rdoc]
93
189fe30 @jeremyevans Use boof's website design for sequel.rubyforge.org
authored Aug 5, 2008
94 ### Specs
95
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
96 lib_dir = File.join(File.dirname(__FILE__), 'lib')
97 fixRUBYLIB = Proc.new{ENV['RUBYLIB'] ? (ENV['RUBYLIB'] += ":#{lib_dir}") : (ENV['RUBYLIB'] = lib_dir)}
98 sequel_core_specs = "spec/sequel_core/*_spec.rb"
99 sequel_model_specs = "spec/sequel_model/*_spec.rb"
100 spec_opts = proc{File.read("spec/spec.opts").split("\n")}
101 rcov_opts = proc{File.read("spec/rcov.opts").split("\n")}
102
103 desc "Run core and model specs with coverage"
104 Spec::Rake::SpecTask.new("spec_coverage") do |t|
105 fixRUBYLIB.call
106 t.spec_files = FileList[sequel_core_specs, sequel_model_specs]
107 t.spec_opts = spec_opts.call
108 t.rcov_opts = rcov_opts.call
109 t.rcov = true
110 end
7612b7e @ciconia intermediate step
ciconia authored Jan 2, 2008
111
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
112 desc "Run core and model specs"
113 task :default => [:spec]
7612b7e @ciconia intermediate step
ciconia authored Jan 2, 2008
114 Spec::Rake::SpecTask.new("spec") do |t|
4080ef5 @jeremyevans Allow running of specs without installing a new version of sequel_cor…
authored Apr 8, 2008
115 fixRUBYLIB.call
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
116 t.spec_files = FileList[sequel_core_specs, sequel_model_specs]
117 t.spec_opts = spec_opts.call
118 end
119
120 desc "Run core specs"
121 Spec::Rake::SpecTask.new("spec_core") do |t|
122 fixRUBYLIB.call
123 t.spec_files = FileList[sequel_core_specs]
124 t.spec_opts = spec_opts.call
7612b7e @ciconia intermediate step
ciconia authored Jan 2, 2008
125 end
126
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
127 desc "Run model specs"
128 Spec::Rake::SpecTask.new("spec_model") do |t|
4080ef5 @jeremyevans Allow running of specs without installing a new version of sequel_cor…
authored Apr 8, 2008
129 fixRUBYLIB.call
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
130 t.spec_files = FileList[sequel_model_specs]
131 t.spec_opts = spec_opts.call
132 end
133
0eba5fe @jeremyevans Add integration test suite, testing sequel against a real database, w…
authored Jul 6, 2008
134 desc "Run integration tests"
135 Spec::Rake::SpecTask.new("integration") do |t|
136 fixRUBYLIB.call
137 t.spec_files = FileList["spec/integration/*_test.rb"]
138 t.spec_opts = spec_opts.call
139 end
140
1c50939 Fixed empty datasets in ADO adapter
unknown authored Jul 22, 2008
141 %w'postgres sqlite mysql informix oracle ado'.each do |adapter|
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
142 desc "Run #{adapter} specs without coverage"
143 Spec::Rake::SpecTask.new("spec_#{adapter}") do |t|
332883a @jeremyevans Minor changes to allow for full Ruby 1.9 compatibility
authored Jul 24, 2008
144 t.spec_files = ["spec/adapters/#{adapter}_spec.rb"]
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
145 t.spec_opts = spec_opts.call
146 end
147 end
148
149 desc "check documentation coverage"
150 task :dcov do
151 sh %{find lib -name '*.rb' | xargs dcov}
d768d94 @ciconia Added doc rake task for core+model. Some order in rake files.
ciconia authored Dec 30, 2007
152 end
153
189fe30 @jeremyevans Use boof's website design for sequel.rubyforge.org
authored Aug 5, 2008
154 ### Statistics
cc7ecf4 @ciconia Some more rake tasks work, and sequel_model version 0.2.
ciconia authored Jan 2, 2008
155
156 STATS_DIRECTORIES = [
778a032 @jeremyevans Combine sequel and sequel_core into one gem
authored Jul 7, 2008
157 %w(Code lib/),
158 %w(Spec spec),
cc7ecf4 @ciconia Some more rake tasks work, and sequel_model version 0.2.
ciconia authored Jan 2, 2008
159 ].collect { |name, dir| [ name, "./#{dir}" ] }.select { |name, dir| File.directory?(dir) }
160
161 desc "Report code statistics (KLOCs, etc) from the application"
162 task :stats do
c988cc8 @jeremyevans (Re)?move some files and fix RDoc clean tasks
authored May 22, 2008
163 require "extra/stats"
cc7ecf4 @ciconia Some more rake tasks work, and sequel_model version 0.2.
ciconia authored Jan 2, 2008
164 verbose = true
165 CodeStatistics.new(*STATS_DIRECTORIES).to_s
166 end
167
Something went wrong with that request. Please try again.