Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 216 lines (179 sloc) 6.188 kb
35bfc5a Sharon Rosner Added general Rakefile.
ciconia authored
1 require "rake"
2 require "rake/clean"
3 require "rake/gempackagetask"
9d6e0be Jeremy Evans Use the hanna RDoc template if available, fallback to the default templa...
authored
4 begin
5 require "hanna/rdoctask"
6 rescue LoadError
7 require "rake/rdoctask"
8 end
35bfc5a Sharon Rosner Added general Rakefile.
ciconia authored
9
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
10 NAME = 'sequel'
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
11 VERS = lambda do
12 require "lib/sequel/version"
13 Sequel.version
14 end
15 CLEAN.include ["**/.*.sw?", "pkg", ".config", "rdoc", "coverage", "www/public/*.html", "www/public/rdoc*"]
16 RDOC_DEFAULT_OPTS = ["--quiet", "--line-numbers", "--inline-source", '--title', 'Sequel: The Database Toolkit for Ruby']
17 RDOC_OPTS = RDOC_DEFAULT_OPTS + ['--main', 'README.rdoc']
b2ea1ba Sharon Rosner Fixed Rakefile.
ciconia authored
18
189fe30 Jeremy Evans Use boof's website design for sequel.rubyforge.org
authored
19 # Gem Packaging and Release
20
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
21 spec = Gem::Specification.new do |s|
22 s.name = NAME
23 s.rubyforge_project = 'sequel'
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
24 s.version = VERS.call
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
25 s.platform = Gem::Platform::RUBY
26 s.has_rdoc = true
4749f02 Jeremy Evans Add release notes to repository, include in RDoc
authored
27 s.extra_rdoc_files = ["README.rdoc", "CHANGELOG", "COPYING"] + Dir["doc/*.rdoc"] + Dir['doc/release_notes/*.txt']
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
28 s.rdoc_options += RDOC_OPTS
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
29 s.summary = "The Database Toolkit for Ruby"
30 s.description = s.summary
31 s.author = "Jeremy Evans"
32 s.email = "code@jeremyevans.net"
33 s.homepage = "http://sequel.rubyforge.org"
34 s.required_ruby_version = ">= 1.8.4"
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
35 s.files = %w(COPYING CHANGELOG README.rdoc Rakefile) + Dir["{bin,doc,spec,lib}/**/*"]
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
36 s.require_path = "lib"
37 s.bindir = 'bin'
a52cfb5 Jeremy Evans Bump version to 2.3.0, Enable sequel binary and fix sequel -v
authored
38 s.executables << 'sequel'
35bfc5a Sharon Rosner Added general Rakefile.
ciconia authored
39 end
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
40
41 desc "Packages sequel"
42 task :package=>[:clean]
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
43 Rake::GemPackageTask.new(spec) do |p|
44 p.need_tar = true
45 p.gem_spec = spec
35bfc5a Sharon Rosner Added general Rakefile.
ciconia authored
46 end
47
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
48 desc "Install sequel gem"
49 task :install=>[:package] do
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
50 sh %{sudo gem install pkg/#{NAME}-#{VERS.call} --local}
35bfc5a Sharon Rosner Added general Rakefile.
ciconia authored
51 end
52
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
53 desc "Uninstall sequel gem"
54 task :uninstall=>[:clean] do
55 sh %{sudo gem uninstall #{NAME}}
48d9aa3 Jeremy Evans Add descriptions to all rake tasks, and a top level rake release task, p...
authored
56 end
57
77c0483 Jeremy Evans Switch release task to use gemcutter instead of rubyforge
authored
58 desc "Upload sequel gem to gemcutter"
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
59 task :release=>[:package] do
77c0483 Jeremy Evans Switch release task to use gemcutter instead of rubyforge
authored
60 sh %{gem push pkg/#{NAME}-#{VERS.call}.gem}
c988cc8 Jeremy Evans (Re)?move some files and fix RDoc clean tasks
authored
61 end
62
189fe30 Jeremy Evans Use boof's website design for sequel.rubyforge.org
authored
63 ### RDoc
64
d768d94 Sharon Rosner Added doc rake task for core+model. Some order in rake files.
ciconia authored
65 Rake::RDocTask.new do |rdoc|
d1fadee Jeremy Evans Refactor RDoc creation and options in Rakefiles
authored
66 rdoc.rdoc_dir = "rdoc"
d768d94 Sharon Rosner Added doc rake task for core+model. Some order in rake files.
ciconia authored
67 rdoc.options += RDOC_OPTS
4749f02 Jeremy Evans Add release notes to repository, include in RDoc
authored
68 rdoc.rdoc_files.add %w"README.rdoc CHANGELOG COPYING lib/**/*.rb doc/*.rdoc doc/release_notes/*.txt"
d768d94 Sharon Rosner Added doc rake task for core+model. Some order in rake files.
ciconia authored
69 end
70
189fe30 Jeremy Evans Use boof's website design for sequel.rubyforge.org
authored
71 ### Website
72
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
73 desc "Make local version of website"
74 task :website do
189fe30 Jeremy Evans Use boof's website design for sequel.rubyforge.org
authored
75 sh %{www/make_www.rb}
bedb708 Jeremy Evans Split website update Rakefile tasks into RDoc and Non-RDoc parts
authored
76 end
77
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
78 desc "Make rdoc for website"
79 task :website_rdoc=>[:website_rdoc_main, :website_rdoc_adapters, :website_rdoc_plugins]
189fe30 Jeremy Evans Use boof's website design for sequel.rubyforge.org
authored
80
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
81 Rake::RDocTask.new(:website_rdoc_main) do |rdoc|
82 rdoc.rdoc_dir = "www/public/rdoc"
83 rdoc.options += RDOC_OPTS
84 rdoc.rdoc_files.add %w"README.rdoc CHANGELOG COPYING lib/*.rb lib/sequel/*.rb lib/sequel/{dataset,database,model}/*.rb doc/*.rdoc doc/release_notes/*.txt"
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
85 end
7612b7e Sharon Rosner intermediate step
ciconia authored
86
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
87 Rake::RDocTask.new(:website_rdoc_adapters) do |rdoc|
88 rdoc.rdoc_dir = "www/public/rdoc-adapters"
89 rdoc.options += RDOC_DEFAULT_OPTS + %w'--main Sequel'
90 rdoc.rdoc_files.add %w"lib/sequel/adapters/**/*.rb"
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
91 end
92
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
93 Rake::RDocTask.new(:website_rdoc_plugins) do |rdoc|
94 rdoc.rdoc_dir = "www/public/rdoc-plugins"
95 rdoc.options += RDOC_DEFAULT_OPTS + %w'--main Sequel'
96 rdoc.rdoc_files.add %w"lib/sequel/{extensions,plugins}/**/*.rb"
7612b7e Sharon Rosner intermediate step
ciconia authored
97 end
98
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
99 desc "Update Non-RDoc section of sequel.rubyforge.org"
100 task :website_rf_base=>[:website] do
101 sh %{rsync -rt www/public/*.html rubyforge.org:/var/www/gforge-projects/sequel/}
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
102 end
103
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
104 desc "Update sequel.rubyforge.org"
105 task :website_rf=>[:website, :website_rdoc] do
106 sh %{rsync -rvt www/public/* rubyforge.org:/var/www/gforge-projects/sequel/}
6f31723 Jeremy Evans Move caching, hook class methods, and STI into plugins, deprecate old me...
authored
107 end
108
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
109 ### Specs
110
111 begin
112 require "spec/rake/spectask"
113
114 spec_opts = lambda do
115 lib_dir = File.join(File.dirname(__FILE__), 'lib')
116 ENV['RUBYLIB'] ? (ENV['RUBYLIB'] += ":#{lib_dir}") : (ENV['RUBYLIB'] = lib_dir)
117 end
0eba5fe Jeremy Evans Add integration test suite, testing sequel against a real database, with...
authored
118
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
119 rcov_opts = lambda do
120 [true, File.read("spec/rcov.opts").split("\n")]
121 end
122
123 desc "Run core and model specs with coverage"
124 Spec::Rake::SpecTask.new("spec_coverage") do |t|
125 t.spec_files = Dir["spec/{core,model}/*_spec.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
126 spec_opts.call
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
127 t.rcov, t.rcov_opts = rcov_opts.call
128 end
129
130 desc "Run core and model specs"
131 task :default => [:spec]
132 Spec::Rake::SpecTask.new("spec") do |t|
133 t.spec_files = Dir["spec/{core,model}/*_spec.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
134 spec_opts.call
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
135 end
136
137 desc "Run core specs"
138 Spec::Rake::SpecTask.new("spec_core") do |t|
139 t.spec_files = Dir["spec/core/*_spec.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
140 spec_opts.call
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
141 end
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
142
143 desc "Run model specs"
144 Spec::Rake::SpecTask.new("spec_model") do |t|
145 t.spec_files = Dir["spec/model/*_spec.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
146 spec_opts.call
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
147 end
148
149 desc "Run extension/plugin specs"
150 Spec::Rake::SpecTask.new("spec_plugin") do |t|
151 t.spec_files = Dir["spec/extensions/*_spec.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
152 spec_opts.call
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
153 end
154
4711520 Jeremy Evans Add a plugin spec coverage task to the Rakefile
authored
155 desc "Run extention/plugin specs with coverage"
156 Spec::Rake::SpecTask.new("spec_plugin_cov") do |t|
157 t.spec_files = Dir["spec/extensions/*_spec.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
158 spec_opts.call
4711520 Jeremy Evans Add a plugin spec coverage task to the Rakefile
authored
159 t.rcov, t.rcov_opts = rcov_opts.call
160 end
161
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
162 desc "Run integration tests"
163 Spec::Rake::SpecTask.new("integration") do |t|
9117746 Jeremy Evans Have the adapter specs also run the integration tests
authored
164 t.spec_files = Dir["spec/integration/*_test.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
165 spec_opts.call
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
166 end
167
d064c98 Jeremy Evans Add integration_cov and spec_adapter_cov rake tasks for testing coverage...
authored
168 desc "Run integration tests with coverage"
169 Spec::Rake::SpecTask.new("integration_cov") do |t|
170 t.spec_files = Dir["spec/integration/*_test.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
171 spec_opts.call
d064c98 Jeremy Evans Add integration_cov and spec_adapter_cov rake tasks for testing coverage...
authored
172 t.rcov, t.rcov_opts = rcov_opts.call
173 end
174
5c597d2 Add an empty spec file for MSSQL.
John Firebaugh authored
175 %w'postgres sqlite mysql informix oracle firebird mssql'.each do |adapter|
d064c98 Jeremy Evans Add integration_cov and spec_adapter_cov rake tasks for testing coverage...
authored
176 desc "Run #{adapter} specs"
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
177 Spec::Rake::SpecTask.new("spec_#{adapter}") do |t|
9117746 Jeremy Evans Have the adapter specs also run the integration tests
authored
178 t.spec_files = ["spec/adapters/#{adapter}_spec.rb"] + Dir["spec/integration/*_test.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
179 spec_opts.call
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
180 end
d064c98 Jeremy Evans Add integration_cov and spec_adapter_cov rake tasks for testing coverage...
authored
181
182 desc "Run #{adapter} specs with coverage"
183 Spec::Rake::SpecTask.new("spec_#{adapter}_cov") do |t|
184 t.spec_files = ["spec/adapters/#{adapter}_spec.rb"] + Dir["spec/integration/*_test.rb"]
3d364a6 Jeremy Evans Remove use of spec.opts file, allowing Rake to run specs with rspec 1.2....
authored
185 spec_opts.call
d064c98 Jeremy Evans Add integration_cov and spec_adapter_cov rake tasks for testing coverage...
authored
186 t.rcov, t.rcov_opts = rcov_opts.call
187 end
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
188 end
189 rescue LoadError
778a032 Jeremy Evans Combine sequel and sequel_core into one gem
authored
190 end
191
192 desc "check documentation coverage"
193 task :dcov do
194 sh %{find lib -name '*.rb' | xargs dcov}
d768d94 Sharon Rosner Added doc rake task for core+model. Some order in rake files.
ciconia authored
195 end
196
189fe30 Jeremy Evans Use boof's website design for sequel.rubyforge.org
authored
197 ### Statistics
cc7ecf4 Sharon Rosner Some more rake tasks work, and sequel_model version 0.2.
ciconia authored
198
199 desc "Report code statistics (KLOCs, etc) from the application"
200 task :stats do
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
201 STATS_DIRECTORIES = [%w(Code lib/), %w(Spec spec)].map{|name, dir| [ name, "./#{dir}" ] }.select { |name, dir| File.directory?(dir)}
c988cc8 Jeremy Evans (Re)?move some files and fix RDoc clean tasks
authored
202 require "extra/stats"
cc7ecf4 Sharon Rosner Some more rake tasks work, and sequel_model version 0.2.
ciconia authored
203 verbose = true
204 CodeStatistics.new(*STATS_DIRECTORIES).to_s
205 end
206
f3fa745 Jeremy Evans Add Sequel.version for getting the internal version of Sequel
authored
207 desc "Print Sequel version"
208 task :version do
c879600 Jeremy Evans Cleanup Rakefile and use new rdoc format for website
authored
209 puts VERS.call
f3fa745 Jeremy Evans Add Sequel.version for getting the internal version of Sequel
authored
210 end
5fa47bd Jeremy Evans Add check_syntax rake task for checking the syntax of .rb files
authored
211
212 desc "Check syntax of all .rb files"
213 task :check_syntax do
214 Dir['**/*.rb'].each{|file| print `#{ENV['RUBY'] || :ruby} -c #{file} | fgrep -v "Syntax OK"`}
215 end
Something went wrong with that request. Please try again.