sequel-rails 0.4.0.pre1 → 0.4.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,3 +1,12 @@
1
+ 0.4.0.pre2
2
+ ==========
3
+
4
+ * Remove `rake db:forward` and `rake db:rollback` as it makes not much sense
5
+ when using the TimeStampMigration which is how this gem generates migrations
6
+ * Ensure rake tasks returns appropriate code on errors
7
+ * Ensure PostgreSQL adapter passes the right options to both create and drop
8
+ database (Sascha Cunz)
9
+
1
10
  0.4.0.pre1
2
11
  ==========
3
12
 
data/README.md CHANGED
@@ -66,14 +66,12 @@ rake db:create:all # Create all the local databases defined i
66
66
  rake db:drop[env] # Create the database defined in config/database.yml for the current Rails.env
67
67
  rake db:drop:all # Drops all the local databases defined in config/database.yml
68
68
  rake db:force_close_open_connections # Forcibly close any open connections to the test database
69
- rake db:forward # Pushes the schema to the next version. Specify the number of steps with STEP=n
70
69
  rake db:migrate # Migrate the database to the latest version
71
70
  rake db:migrate:down # Runs the "down" for a given migration VERSION.
72
71
  rake db:migrate:redo # Rollbacks the database one migration and re migrate up.
73
72
  rake db:migrate:reset # Resets your database using your migrations for the current environment
74
73
  rake db:migrate:up # Runs the "up" for a given migration VERSION.
75
74
  rake db:reset # Drops and recreates the database from db/schema.rb for the current environment and loads the seeds.
76
- rake db:rollback # Rollbacks the database one migration and re migrate up. If you want to rollback more than one step, define STEP=x. Target specific version with VERSION=x.
77
75
  rake db:schema:dump # Create a db/schema.rb file that can be portably used against any DB supported by Sequel
78
76
  rake db:schema:load # Load a schema.rb file into the database
79
77
  rake db:seed # Load the seed data from db/seeds.rb
@@ -115,6 +113,7 @@ Improvements has been made by those awesome contributors:
115
113
  * Joshua Hansen (binarypaladin)
116
114
  * Arron Washington (radicaled)
117
115
  * Thiago Pradi (tchandy)
116
+ * Sascha Cunz (scunz)
118
117
 
119
118
  Credits
120
119
  =======
@@ -44,7 +44,9 @@ namespace :db do
44
44
  namespace :create do
45
45
  desc 'Create all the local databases defined in config/database.yml'
46
46
  task :all => :environment do
47
- SequelRails::Storage.create_all
47
+ unless SequelRails::Storage.create_all
48
+ abort "Could not create all databases."
49
+ end
48
50
  end
49
51
  end
50
52
 
@@ -52,13 +54,17 @@ namespace :db do
52
54
  task :create, [:env] => :environment do |t, args|
53
55
  args.with_defaults(:env => Rails.env)
54
56
 
55
- SequelRails::Storage.adapter_for(args.env).create
57
+ unless SequelRails::Storage.adapter_for(args.env).create
58
+ abort "Could not create database for #{args.env}."
59
+ end
56
60
  end
57
61
 
58
62
  namespace :drop do
59
63
  desc 'Drops all the local databases defined in config/database.yml'
60
64
  task :all => :environment do
61
- SequelRails::Storage.drop_all
65
+ unless SequelRails::Storage.drop_all
66
+ abort "Could not drop all databases."
67
+ end
62
68
  end
63
69
  end
64
70
 
@@ -66,7 +72,9 @@ namespace :db do
66
72
  task :drop, [:env] => :environment do |t, args|
67
73
  args.with_defaults(:env => Rails.env)
68
74
 
69
- SequelRails::Storage.adapter_for(args.env).drop
75
+ unless SequelRails::Storage.adapter_for(args.env).drop
76
+ abort "Could not drop database for #{args.env}."
77
+ end
70
78
  end
71
79
 
72
80
  namespace :migrate do
@@ -85,7 +93,6 @@ namespace :db do
85
93
  end
86
94
  end
87
95
 
88
-
89
96
  desc 'Resets your database using your migrations for the current environment'
90
97
  task :reset => ["db:drop", "db:create", "db:migrate"]
91
98
 
@@ -112,20 +119,6 @@ namespace :db do
112
119
  Rake::Task["db:schema:dump"].invoke unless Rails.env.test?
113
120
  end
114
121
 
115
- desc 'Rolls the schema back to the previous version. Specify the number of steps with STEP=n'
116
- task :rollback => "migrate:load" do
117
- step = ENV['STEP'] ? ENV['STEP'].to_i : 1
118
- Sequel::Migrator.rollback('db/migrate/', step)
119
- Rake::Task["db:schema:dump"].invoke unless Rails.env.test?
120
- end
121
-
122
- desc 'Pushes the schema to the next version. Specify the number of steps with STEP=n'
123
- task :forward => "migrate:load" do
124
- step = ENV['STEP'] ? ENV['STEP'].to_i : 1
125
- Sequel::Migrator.forward('db/migrate/', step)
126
- Rake::Task["db:schema:dump"].invoke unless Rails.env.test?
127
- end
128
-
129
122
  desc 'Load the seed data from db/seeds.rb'
130
123
  task :seed => :abort_if_pending_migrations do
131
124
  seed_file = File.join(Rails.root, 'db', 'seeds.rb')
@@ -9,14 +9,16 @@ module SequelRails
9
9
  end
10
10
 
11
11
  def create
12
- _create
13
- puts "[sequel] Created database '#{database}'"
12
+ res = _create
13
+ puts "[sequel] Created database '#{database}'" if res
14
+ res
14
15
  end
15
16
 
16
17
  def drop
17
18
  ::Sequel::Model.db.disconnect
18
- _drop
19
- puts "[sequel] Dropped database '#{database}'"
19
+ res = _drop
20
+ puts "[sequel] Dropped database '#{database}'" if res
21
+ res
20
22
  end
21
23
 
22
24
  def database
@@ -6,16 +6,24 @@ module SequelRails
6
6
  commands = ["createdb", "--encoding", charset]
7
7
  commands << "--username" << username unless username.blank?
8
8
  commands << "--owner" << owner unless owner.blank?
9
- commands << "--port" << port unless port.blank?
9
+ commands << "--port" << port.to_s unless port.blank?
10
10
  commands << "--host" << host unless host.blank?
11
11
  commands << database
12
12
  res = system(*commands)
13
- ENV["PGPASSWORD"] = nil
13
+ ENV["PGPASSWORD"] = nil unless password.blank?
14
14
  res
15
15
  end
16
16
 
17
17
  def _drop
18
- system("dropdb", "-U", username, database)
18
+ ENV["PGPASSWORD"] = password unless password.blank?
19
+ commands = ["dropdb"]
20
+ commands << "-U" << username unless username.blank?
21
+ commands << "--port" << port.to_s unless port.blank?
22
+ commands << "--host" << host unless host.blank?
23
+ commands << database
24
+ res = system(*commands)
25
+ ENV["PGPASSWORD"] = nil unless password.blank?
26
+ res
19
27
  end
20
28
  end
21
29
  end
@@ -1,3 +1,3 @@
1
1
  module SequelRails
2
- VERSION = "0.4.0.pre1"
2
+ VERSION = "0.4.0.pre2"
3
3
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.pre1
5
4
  prerelease: 6
5
+ version: 0.4.0.pre2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brasten Sager (brasten)
@@ -10,104 +10,104 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-01-07 00:00:00.000000000 Z
13
+ date: 2013-01-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
+ version_requirements: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '3.28'
21
+ none: false
22
+ prerelease: false
16
23
  name: sequel
17
24
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
25
  requirements:
20
26
  - - ~>
21
27
  - !ruby/object:Gem::Version
22
28
  version: '3.28'
29
+ none: false
23
30
  type: :runtime
24
- prerelease: false
31
+ - !ruby/object:Gem::Dependency
25
32
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
33
  requirements:
28
34
  - - ~>
29
35
  - !ruby/object:Gem::Version
30
- version: '3.28'
31
- - !ruby/object:Gem::Dependency
36
+ version: 3.2.0
37
+ none: false
38
+ prerelease: false
32
39
  name: railties
33
40
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
41
  requirements:
36
42
  - - ~>
37
43
  - !ruby/object:Gem::Version
38
44
  version: 3.2.0
45
+ none: false
39
46
  type: :runtime
40
- prerelease: false
47
+ - !ruby/object:Gem::Dependency
41
48
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
49
  requirements:
44
- - - ~>
50
+ - - ! '>='
45
51
  - !ruby/object:Gem::Version
46
- version: 3.2.0
47
- - !ruby/object:Gem::Dependency
52
+ version: 0.8.7
53
+ none: false
54
+ prerelease: false
48
55
  name: rake
49
56
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
57
  requirements:
52
58
  - - ! '>='
53
59
  - !ruby/object:Gem::Version
54
60
  version: 0.8.7
61
+ none: false
55
62
  type: :development
56
- prerelease: false
63
+ - !ruby/object:Gem::Dependency
57
64
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
65
  requirements:
60
- - - ! '>='
66
+ - - ~>
61
67
  - !ruby/object:Gem::Version
62
- version: 0.8.7
63
- - !ruby/object:Gem::Dependency
68
+ version: 2.7.0
69
+ none: false
70
+ prerelease: false
64
71
  name: rspec
65
72
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
73
  requirements:
68
74
  - - ~>
69
75
  - !ruby/object:Gem::Version
70
76
  version: 2.7.0
77
+ none: false
71
78
  type: :development
72
- prerelease: false
79
+ - !ruby/object:Gem::Dependency
73
80
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
81
  requirements:
76
82
  - - ~>
77
83
  - !ruby/object:Gem::Version
78
- version: 2.7.0
79
- - !ruby/object:Gem::Dependency
84
+ version: 0.3.1
85
+ none: false
86
+ prerelease: false
80
87
  name: combustion
81
88
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
89
  requirements:
84
90
  - - ~>
85
91
  - !ruby/object:Gem::Version
86
92
  version: 0.3.1
93
+ none: false
87
94
  type: :development
88
- prerelease: false
95
+ - !ruby/object:Gem::Dependency
89
96
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
97
  requirements:
92
98
  - - ~>
93
99
  - !ruby/object:Gem::Version
94
- version: 0.3.1
95
- - !ruby/object:Gem::Dependency
100
+ version: 0.8.7
101
+ none: false
102
+ prerelease: false
96
103
  name: generator_spec
97
104
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
105
  requirements:
100
106
  - - ~>
101
107
  - !ruby/object:Gem::Version
102
108
  version: 0.8.7
103
- type: :development
104
- prerelease: false
105
- version_requirements: !ruby/object:Gem::Requirement
106
109
  none: false
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: 0.8.7
110
+ type: :development
111
111
  description: Integrate Sequel with Rails 3
112
112
  email:
113
113
  - brasten@gmail.com
@@ -176,20 +176,20 @@ rdoc_options:
176
176
  require_paths:
177
177
  - lib
178
178
  required_ruby_version: !ruby/object:Gem::Requirement
179
- none: false
180
179
  requirements:
181
180
  - - ! '>='
182
181
  - !ruby/object:Gem::Version
183
182
  version: '0'
184
183
  segments:
185
184
  - 0
186
- hash: -1196153117723463501
187
- required_rubygems_version: !ruby/object:Gem::Requirement
185
+ hash: -2469418507765572891
188
186
  none: false
187
+ required_rubygems_version: !ruby/object:Gem::Requirement
189
188
  requirements:
190
189
  - - ! '>'
191
190
  - !ruby/object:Gem::Version
192
191
  version: 1.3.1
192
+ none: false
193
193
  requirements: []
194
194
  rubyforge_project:
195
195
  rubygems_version: 1.8.24