Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
119 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,100 +1,48 @@ | ||
#$:.unshift(File.join(File.dirname(__FILE__) ,'../../gems/georuby/lib/')) | ||
$:.unshift(File.join(File.dirname(__FILE__), 'lib')) | ||
require 'rubygems' | ||
require 'rake' | ||
require 'spec/rake/spectask' | ||
require 'rake/rdoctask' | ||
require 'active_record' | ||
require 'active_record/connection_adapters/postgresql_adapter' | ||
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f } | ||
require File.dirname(__FILE__) + '/lib/postgis_adapter' | ||
|
||
# Generate all the Rake tasks | ||
# Run 'rake -T' to see list of generated tasks (from gem root directory)PostgisAdapter::VERSION | ||
$hoe = Hoe.new('postgis_adapter', PostgisAdapter::VERSION) do |p| | ||
p.developer('Marcos Piccinini', 'x@nofxx.com') | ||
p.summary = "Postgis Adapter for Activer Record" | ||
p.description = "Postgis Adapter for Activer Record" | ||
p.url = "http://github.com/nofxx/postgis_adapter" | ||
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n") | ||
# p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required | ||
p.rubyforge_name = "postgis_adapter" # TODO this is default value | ||
p.extra_deps = [ | ||
['activerecord','>= 2.0.2'], | ||
] | ||
p.extra_dev_deps = [ | ||
['newgem', ">= #{::Newgem::VERSION}"] | ||
] | ||
|
||
p.clean_globs |= %w[**/.DS_Store tmp *.log] | ||
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}" | ||
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc') | ||
p.rsync_args = '-av --delete --ignore-errors' | ||
end | ||
|
||
require 'newgem/tasks' # load /tasks/*.rake | ||
Dir['tasks/**/*.rake'].each { |t| load t } | ||
|
||
# TODO - want other tests/tasks run by default? Add them to the list | ||
# task :default => [:spec, :features] | ||
begin | ||
require 'jeweler' | ||
Jeweler::Tasks.new do |gem| | ||
gem.name = "postgis_adapter" | ||
gem.summary = %Q{TODO} | ||
gem.email = "x@nofxx.com" | ||
gem.homepage = "http://github.com/nofxx/postgis_adapter" | ||
gem.authors = ["Marcos Augusto"] | ||
|
||
desc 'Default: run specs.' | ||
task :default => :spec | ||
|
||
desc "Run all specs" | ||
Spec::Rake::SpecTask.new do |t| | ||
t.spec_files = FileList['spec/*_spec.rb'] | ||
t.spec_opts = ['--options', 'spec/spec.opts'] | ||
unless ENV['NO_RCOV'] | ||
t.rcov = true | ||
t.rcov_dir = 'coverage' | ||
t.rcov_opts = ['--html', '--exclude', "\.autotest,schema.rb,init.rb,\.gitignore,spec\/spec_helper.rb,spec\/db/*,#{ENV['GEM_HOME']}"] | ||
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings | ||
end | ||
rescue LoadError | ||
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com" | ||
end | ||
|
||
desc "Look for TODO and FIXME tags in the code" | ||
task :todo do | ||
egrep /(FIXME|TODO|TBD)/ | ||
end | ||
|
||
namespace :db do | ||
task :migrate do | ||
load('spec/db/schema_postgis.rb') | ||
end | ||
require 'spec/rake/spectask' | ||
Spec::Rake::SpecTask.new(:spec) do |spec| | ||
spec.libs << 'lib' << 'spec' | ||
spec.spec_files = FileList['spec/**/*_spec.rb'] | ||
end | ||
|
||
desc "Generate the documentation" | ||
Rake::RDocTask::new do |rdoc| | ||
rdoc.rdoc_dir = 'doc/' | ||
rdoc.title = "PostGIS Adapter for Rails Documentation" | ||
rdoc.options << '--line-numbers' << '--inline-source' | ||
rdoc.rdoc_files.include('README.rdoc') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
Spec::Rake::SpecTask.new(:rcov) do |spec| | ||
spec.libs << 'lib' << 'spec' | ||
spec.pattern = 'spec/**/*_spec.rb' | ||
spec.rcov = true | ||
end | ||
|
||
# From Rspec Rakefile | ||
# | ||
def egrep(pattern) | ||
Dir['**/*.rb'].each do |fn| | ||
count = 0 | ||
open(fn) do |f| | ||
while line = f.gets | ||
count += 1 | ||
if line =~ pattern | ||
puts "#{fn}:#{count}:#{line}" | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
desc "verify_committed, verify_rcov, post_news, release" | ||
task :complete_release => [:verify_committed, :post_news, :release] | ||
task :default => :spec | ||
|
||
desc "Verifies that there is no uncommitted code" | ||
task :verify_committed do | ||
IO.popen('git status') do |io| | ||
io.each_line do |line| | ||
raise "\n!!! Do a git commit first !!!\n\n" if line =~ /^#\s*modified:/ | ||
end | ||
require 'rake/rdoctask' | ||
Rake::RDocTask.new do |rdoc| | ||
if File.exist?('VERSION.yml') | ||
config = YAML.load(File.read('VERSION.yml')) | ||
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}" | ||
else | ||
version = "" | ||
end | ||
|
||
rdoc.rdoc_dir = 'rdoc' | ||
rdoc.title = "postgis_adapter #{version}" | ||
rdoc.rdoc_files.include('README*') | ||
rdoc.rdoc_files.include('lib/**/*.rb') | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
:major: 0 | ||
:minor: 3 | ||
:patch: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters