Skip to content

Commit

Permalink
switched from jeweler to bundler
Browse files Browse the repository at this point in the history
  • Loading branch information
mlomnicki committed Feb 25, 2011
1 parent aab5932 commit 4e6af64
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 210 deletions.
5 changes: 0 additions & 5 deletions .document

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
1.1.3
* switched from jeweler to bundler
* sorting of indexes and foreign keys on schema dumper
1.1.2
* don't quote constraint name (bugfix)
Expand Down
14 changes: 2 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
source :rubygems

gem "activerecord"

group :development, :test do
gem "jeweler", "~> 1.5"
gem "rspec", '~> 1.3'
gem "pg"
gem "mysql"
gem "mysql2"
gem "sqlite3-ruby", "~> 1.3.1"
end
source "http://rubygems.org"

gemspec
# vim: ft=ruby
50 changes: 30 additions & 20 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,40 +1,50 @@
PATH
remote: .
specs:
redhillonrails_core (1.1.3)
activerecord (>= 2)

GEM
remote: http://rubygems.org/
specs:
activemodel (3.0.3)
activesupport (= 3.0.3)
activemodel (3.0.4)
activesupport (= 3.0.4)
builder (~> 2.1.2)
i18n (~> 0.4)
activerecord (3.0.3)
activemodel (= 3.0.3)
activesupport (= 3.0.3)
activerecord (3.0.4)
activemodel (= 3.0.4)
activesupport (= 3.0.4)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activesupport (3.0.3)
arel (2.0.6)
activesupport (3.0.4)
arel (2.0.9)
builder (2.1.2)
git (1.2.5)
diff-lcs (1.1.2)
i18n (0.5.0)
jeweler (1.5.2)
bundler (~> 1.0.0)
git (>= 1.2.5)
rake
mysql (2.8.1)
mysql2 (0.2.6)
pg (0.9.0)
rake (0.8.7)
rspec (1.3.1)
sqlite3-ruby (1.3.2)
tzinfo (0.3.23)
pg (0.10.1)
rspec (2.4.0)
rspec-core (~> 2.4.0)
rspec-expectations (~> 2.4.0)
rspec-mocks (~> 2.4.0)
rspec-core (2.4.0)
rspec-expectations (2.4.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.4.0)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
tzinfo (0.3.24)

PLATFORMS
ruby

DEPENDENCIES
activerecord
jeweler (~> 1.5)
activerecord (>= 2)
mysql
mysql2
pg
rspec (~> 1.3)
redhillonrails_core!
rspec (~> 2.4.0)
sqlite3-ruby (~> 1.3.1)
84 changes: 13 additions & 71 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,73 +1,17 @@
# encoding: utf-8
require 'rubygems'
require 'rake'
require 'bundler'
Bundler::GemHelper.install_tasks

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "redhillonrails_core"
gem.summary = %Q{Adds support in ActiveRecord for foreign_keys, complex indexes and other database-related stuff}
gem.description = %Q{Adds support in ActiveRecord for foreign_keys, complex indexes and other database-related stuff. Easily create foreign_keys, complex indexes and views.}
gem.email = "michal.lomnicki@gmail.com"
gem.homepage = "http://github.com/mlomnicki/redhillonrails_core"
gem.authors = ["Michał Łomnicki"]
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings

gem.files.exclude ".gitignore"
gem.files.exclude ".document"
gem.files.exclude ".rvmrc"
gem.files.exclude "Gemfile"
gem.files.exclude "Gemfile.lock"
gem.files.exclude "Rakefile"
gem.files.exclude "VERSION"
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
end

require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'lib' << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end

begin
require 'rcov/rcovtask'
Rcov::RcovTask.new do |test|
test.libs << 'test'
test.pattern = 'test/**/test_*.rb'
test.verbose = true
end
rescue LoadError
task :rcov do
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end
end

require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
version = File.exist?('VERSION') ? File.read('VERSION') : ""

rdoc.rdoc_dir = 'rdoc'
rdoc.title = "redhillonrails_core #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end

require 'spec/rake/spectask'
require 'rspec/core/rake_task'
%w[postgresql mysql mysql2 sqlite3].each do |adapter|
namespace adapter do
Spec::Rake::SpecTask.new(:spec) do |spec|
spec.libs << 'lib' << 'spec' << "spec/connections/#{adapter}"
spec.spec_files = FileList['spec/**/*_spec.rb']
RSpec::Core::RakeTask.new(:spec) do |spec|
spec.rspec_opts = "-Ispec/connections/#{adapter}"
end
end
end

desc 'Run postgresql mysql, mysql2 and sqlite3 specs'
task :spec do
desc 'Run postgresql and mysql tests'
task :spec do
%w[postgresql mysql mysql2 sqlite3].each do |adapter|
Rake::Task["#{adapter}:spec"].invoke
end
Expand All @@ -78,14 +22,12 @@ task :default => :spec
namespace :postgresql do
desc 'Build the PostgreSQL test databases'
task :build_databases do
%x( createdb -E UTF8 redhillonrails_core_test )
%x( createdb -E UTF8 redhillonrails_core_test2 )
%x( createdb -E UTF8 rh_core_unittest )
end

desc 'Drop the PostgreSQL test databases'
task :drop_databases do
%x( dropdb redhillonrails_core_unittest )
%x( dropdb redhillonrails_core_unittest2 )
%x( dropdb rh_core_unittest )
end

desc 'Rebuild the PostgreSQL test databases'
Expand All @@ -96,16 +38,16 @@ task :build_postgresql_databases => 'postgresql:build_databases'
task :drop_postgresql_databases => 'postgresql:drop_databases'
task :rebuild_postgresql_databases => 'postgresql:rebuild_databases'

MYSQL_DB_USER = 'redhillonrails_core'
MYSQL_DB_USER = 'rh_core'
namespace :mysql do
desc 'Build the MySQL test databases'
task :build_databases do
%x( echo "create DATABASE redhillonrails_core_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci " | mysql --user=#{MYSQL_DB_USER})
%x( echo "create DATABASE rh_core_unittest DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci " | mysql --user=#{MYSQL_DB_USER})
end

desc 'Drop the MySQL test databases'
desc 'Drop the MySQL test databases'
task :drop_databases do
%x( mysqladmin --user=#{MYSQL_DB_USER} -f drop redhillonrails_core_test )
%x( mysqladmin --user=#{MYSQL_DB_USER} -f drop rh_core_unittest )
end

desc 'Rebuild the MySQL test databases'
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

3 changes: 2 additions & 1 deletion lib/redhillonrails_core.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
begin
begin
require 'active_record'
rescue
gem 'active_record'
require 'active_record'
end

# TODO: only needed adapters should be required here
require 'redhillonrails_core/version'
require 'redhillonrails_core/active_record/base'
require 'redhillonrails_core/active_record/schema'
require 'redhillonrails_core/active_record/schema_dumper'
Expand Down
3 changes: 3 additions & 0 deletions lib/redhillonrails_core/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module RedhillonrailsCore
VERSION = "1.1.3"
end
120 changes: 21 additions & 99 deletions redhillonrails_core.gemspec
Original file line number Diff line number Diff line change
@@ -1,107 +1,29 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "redhillonrails_core/version"

Gem::Specification.new do |s|
s.name = %q{redhillonrails_core}
s.version = "1.1.3.pre1"
s.name = "redhillonrails_core"
s.version = RedhillonrailsCore::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Michał Łomnicki"]
s.email = ["michal.lomnicki@gmail.com"]
s.homepage = "https://github.com/mlomnicki/redhillonrails_core"
s.summary = "Adds support in ActiveRecord for foreign_keys, complex indexes and other database-related stuff"
s.description = "Adds support in ActiveRecord for foreign_keys, complex indexes and other database-related stuff. Easily create foreign_keys, complex indexes and views."

s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Michał Łomnicki"]
s.date = %q{2011-02-21}
s.description = %q{Adds support in ActiveRecord for foreign_keys, complex indexes and other database-related stuff. Easily create foreign_keys, complex indexes and views.}
s.email = %q{michal.lomnicki@gmail.com}
s.extra_rdoc_files = [
"README.rdoc"
]
s.files = [
"CHANGELOG",
"MIT-LICENSE",
"README.rdoc",
"init.rb",
"lib/redhillonrails_core.rb",
"lib/redhillonrails_core/active_record/base.rb",
"lib/redhillonrails_core/active_record/connection_adapters/abstract_adapter.rb",
"lib/redhillonrails_core/active_record/connection_adapters/column.rb",
"lib/redhillonrails_core/active_record/connection_adapters/foreign_key_definition.rb",
"lib/redhillonrails_core/active_record/connection_adapters/index_definition.rb",
"lib/redhillonrails_core/active_record/connection_adapters/mysql_adapter.rb",
"lib/redhillonrails_core/active_record/connection_adapters/mysql_column.rb",
"lib/redhillonrails_core/active_record/connection_adapters/postgresql_adapter.rb",
"lib/redhillonrails_core/active_record/connection_adapters/sqlite3_adapter.rb",
"lib/redhillonrails_core/active_record/connection_adapters/table_definition.rb",
"lib/redhillonrails_core/active_record/schema.rb",
"lib/redhillonrails_core/active_record/schema_dumper.rb",
"redhillonrails_core.gemspec",
"spec/connections/mysql/connection.rb",
"spec/connections/mysql2/connection.rb",
"spec/connections/postgresql/connection.rb",
"spec/connections/sqlite3/connection.rb",
"spec/connections/sqlite3/redhillonrails_core.db",
"spec/foreign_key_definition_spec.rb",
"spec/foreign_key_spec.rb",
"spec/index_definition_spec.rb",
"spec/index_spec.rb",
"spec/models/comment.rb",
"spec/models/post.rb",
"spec/models/user.rb",
"spec/schema/schema.rb",
"spec/schema_dumper_spec.rb",
"spec/spec_helper.rb",
"spec/support/reference.rb"
]
s.homepage = %q{http://github.com/mlomnicki/redhillonrails_core}
s.rubyforge_project = "redhillonrails_core"

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.6}
s.summary = %q{Adds support in ActiveRecord for foreign_keys, complex indexes and other database-related stuff}
s.test_files = [
"spec/connections/mysql/connection.rb",
"spec/connections/mysql2/connection.rb",
"spec/connections/postgresql/connection.rb",
"spec/connections/sqlite3/connection.rb",
"spec/foreign_key_definition_spec.rb",
"spec/foreign_key_spec.rb",
"spec/index_definition_spec.rb",
"spec/index_spec.rb",
"spec/models/comment.rb",
"spec/models/post.rb",
"spec/models/user.rb",
"spec/schema/schema.rb",
"spec/schema_dumper_spec.rb",
"spec/spec_helper.rb",
"spec/support/reference.rb"
]

if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
s.add_dependency("activerecord", ">= 2")

if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<activerecord>, [">= 0"])
s.add_development_dependency(%q<jeweler>, ["~> 1.5"])
s.add_development_dependency(%q<rspec>, ["~> 1.3"])
s.add_development_dependency(%q<pg>, [">= 0"])
s.add_development_dependency(%q<mysql>, [">= 0"])
s.add_development_dependency(%q<mysql2>, [">= 0"])
s.add_development_dependency(%q<sqlite3-ruby>, ["~> 1.3.1"])
else
s.add_dependency(%q<activerecord>, [">= 0"])
s.add_dependency(%q<jeweler>, ["~> 1.5"])
s.add_dependency(%q<rspec>, ["~> 1.3"])
s.add_dependency(%q<pg>, [">= 0"])
s.add_dependency(%q<mysql>, [">= 0"])
s.add_dependency(%q<mysql2>, [">= 0"])
s.add_dependency(%q<sqlite3-ruby>, ["~> 1.3.1"])
end
else
s.add_dependency(%q<activerecord>, [">= 0"])
s.add_dependency(%q<jeweler>, ["~> 1.5"])
s.add_dependency(%q<rspec>, ["~> 1.3"])
s.add_dependency(%q<pg>, [">= 0"])
s.add_dependency(%q<mysql>, [">= 0"])
s.add_dependency(%q<mysql2>, [">= 0"])
s.add_dependency(%q<sqlite3-ruby>, ["~> 1.3.1"])
end
s.add_development_dependency("rspec", "~> 2.4.0")
s.add_development_dependency("pg")
s.add_development_dependency("mysql")
s.add_development_dependency("mysql2")
s.add_development_dependency("sqlite3-ruby", "~> 1.3.1")
end

2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require 'connection'
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|f| require f}

Spec::Runner.configure do |config|
RSpec.configure do |config|
config.include(RedhillonrailsCoreMatchers)
# load schema
ActiveRecord::Migration.suppress_messages do
Expand Down

0 comments on commit 4e6af64

Please sign in to comment.