Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Setting up do_postgres for hoe
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernerd Schaefer committed Jul 14, 2008
1 parent b51c5ae commit fb06130
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 34 deletions.
1 change: 1 addition & 0 deletions do_postgres/History.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

19 changes: 19 additions & 0 deletions do_postgres/Manifest.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
History.txt
LICENSE
Manifest.txt
README.txt
Rakefile
TODO
ext/do_postgres_ext.c
ext/extconf.rb
ext/type-oids.h
lib/do_postgres.rb
lib/do_postgres/transaction.rb
lib/do_postgres/version.rb
spec/integration/do_postgres_spec.rb
spec/integration/logging_spec.rb
spec/integration/quoting_spec.rb
spec/integration/timezone_spec.rb
spec/spec.opts
spec/spec_helper.rb
spec/unit/transaction_spec.rb
3 changes: 1 addition & 2 deletions do_postgres/README → do_postgres/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
do_postgres
===========
= do_postgres

A PostgreSQL driver for DataObjects
53 changes: 21 additions & 32 deletions do_postgres/Rakefile
Original file line number Diff line number Diff line change
@@ -1,53 +1,42 @@
require 'rubygems'
require 'rake/clean'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
require 'pathname'
require Pathname(__FILE__).dirname.expand_path.parent + 'tasks/ext_helper'

# House-keeping
CLEAN.include '**/*.o', '**/*.so', '**/*.bundle', '**/*.a',
'**/*.log', '{ext,lib}/*.{bundle,so,obj,pdb,lib,def,exp}',
'ext/Makefile'
ROOT = Pathname(__FILE__).dirname.expand_path

require "lib/do_postgres/version"

JRUBY = (RUBY_PLATFORM =~ /java/) rescue nil
WINDOWS = (RUBY_PLATFORM =~ /mswin|mingw|cygwin/) rescue nil
# don't use SUDO with JRuby, for the moment, although this behaviour
# is not entirely correct.
SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])

spec = Gem::Specification.new do |s|
s.name = 'do_postgres'
s.version = '0.9.3'
s.platform = Gem::Platform::RUBY
s.has_rdoc = true
s.extra_rdoc_files = %w[ README LICENSE TODO ]
s.summary = 'A DataObject.rb driver for PostgreSQL'
s.description = s.summary
s.author = 'Yehuda Katz'
s.email = 'wycats@gmail.com'
s.homepage = 'http://rubyforge.org/projects/dorb'
s.rubyforge_project = 'dorb'
s.require_path = 'lib'
s.extensions = %w[ ext/extconf.rb ]
s.files = FileList[ '{ext,lib,spec}/**/*.{c,h,rb}', 'Rakefile', *s.extra_rdoc_files ]
s.add_dependency('data_objects', "=#{s.version}")
end
AUTHOR = "Bernerd Schaefer"
EMAIL = "bj.schaefer@gmail.com"
GEM_NAME = "do_postgres"
GEM_VERSION = DataObjects::Postgres::VERSION
GEM_DEPENDENCIES = [["data_objects", GEM_VERSION]]
GEM_CLEAN = ['**/*.{o,so,bundle,log,a,gem,dSYM,obj,pdb,lib,def,exp,DS_Store}', 'ext/Makefile']
GEM_EXTRAS = { :extensions => %w[ ext/extconf.rb ], :has_rdoc => false }

Rake::GemPackageTask.new(spec) do |pkg|
pkg.gem_spec = spec
end
PROJECT_NAME = "dorb"
PROJECT_URL = "http://rubyforge.org/projects/dorb"
PROJECT_DESCRIPTION = PROJECT_SUMMARY = "A DataObject.rb driver for MySQL"

DRIVER = true

require ROOT.parent + 'tasks/hoe'

# Use of ext_helper to properly setup compile tasks and native gem generation
setup_extension "#{spec.name}_ext", spec
# Installation

task :install => [ :package ] do
sh %{#{SUDO} gem install --local pkg/#{spec.name}-#{spec.version} --no-update-sources}, :verbose => false
sh %{#{SUDO} gem install --local pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources}, :verbose => false
end

desc "Uninstall #{spec.name} #{spec.version} (default ruby)"
desc "Uninstall #{GEM_NAME} #{GEM_VERSION} (default ruby)"
task :uninstall => [ :clobber ] do
sh "#{SUDO} gem uninstall #{spec.name} -v#{spec.version} -I -x", :verbose => false
sh "#{SUDO} gem uninstall #{GEM_NAME} -v#{GEM_VERSION} -I -x", :verbose => false
end

desc 'Run specifications'
Expand Down
5 changes: 5 additions & 0 deletions do_postgres/lib/do_postgres/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module DataObjects
module Postgres
VERSION = "0.9.3"
end
end

0 comments on commit fb06130

Please sign in to comment.