Permalink
Browse files

[dm-more] Converted to use Jeweler

* Removed old/unecessary files
  • Loading branch information...
dkubb committed Nov 24, 2009
1 parent efa9d03 commit 0cac61fa4b1fac0044847e66c4bff020dbc0097b
Showing with 204 additions and 148 deletions.
  1. +0 −23 History.rdoc
  2. +1 −1 LICENSE
  3. +0 −41 Manifest.txt
  4. +25 −18 Rakefile
  5. 0 TODO
  6. +1 −0 VERSION
  7. +81 −0 dm-migrations.gemspec
  8. +0 −5 lib/dm-migrations/version.rb
  9. +6 −0 spec/rcov.opts
  10. +1 −0 tasks/ci.rake
  11. +0 −22 tasks/db.rb
  12. +0 −13 tasks/install.rb
  13. +36 −0 tasks/metrics.rake
  14. +25 −0 tasks/spec.rake
  15. +0 −25 tasks/spec.rb
  16. +9 −0 tasks/yard.rake
  17. +19 −0 tasks/yardstick.rake
View
@@ -1,23 +0,0 @@
-=== 0.10.1 / 2009-09-30
-
-* No changes this version
-
-=== 0.10.0 / 2009-09-15
-
-* Updated to work with dm-core 0.10.0
-
-=== 0.9.11 / 2009-03-29
-
-* No changes this version
-
-=== 0.9.10 / 2009-01-19
-
-* No changes this version
-
-=== 0.9.9 / 2009-01-04
-
-* No changes this version
-
-=== 0.9.8 / 2008-12-07
-
-* No changes this version
View
@@ -1,4 +1,4 @@
-Copyright (c) 2007 Paul Sadauskas
+Copyright (c) 2009 Paul Sadauskas
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -1,41 +0,0 @@
-History.rdoc
-LICENSE
-Manifest.txt
-README.rdoc
-Rakefile
-TODO
-db/migrations/1_create_people_table.rb
-db/migrations/2_add_dob_to_people.rb
-db/migrations/config.rb
-examples/sample_migration.rb
-examples/sample_migration_spec.rb
-lib/dm-migrations.rb
-lib/dm-migrations/migration.rb
-lib/dm-migrations/migration_runner.rb
-lib/dm-migrations/sql.rb
-lib/dm-migrations/sql/column.rb
-lib/dm-migrations/sql/mysql.rb
-lib/dm-migrations/sql/postgresql.rb
-lib/dm-migrations/sql/sqlite3.rb
-lib/dm-migrations/sql/table.rb
-lib/dm-migrations/sql/table_creator.rb
-lib/dm-migrations/sql/table_modifier.rb
-lib/dm-migrations/version.rb
-lib/spec/example/migration_example_group.rb
-lib/spec/matchers/migration_matchers.rb
-spec/integration/migration_runner_spec.rb
-spec/integration/migration_spec.rb
-spec/integration/sql_spec.rb
-spec/spec.opts
-spec/spec_helper.rb
-spec/unit/migration_spec.rb
-spec/unit/sql/column_spec.rb
-spec/unit/sql/postgresql_spec.rb
-spec/unit/sql/sqlite3_extensions_spec.rb
-spec/unit/sql/table_creator_spec.rb
-spec/unit/sql/table_modifier_spec.rb
-spec/unit/sql/table_spec.rb
-spec/unit/sql_spec.rb
-tasks/db.rb
-tasks/install.rb
-tasks/spec.rb
View
@@ -1,24 +1,31 @@
-require 'pathname'
+require 'rubygems'
+require 'rake'
-ROOT = Pathname(__FILE__).dirname.expand_path
-JRUBY = RUBY_PLATFORM =~ /java/
-WINDOWS = Gem.win_platform? || (JRUBY && ENV_JAVA['os.name'] =~ /windows/i)
-SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
+FileList['tasks/**/*.rake'].each { |task| load task }
-require ROOT + 'lib/dm-migrations/version'
+begin
+ require 'jeweler'
-AUTHOR = 'Paul Sadauskas'
-EMAIL = 'psadauskas [a] gmail [d] com'
-GEM_NAME = 'dm-migrations'
-GEM_VERSION = DataMapper::Migration::VERSION
-GEM_DEPENDENCIES = [['dm-core', GEM_VERSION]]
-GEM_CLEAN = %w[ log pkg coverage ]
-GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.rdoc LICENSE TODO History.rdoc ] }
+ Jeweler::Tasks.new do |gem|
+ gem.name = 'dm-migrations'
+ gem.summary = 'DataMapper plugin for writing and speccing migrations'
+ gem.description = gem.summary
+ gem.email = 'psadauskas [a] gmail [d] com'
+ gem.homepage = 'http://github.com/datamapper/dm-more/tree/master/%s' % gem.name
+ gem.authors = [ 'Paul Sadauskas' ]
-PROJECT_NAME = 'datamapper'
-PROJECT_URL = "http://github.com/datamapper/dm-more/tree/master/#{GEM_NAME}"
-PROJECT_DESCRIPTION = PROJECT_SUMMARY = 'DataMapper plugin for writing and speccing migrations'
+ gem.rubyforge_project = 'datamapper'
-[ ROOT, ROOT.parent ].each do |dir|
- Pathname.glob(dir.join('tasks/**/*.rb').to_s).each { |f| require f }
+ gem.add_dependency 'dm-core', '~>0.10.2'
+
+ gem.add_development_dependency 'rspec', '>= 1.2.9'
+ gem.add_development_dependency 'yard', '>= 0.4.0'
+ end
+
+ Jeweler::GemcutterTasks.new
+ Jeweler::RubyforgeTasks.new do |rubyforge|
+ rubyforge.doc_task = 'yardoc'
+ end
+rescue LoadError
+ puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
end
View
0 TODO
No changes.
View
@@ -0,0 +1 @@
+0.10.2
View
@@ -0,0 +1,81 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE DIRECTLY
+# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{dm-migrations}
+ s.version = "0.10.2"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Paul Sadauskas"]
+ s.date = %q{2009-11-23}
+ s.description = %q{DataMapper plugin for writing and speccing migrations}
+ s.email = %q{psadauskas [a] gmail [d] com}
+ s.extra_rdoc_files = [
+ "LICENSE",
+ "README.rdoc"
+ ]
+ s.files = [
+ "LICENSE",
+ "README.rdoc",
+ "Rakefile",
+ "db/migrations/1_create_people_table.rb",
+ "db/migrations/2_add_dob_to_people.rb",
+ "db/migrations/config.rb",
+ "examples/sample_migration.rb",
+ "examples/sample_migration_spec.rb",
+ "lib/dm-migrations.rb",
+ "lib/dm-migrations/migration.rb",
+ "lib/dm-migrations/migration_runner.rb",
+ "lib/dm-migrations/sql.rb",
+ "lib/dm-migrations/sql/column.rb",
+ "lib/dm-migrations/sql/mysql.rb",
+ "lib/dm-migrations/sql/postgresql.rb",
+ "lib/dm-migrations/sql/sqlite3.rb",
+ "lib/dm-migrations/sql/table.rb",
+ "lib/dm-migrations/sql/table_creator.rb",
+ "lib/dm-migrations/sql/table_modifier.rb",
+ "lib/spec/example/migration_example_group.rb",
+ "lib/spec/matchers/migration_matchers.rb",
+ "spec/integration/migration_runner_spec.rb",
+ "spec/integration/migration_spec.rb",
+ "spec/integration/sql_spec.rb",
+ "spec/spec.opts",
+ "spec/spec_helper.rb",
+ "spec/unit/migration_spec.rb",
+ "spec/unit/sql/column_spec.rb",
+ "spec/unit/sql/postgresql_spec.rb",
+ "spec/unit/sql/sqlite3_extensions_spec.rb",
+ "spec/unit/sql/table_creator_spec.rb",
+ "spec/unit/sql/table_modifier_spec.rb",
+ "spec/unit/sql/table_spec.rb",
+ "spec/unit/sql_spec.rb"
+ ]
+ s.homepage = %q{http://github.com/datamapper/dm-more/tree/master/dm-migrations}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{datamapper}
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{DataMapper plugin for writing and speccing migrations}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<dm-core>, ["~> 0.10.2"])
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_development_dependency(%q<yard>, [">= 0.4.0"])
+ else
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_dependency(%q<yard>, [">= 0.4.0"])
+ end
+ else
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
+ s.add_dependency(%q<yard>, [">= 0.4.0"])
+ end
+end
+
@@ -1,5 +0,0 @@
-module DataMapper
- class Migration
- VERSION = '0.10.2'.freeze
- end
-end
View
@@ -0,0 +1,6 @@
+--exclude "spec"
+--sort coverage
+--callsites
+--xrefs
+--profile
+--text-summary
View
@@ -0,0 +1 @@
+task :ci => [ :verify_measurements, 'metrics:all' ]
View
@@ -1,22 +0,0 @@
-namespace :db do
-
- # pass the relative path to the migrations directory by MIGRATION_DIR
- task :setup_migration_dir do
- unless defined?(MIGRATION_DIR)
- migration_dir = ENV["MIGRATION_DIR"] || File.join("db", "migrations")
- MIGRATION_DIR = File.expand_path(File.join(File.dirname(__FILE__), migration_dir))
- end
- FileUtils.mkdir_p MIGRATION_DIR
- end
-
- # set DIRECTION to migrate down
- desc "Run your system's migrations"
- task :migrate => [:setup_migration_dir] do
- require 'dm-migrations/migration_runner.rb'
- require File.expand_path(File.join(MIGRATION_DIR, "config.rb"))
-
- Dir[File.join(MIGRATION_DIR, "*.rb")].each { |file| require file }
-
- ENV["DIRECTION"] != "down" ? migrate_up! : migrate_down!
- end
-end
View
@@ -1,13 +0,0 @@
-def sudo_gem(cmd)
- sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
-end
-
-desc "Install #{GEM_NAME} #{GEM_VERSION}"
-task :install => [ :package ] do
- sudo_gem "install pkg/#{GEM_NAME}-#{GEM_VERSION}"
-end
-
-desc "Uninstall #{GEM_NAME} #{GEM_VERSION}"
-task :uninstall => [ :clobber ] do
- sudo_gem "uninstall #{GEM_NAME} -v#{GEM_VERSION} -Ix"
-end
View
@@ -0,0 +1,36 @@
+begin
+ require 'metric_fu'
+rescue LoadError
+ namespace :metrics do
+ task :all do
+ abort 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
+ end
+ end
+end
+
+begin
+ require 'reek/adapters/rake_task'
+
+ Reek::RakeTask.new do |t|
+ t.fail_on_error = true
+ t.verbose = false
+ t.source_files = 'lib/**/*.rb'
+ end
+rescue LoadError
+ task :reek do
+ abort 'Reek is not available. In order to run reek, you must: gem install reek'
+ end
+end
+
+begin
+ require 'roodi'
+ require 'roodi_task'
+
+ RoodiTask.new do |t|
+ t.verbose = false
+ end
+rescue LoadError
+ task :roodi do
+ abort 'Roodi is not available. In order to run roodi, you must: gem install roodi'
+ end
+end
View
@@ -0,0 +1,25 @@
+require 'spec/rake/spectask'
+require 'spec/rake/verify_rcov'
+
+spec_defaults = lambda do |spec|
+ spec.pattern = 'spec/**/*_spec.rb'
+ spec.libs << 'lib' << 'spec'
+ spec.spec_opts << '--options' << 'spec/spec.opts'
+end
+
+Spec::Rake::SpecTask.new(:spec, &spec_defaults)
+
+Spec::Rake::SpecTask.new(:rcov) do |rcov|
+ spec_defaults.call(rcov)
+ rcov.rcov = true
+ rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
+end
+
+RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
+ rcov.threshold = 100
+end
+
+task :spec => :check_dependencies
+task :rcov => :check_dependencies
+
+task :default => :spec
View
@@ -1,25 +0,0 @@
-begin
- require 'spec/rake/spectask'
-
- task :default => [ :spec ]
-
- desc 'Run specifications'
- Spec::Rake::SpecTask.new(:spec) do |t|
- t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
- t.libs << 'lib' << 'spec' # needed for CI rake spec task, duplicated in spec_helper
-
- begin
- require 'rcov'
- t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
- t.rcov_opts << '--exclude' << 'spec'
- t.rcov_opts << '--text-summary'
- t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
- rescue LoadError
- # rcov not installed
- rescue SyntaxError
- # rcov syntax invalid
- end
- end
-rescue LoadError
- # rspec not installed
-end
View
@@ -0,0 +1,9 @@
+begin
+ require 'yard'
+
+ YARD::Rake::YardocTask.new
+rescue LoadError
+ task :yard do
+ abort 'YARD is not available. In order to run yard, you must: gem install yard'
+ end
+end
View
@@ -0,0 +1,19 @@
+begin
+ require 'pathname'
+ require 'yardstick/rake/measurement'
+ require 'yardstick/rake/verify'
+
+ # yardstick_measure task
+ Yardstick::Rake::Measurement.new
+
+ # verify_measurements task
+ Yardstick::Rake::Verify.new do |verify|
+ verify.threshold = 100
+ end
+rescue LoadError
+ %w[ yardstick_measure verify_measurements ].each do |name|
+ task name.to_s do
+ abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
+ end
+ end
+end

0 comments on commit 0cac61f

Please sign in to comment.