dm-migrations 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007 Paul Sadauskas
1
+ Copyright (c) 2009 Paul Sadauskas
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -1,24 +1,29 @@
1
- require 'pathname'
1
+ require 'rubygems'
2
+ require 'rake'
2
3
 
3
- ROOT = Pathname(__FILE__).dirname.expand_path
4
- JRUBY = RUBY_PLATFORM =~ /java/
5
- WINDOWS = Gem.win_platform?
6
- SUDO = (WINDOWS || JRUBY) ? '' : ('sudo' unless ENV['SUDOLESS'])
4
+ begin
5
+ gem 'jeweler', '~> 1.4'
6
+ require 'jeweler'
7
7
 
8
- require ROOT + 'lib/dm-migrations/version'
8
+ Jeweler::Tasks.new do |gem|
9
+ gem.name = 'dm-migrations'
10
+ gem.summary = 'DataMapper plugin for writing and speccing migrations'
11
+ gem.description = gem.summary
12
+ gem.email = 'psadauskas [a] gmail [d] com'
13
+ gem.homepage = 'http://github.com/datamapper/dm-more/tree/master/%s' % gem.name
14
+ gem.authors = [ 'Paul Sadauskas' ]
9
15
 
10
- AUTHOR = 'Paul Sadauskas'
11
- EMAIL = 'psadauskas [a] gmail [d] com'
12
- GEM_NAME = 'dm-migrations'
13
- GEM_VERSION = DataMapper::Migration::VERSION
14
- GEM_DEPENDENCIES = [['dm-core', GEM_VERSION]]
15
- GEM_CLEAN = %w[ log pkg coverage ]
16
- GEM_EXTRAS = { :has_rdoc => true, :extra_rdoc_files => %w[ README.rdoc LICENSE TODO History.rdoc ] }
16
+ gem.rubyforge_project = 'datamapper'
17
17
 
18
- PROJECT_NAME = 'datamapper'
19
- PROJECT_URL = "http://github.com/datamapper/dm-more/tree/master/#{GEM_NAME}"
20
- PROJECT_DESCRIPTION = PROJECT_SUMMARY = 'DataMapper plugin for writing and speccing migrations'
18
+ gem.add_dependency 'dm-core', '~> 0.10.2'
21
19
 
22
- [ ROOT, ROOT.parent ].each do |dir|
23
- Pathname.glob(dir.join('tasks/**/*.rb').to_s).each { |f| require f }
20
+ gem.add_development_dependency 'rspec', '~> 1.2.9'
21
+ gem.add_development_dependency 'yard', '~> 0.4.0'
22
+ end
23
+
24
+ Jeweler::GemcutterTasks.new
25
+
26
+ FileList['tasks/**/*.rake'].each { |task| import task }
27
+ rescue LoadError
28
+ puts 'Jeweler (or a dependency) not available. Install it with: gem install jeweler'
24
29
  end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.10.2
@@ -1,7 +1,7 @@
1
1
  migration 2, :add_dob_to_people do
2
2
  up do
3
3
  modify_table :people do
4
- add_column :dob, DateTime, :nullable? => true
4
+ add_column :dob, DateTime, :allow_nil => true
5
5
  end
6
6
  end
7
7
 
@@ -0,0 +1,89 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{dm-migrations}
8
+ s.version = "0.10.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Paul Sadauskas"]
12
+ s.date = %q{2009-12-11}
13
+ s.description = %q{DataMapper plugin for writing and speccing migrations}
14
+ s.email = %q{psadauskas [a] gmail [d] com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ "LICENSE",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "db/migrations/1_create_people_table.rb",
25
+ "db/migrations/2_add_dob_to_people.rb",
26
+ "db/migrations/config.rb",
27
+ "dm-migrations.gemspec",
28
+ "examples/sample_migration.rb",
29
+ "examples/sample_migration_spec.rb",
30
+ "lib/dm-migrations.rb",
31
+ "lib/dm-migrations/migration.rb",
32
+ "lib/dm-migrations/migration_runner.rb",
33
+ "lib/dm-migrations/sql.rb",
34
+ "lib/dm-migrations/sql/column.rb",
35
+ "lib/dm-migrations/sql/mysql.rb",
36
+ "lib/dm-migrations/sql/postgresql.rb",
37
+ "lib/dm-migrations/sql/sqlite3.rb",
38
+ "lib/dm-migrations/sql/table.rb",
39
+ "lib/dm-migrations/sql/table_creator.rb",
40
+ "lib/dm-migrations/sql/table_modifier.rb",
41
+ "lib/spec/example/migration_example_group.rb",
42
+ "lib/spec/matchers/migration_matchers.rb",
43
+ "spec/integration/migration_runner_spec.rb",
44
+ "spec/integration/migration_spec.rb",
45
+ "spec/integration/sql_spec.rb",
46
+ "spec/rcov.opts",
47
+ "spec/spec.opts",
48
+ "spec/spec_helper.rb",
49
+ "spec/unit/migration_spec.rb",
50
+ "spec/unit/sql/column_spec.rb",
51
+ "spec/unit/sql/postgresql_spec.rb",
52
+ "spec/unit/sql/sqlite3_extensions_spec.rb",
53
+ "spec/unit/sql/table_creator_spec.rb",
54
+ "spec/unit/sql/table_modifier_spec.rb",
55
+ "spec/unit/sql/table_spec.rb",
56
+ "spec/unit/sql_spec.rb",
57
+ "tasks/ci.rake",
58
+ "tasks/metrics.rake",
59
+ "tasks/spec.rake",
60
+ "tasks/yard.rake",
61
+ "tasks/yardstick.rake"
62
+ ]
63
+ s.homepage = %q{http://github.com/datamapper/dm-more/tree/master/dm-migrations}
64
+ s.rdoc_options = ["--charset=UTF-8"]
65
+ s.require_paths = ["lib"]
66
+ s.rubyforge_project = %q{datamapper}
67
+ s.rubygems_version = %q{1.3.5}
68
+ s.summary = %q{DataMapper plugin for writing and speccing migrations}
69
+
70
+ if s.respond_to? :specification_version then
71
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
72
+ s.specification_version = 3
73
+
74
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
75
+ s.add_runtime_dependency(%q<dm-core>, ["~> 0.10.2"])
76
+ s.add_development_dependency(%q<rspec>, ["~> 1.2.9"])
77
+ s.add_development_dependency(%q<yard>, ["~> 0.4.0"])
78
+ else
79
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
80
+ s.add_dependency(%q<rspec>, ["~> 1.2.9"])
81
+ s.add_dependency(%q<yard>, ["~> 0.4.0"])
82
+ end
83
+ else
84
+ s.add_dependency(%q<dm-core>, ["~> 0.10.2"])
85
+ s.add_dependency(%q<rspec>, ["~> 1.2.9"])
86
+ s.add_dependency(%q<yard>, ["~> 0.4.0"])
87
+ end
88
+ end
89
+
@@ -21,7 +21,7 @@ end
21
21
  migration 2, :add_dob_to_people do
22
22
  up do
23
23
  modify_table :people do
24
- add_column :dob, DateTime, :nullable? => true
24
+ add_column :dob, DateTime, :allow_nil => true
25
25
  end
26
26
  end
27
27
 
@@ -177,7 +177,7 @@ module DataMapper
177
177
  # Fetch the record for this migration out of the migration_info table
178
178
  def migration_record
179
179
  return [] unless migration_info_table_exists?
180
- @adapter.query("SELECT #{migration_name_column} FROM #{migration_info_table} WHERE #{migration_name_column} = #{quoted_name}")
180
+ @adapter.select("SELECT #{migration_name_column} FROM #{migration_info_table} WHERE #{migration_name_column} = #{quoted_name}")
181
181
  end
182
182
 
183
183
  # True if the migration needs to be run
@@ -36,7 +36,7 @@ module SQL
36
36
  class Table
37
37
  def initialize(adapter, table_name)
38
38
  @columns = []
39
- adapter.query_table(table_name).each do |col_struct|
39
+ adapter.table_info(table_name).each do |col_struct|
40
40
  @columns << SQL::Mysql::Column.new(col_struct)
41
41
  end
42
42
  end
@@ -48,10 +48,10 @@ module SQL
48
48
  end
49
49
 
50
50
  def query_column_constraints
51
- @adapter.query(
51
+ @adapter.select(
52
52
  "SELECT * FROM information_schema.table_constraints WHERE table_name='#{@name}' AND table_schema=current_schema()"
53
53
  ).each do |table_constraint|
54
- @adapter.query(
54
+ @adapter.select(
55
55
  "SELECT * FROM information_schema.constraint_column_usage WHERE constraint_name='#{table_constraint.constraint_name}' AND table_schema=current_schema()"
56
56
  ).each do |constrained_column|
57
57
  @columns.each do |column|
@@ -28,7 +28,7 @@ module SQL
28
28
  class Table < SQL::Table
29
29
  def initialize(adapter, table_name)
30
30
  @columns = []
31
- adapter.query_table(table_name).each do |col_struct|
31
+ adapter.table_info(table_name).each do |col_struct|
32
32
  @columns << SQL::Sqlite3::Column.new(col_struct)
33
33
  end
34
34
  end
@@ -64,8 +64,14 @@ module SQL
64
64
  def build_type(type_class)
65
65
  schema = { :name => @name, :quote_column_name => quoted_name }.merge(@opts)
66
66
 
67
- unless schema.key?(:nullable)
68
- schema[:nullable] = !schema[:not_null]
67
+ [ :nullable, :nullable? ].each do |option|
68
+ next if (value = schema.delete(option)).nil?
69
+ warn "#{option.inspect} is deprecated, use :allow_nil instead"
70
+ schema[:allow_nil] = value unless schema.key?(:allow_nil)
71
+ end
72
+
73
+ unless schema.key?(:allow_nil)
74
+ schema[:allow_nil] = !schema[:not_null]
69
75
  end
70
76
 
71
77
  schema[:length] ||= schema.delete(:size) if schema.key?(:size)
@@ -76,7 +82,7 @@ module SQL
76
82
  primitive = type_class.respond_to?(:primitive) ? type_class.primitive : type_class
77
83
  options = @adapter.class.type_map[primitive].dup
78
84
 
79
- if type_class.respond_to?(:options)
85
+ if type_class.respond_to?(:options) && type_class.options.kind_of?(options.class)
80
86
  options.update(type_class.options)
81
87
  end
82
88
 
@@ -58,8 +58,8 @@ module Spec
58
58
  @@migrations.select { |m| m.name.to_s == migration_name }.first
59
59
  end
60
60
 
61
- def query(sql)
62
- this_migration.adapter.query(sql)
61
+ def select(sql)
62
+ this_migration.adapter.select(sql)
63
63
  end
64
64
 
65
65
  def table(table_name)
@@ -19,7 +19,7 @@ ADAPTERS.each do |adapter|
19
19
  before do
20
20
  @creator = DataMapper::Migration::TableCreator.new(repository(adapter).adapter, :people) do
21
21
  column :id, DataMapper::Types::Serial
22
- column :name, 'VARCHAR(50)', :nullable => false
22
+ column :name, 'VARCHAR(50)', :allow_nil => false
23
23
  column :long_string, String, :size => 200
24
24
  end
25
25
  end
@@ -58,7 +58,7 @@ ADAPTERS.each do |adapter|
58
58
  col.instance_eval("@type").should include("200")
59
59
  end
60
60
 
61
- it "should generate a NOT NULL column when :nullable is false" do
61
+ it "should generate a NOT NULL column when :allow_nil is false" do
62
62
  @creator.instance_eval("@columns")[1].type.should match(/NOT NULL/)
63
63
  end
64
64
 
data/spec/rcov.opts ADDED
@@ -0,0 +1,6 @@
1
+ --exclude "spec"
2
+ --sort coverage
3
+ --callsites
4
+ --xrefs
5
+ --profile
6
+ --text-summary
data/spec/spec.opts CHANGED
@@ -1,2 +1,4 @@
1
1
  --colour
2
2
  --loadby random
3
+ --format profile
4
+ --backtrace
@@ -375,7 +375,7 @@ describe 'Migration' do
375
375
 
376
376
  describe '#migration_record' do
377
377
  it 'should query for the migration' do
378
- @adapter.should_receive(:query).with(
378
+ @adapter.should_receive(:select).with(
379
379
  %Q{SELECT 'migration_name' FROM 'migration_info' WHERE 'migration_name' = 'do_nothing'}
380
380
  )
381
381
  @m.migration_record
@@ -383,7 +383,7 @@ describe 'Migration' do
383
383
 
384
384
  it 'should not try to query if the table does not exist' do
385
385
  @m.stub!(:migration_info_table_exists?).and_return(false)
386
- @adapter.should_not_receive(:query)
386
+ @adapter.should_not_receive(:select)
387
387
  @m.migration_record
388
388
  end
389
389
 
@@ -32,7 +32,7 @@ describe "SQLite3 Extensions" do
32
32
  before do
33
33
  @cs1 = mock('Column Struct')
34
34
  @cs2 = mock('Column Struct')
35
- @adapter = mock('adapter', :query => [])
35
+ @adapter = mock('adapter', :select => [])
36
36
  @adapter.stub!(:query_table).with('users').and_return([@cs1, @cs2])
37
37
 
38
38
  @col1 = mock('SQLite3 Column')
@@ -43,7 +43,7 @@ describe "SQLite3 Extensions" do
43
43
  @cs1 = mock('Column Struct')
44
44
  @cs2 = mock('Column Struct')
45
45
  @adapter = mock('adapter')
46
- @adapter.stub!(:query_table).with('users').and_return([@cs1, @cs2])
46
+ @adapter.stub!(:table_info).with('users').and_return([@cs1, @cs2])
47
47
 
48
48
  @col1 = mock('SQLite3 Column')
49
49
  @col2 = mock('SQLite3 Column')
@@ -52,7 +52,7 @@ describe "SQLite3 Extensions" do
52
52
  it 'should initialize columns by querying the table' do
53
53
  SQL::Sqlite3::Column.should_receive(:new).with(@cs1).and_return(@col1)
54
54
  SQL::Sqlite3::Column.should_receive(:new).with(@cs2).and_return(@col2)
55
- @adapter.should_receive(:query_table).with('users').and_return([@cs1,@cs2])
55
+ @adapter.should_receive(:table_info).with('users').and_return([@cs1,@cs2])
56
56
  SQL::Sqlite3::Table.new(@adapter, 'users')
57
57
  end
58
58
 
data/tasks/ci.rake ADDED
@@ -0,0 +1 @@
1
+ task :ci => [ :verify_measurements, 'metrics:all' ]
@@ -0,0 +1,36 @@
1
+ begin
2
+ require 'metric_fu'
3
+ rescue LoadError
4
+ namespace :metrics do
5
+ task :all do
6
+ abort 'metric_fu is not available. In order to run metrics:all, you must: gem install metric_fu'
7
+ end
8
+ end
9
+ end
10
+
11
+ begin
12
+ require 'reek/adapters/rake_task'
13
+
14
+ Reek::RakeTask.new do |t|
15
+ t.fail_on_error = true
16
+ t.verbose = false
17
+ t.source_files = 'lib/**/*.rb'
18
+ end
19
+ rescue LoadError
20
+ task :reek do
21
+ abort 'Reek is not available. In order to run reek, you must: gem install reek'
22
+ end
23
+ end
24
+
25
+ begin
26
+ require 'roodi'
27
+ require 'roodi_task'
28
+
29
+ RoodiTask.new do |t|
30
+ t.verbose = false
31
+ end
32
+ rescue LoadError
33
+ task :roodi do
34
+ abort 'Roodi is not available. In order to run roodi, you must: gem install roodi'
35
+ end
36
+ end
data/tasks/spec.rake ADDED
@@ -0,0 +1,41 @@
1
+ spec_defaults = lambda do |spec|
2
+ spec.pattern = 'spec/**/*_spec.rb'
3
+ spec.libs << 'lib' << 'spec'
4
+ spec.spec_opts << '--options' << 'spec/spec.opts'
5
+ end
6
+
7
+ begin
8
+ require 'spec/rake/spectask'
9
+
10
+ Spec::Rake::SpecTask.new(:spec, &spec_defaults)
11
+ rescue LoadError
12
+ task :spec do
13
+ abort 'rspec is not available. In order to run spec, you must: gem install rspec'
14
+ end
15
+ end
16
+
17
+ begin
18
+ require 'rcov'
19
+ require 'spec/rake/verify_rcov'
20
+
21
+ Spec::Rake::SpecTask.new(:rcov) do |rcov|
22
+ spec_defaults.call(rcov)
23
+ rcov.rcov = true
24
+ rcov.rcov_opts = File.read('spec/rcov.opts').split(/\s+/)
25
+ end
26
+
27
+ RCov::VerifyTask.new(:verify_rcov => :rcov) do |rcov|
28
+ rcov.threshold = 100
29
+ end
30
+ rescue LoadError
31
+ %w[ rcov verify_rcov ].each do |name|
32
+ task name do
33
+ abort "rcov is not available. In order to run #{name}, you must: gem install rcov"
34
+ end
35
+ end
36
+ end
37
+
38
+ task :spec => :check_dependencies
39
+ task :rcov => :check_dependencies
40
+
41
+ task :default => :spec
data/tasks/yard.rake ADDED
@@ -0,0 +1,9 @@
1
+ begin
2
+ require 'yard'
3
+
4
+ YARD::Rake::YardocTask.new
5
+ rescue LoadError
6
+ task :yard do
7
+ abort 'YARD is not available. In order to run yard, you must: gem install yard'
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ begin
2
+ require 'pathname'
3
+ require 'yardstick/rake/measurement'
4
+ require 'yardstick/rake/verify'
5
+
6
+ # yardstick_measure task
7
+ Yardstick::Rake::Measurement.new
8
+
9
+ # verify_measurements task
10
+ Yardstick::Rake::Verify.new do |verify|
11
+ verify.threshold = 100
12
+ end
13
+ rescue LoadError
14
+ %w[ yardstick_measure verify_measurements ].each do |name|
15
+ task name.to_s do
16
+ abort "Yardstick is not available. In order to run #{name}, you must: gem install yardstick"
17
+ end
18
+ end
19
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dm-migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Sadauskas
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-30 00:00:00 -07:00
12
+ date: 2009-12-11 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -18,32 +18,48 @@ dependencies:
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - "="
21
+ - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.10.1
23
+ version: 0.10.2
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.2.9
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: yard
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ version: 0.4.0
24
44
  version:
25
45
  description: DataMapper plugin for writing and speccing migrations
26
- email:
27
- - psadauskas [a] gmail [d] com
46
+ email: psadauskas [a] gmail [d] com
28
47
  executables: []
29
48
 
30
49
  extensions: []
31
50
 
32
51
  extra_rdoc_files:
33
- - README.rdoc
34
52
  - LICENSE
35
- - TODO
36
- - History.rdoc
53
+ - README.rdoc
37
54
  files:
38
- - History.rdoc
39
55
  - LICENSE
40
- - Manifest.txt
41
56
  - README.rdoc
42
57
  - Rakefile
43
- - TODO
58
+ - VERSION
44
59
  - db/migrations/1_create_people_table.rb
45
60
  - db/migrations/2_add_dob_to_people.rb
46
61
  - db/migrations/config.rb
62
+ - dm-migrations.gemspec
47
63
  - examples/sample_migration.rb
48
64
  - examples/sample_migration_spec.rb
49
65
  - lib/dm-migrations.rb
@@ -57,12 +73,12 @@ files:
57
73
  - lib/dm-migrations/sql/table.rb
58
74
  - lib/dm-migrations/sql/table_creator.rb
59
75
  - lib/dm-migrations/sql/table_modifier.rb
60
- - lib/dm-migrations/version.rb
61
76
  - lib/spec/example/migration_example_group.rb
62
77
  - lib/spec/matchers/migration_matchers.rb
63
78
  - spec/integration/migration_runner_spec.rb
64
79
  - spec/integration/migration_spec.rb
65
80
  - spec/integration/sql_spec.rb
81
+ - spec/rcov.opts
66
82
  - spec/spec.opts
67
83
  - spec/spec_helper.rb
68
84
  - spec/unit/migration_spec.rb
@@ -73,17 +89,18 @@ files:
73
89
  - spec/unit/sql/table_modifier_spec.rb
74
90
  - spec/unit/sql/table_spec.rb
75
91
  - spec/unit/sql_spec.rb
76
- - tasks/db.rb
77
- - tasks/install.rb
78
- - tasks/spec.rb
92
+ - tasks/ci.rake
93
+ - tasks/metrics.rake
94
+ - tasks/spec.rake
95
+ - tasks/yard.rake
96
+ - tasks/yardstick.rake
79
97
  has_rdoc: true
80
98
  homepage: http://github.com/datamapper/dm-more/tree/master/dm-migrations
81
99
  licenses: []
82
100
 
83
101
  post_install_message:
84
102
  rdoc_options:
85
- - --main
86
- - README.rdoc
103
+ - --charset=UTF-8
87
104
  require_paths:
88
105
  - lib
89
106
  required_ruby_version: !ruby/object:Gem::Requirement
data/History.rdoc DELETED
@@ -1,23 +0,0 @@
1
- === 0.10.1 / 2009-09-30
2
-
3
- * No changes this version
4
-
5
- === 0.10.0 / 2009-09-15
6
-
7
- * Updated to work with dm-core 0.10.0
8
-
9
- === 0.9.11 / 2009-03-29
10
-
11
- * No changes this version
12
-
13
- === 0.9.10 / 2009-01-19
14
-
15
- * No changes this version
16
-
17
- === 0.9.9 / 2009-01-04
18
-
19
- * No changes this version
20
-
21
- === 0.9.8 / 2008-12-07
22
-
23
- * No changes this version
data/Manifest.txt DELETED
@@ -1,41 +0,0 @@
1
- History.rdoc
2
- LICENSE
3
- Manifest.txt
4
- README.rdoc
5
- Rakefile
6
- TODO
7
- db/migrations/1_create_people_table.rb
8
- db/migrations/2_add_dob_to_people.rb
9
- db/migrations/config.rb
10
- examples/sample_migration.rb
11
- examples/sample_migration_spec.rb
12
- lib/dm-migrations.rb
13
- lib/dm-migrations/migration.rb
14
- lib/dm-migrations/migration_runner.rb
15
- lib/dm-migrations/sql.rb
16
- lib/dm-migrations/sql/column.rb
17
- lib/dm-migrations/sql/mysql.rb
18
- lib/dm-migrations/sql/postgresql.rb
19
- lib/dm-migrations/sql/sqlite3.rb
20
- lib/dm-migrations/sql/table.rb
21
- lib/dm-migrations/sql/table_creator.rb
22
- lib/dm-migrations/sql/table_modifier.rb
23
- lib/dm-migrations/version.rb
24
- lib/spec/example/migration_example_group.rb
25
- lib/spec/matchers/migration_matchers.rb
26
- spec/integration/migration_runner_spec.rb
27
- spec/integration/migration_spec.rb
28
- spec/integration/sql_spec.rb
29
- spec/spec.opts
30
- spec/spec_helper.rb
31
- spec/unit/migration_spec.rb
32
- spec/unit/sql/column_spec.rb
33
- spec/unit/sql/postgresql_spec.rb
34
- spec/unit/sql/sqlite3_extensions_spec.rb
35
- spec/unit/sql/table_creator_spec.rb
36
- spec/unit/sql/table_modifier_spec.rb
37
- spec/unit/sql/table_spec.rb
38
- spec/unit/sql_spec.rb
39
- tasks/db.rb
40
- tasks/install.rb
41
- tasks/spec.rb
data/TODO DELETED
File without changes
@@ -1,5 +0,0 @@
1
- module DataMapper
2
- class Migration
3
- VERSION = '0.10.1'.freeze
4
- end
5
- end
data/tasks/db.rb DELETED
@@ -1,22 +0,0 @@
1
- namespace :db do
2
-
3
- # pass the relative path to the migrations directory by MIGRATION_DIR
4
- task :setup_migration_dir do
5
- unless defined?(MIGRATION_DIR)
6
- migration_dir = ENV["MIGRATION_DIR"] || File.join("db", "migrations")
7
- MIGRATION_DIR = File.expand_path(File.join(File.dirname(__FILE__), migration_dir))
8
- end
9
- FileUtils.mkdir_p MIGRATION_DIR
10
- end
11
-
12
- # set DIRECTION to migrate down
13
- desc "Run your system's migrations"
14
- task :migrate => [:setup_migration_dir] do
15
- require 'dm-migrations/migration_runner.rb'
16
- require File.expand_path(File.join(MIGRATION_DIR, "config.rb"))
17
-
18
- Dir[File.join(MIGRATION_DIR, "*.rb")].each { |file| require file }
19
-
20
- ENV["DIRECTION"] != "down" ? migrate_up! : migrate_down!
21
- end
22
- end
data/tasks/install.rb DELETED
@@ -1,13 +0,0 @@
1
- def sudo_gem(cmd)
2
- sh "#{SUDO} #{RUBY} -S gem #{cmd}", :verbose => false
3
- end
4
-
5
- desc "Install #{GEM_NAME} #{GEM_VERSION}"
6
- task :install => [ :package ] do
7
- sudo_gem "install pkg/#{GEM_NAME}-#{GEM_VERSION} --no-update-sources"
8
- end
9
-
10
- desc "Uninstall #{GEM_NAME} #{GEM_VERSION}"
11
- task :uninstall => [ :clobber ] do
12
- sudo_gem "uninstall #{GEM_NAME} -v#{GEM_VERSION} -Ix"
13
- end
data/tasks/spec.rb DELETED
@@ -1,25 +0,0 @@
1
- begin
2
- require 'spec/rake/spectask'
3
-
4
- task :default => [ :spec ]
5
-
6
- desc 'Run specifications'
7
- Spec::Rake::SpecTask.new(:spec) do |t|
8
- t.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
9
- t.libs << 'lib' << 'spec' # needed for CI rake spec task, duplicated in spec_helper
10
-
11
- begin
12
- require 'rcov'
13
- t.rcov = JRUBY ? false : (ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true)
14
- t.rcov_opts << '--exclude' << 'spec'
15
- t.rcov_opts << '--text-summary'
16
- t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
17
- rescue LoadError
18
- # rcov not installed
19
- rescue SyntaxError
20
- # rcov syntax invalid
21
- end
22
- end
23
- rescue LoadError
24
- # rspec not installed
25
- end