pk-merb_sequel 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +31 -12
- data/Rakefile +3 -3
- data/lib/merb_sequel.rb +20 -3
- metadata +6 -28
data/README.rdoc
CHANGED
@@ -7,44 +7,63 @@ This is fork of the code in the official merb-plugins
|
|
7
7
|
and Gem to allow faster and more independent release cycle to keep up with the
|
8
8
|
Sequel monthly releases.
|
9
9
|
|
10
|
-
Plug-in
|
11
|
-
higher including 2.x.x and
|
10
|
+
Plug-in is compatible with Merb 0.9.9 and higher and Sequel 1.4.0 and
|
11
|
+
higher including 2.x.x and <b>3.x.x</b>.
|
12
12
|
|
13
13
|
<b>Any issues please report to http://github.com/pk/merb_sequel/issues</b>.
|
14
14
|
|
15
15
|
|
16
16
|
== Install
|
17
|
+
Since version 1.0.6 I've moved gem hosting to Gemcutter. So now you need
|
18
|
+
to install gem with:
|
17
19
|
|
18
|
-
|
20
|
+
gem install pk-merb_sequel --source http://gemcutter.org
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
For versions <= 1.0.5 I used GitHub:
|
23
|
+
|
24
|
+
gem install pk-merb_sequel --source http://gems.github.com
|
25
|
+
|
26
|
+
|
27
|
+
=== Merb < 1.1
|
28
|
+
Add pk-merb_sequel as a dependency to your <b>config/dependencies.rb</b>:
|
29
|
+
|
30
|
+
dependency 'pk-merb_sequel', :require_as => 'merb_sequel'
|
23
31
|
|
24
|
-
<b>Because of Merb ORM plugin loading mechanism you neeed to change init.rb</b>:
|
32
|
+
<b>Because of Merb < 1.1 ORM plugin loading mechanism you neeed to change init.rb</b>:
|
25
33
|
|
26
|
-
|
34
|
+
use_orm :sequel
|
27
35
|
|
28
36
|
to
|
29
37
|
|
30
|
-
|
38
|
+
Merb.orm = :sequel
|
31
39
|
|
32
40
|
If you don't do this Merb will complain that there is no merb_sequel gem also
|
33
41
|
if you have merb_sequel installed it will load your system wide gem instead of
|
34
42
|
the pk-merb_sequel gem.
|
35
43
|
|
36
44
|
|
45
|
+
=== Merb >= 1.1, add it as a dependency to your <b>Gemfile</b>:
|
46
|
+
|
47
|
+
gem 'pk-merb_sequel', :require_as => 'merb_sequel'
|
48
|
+
|
49
|
+
Add Sequel as you ORM of choice to init.rb:
|
50
|
+
|
51
|
+
use_orm :sequel
|
52
|
+
|
53
|
+
|
37
54
|
== Compatibility
|
38
55
|
|
39
56
|
===Ruby 1.8.7:
|
40
57
|
Sequel 2.11.0:: All pass
|
41
58
|
Sequel 2.12.0:: All pass
|
42
59
|
Sequel 3.0.0:: All pass
|
60
|
+
Sequel 3.5.0:: All pass
|
43
61
|
|
44
62
|
===Ruby 1.9.1:
|
45
63
|
Sequel 2.11.0:: All pass except session spec failing due to Marshall issues.
|
46
64
|
Sequel 2.12.0:: All pass except session spec failing due to Marshall issues.
|
47
65
|
Sequel 3.0.0:: All pass except session spec failing due to Marshall issues.
|
66
|
+
Sequel 3.5.0:: All pass except session spec failing due to Marshall issues.
|
48
67
|
|
49
68
|
|
50
69
|
== RSpec transactional examples
|
@@ -65,13 +84,13 @@ Merb Sequel plug-in uses config/database.yml for connection configuration.
|
|
65
84
|
Options are:
|
66
85
|
|
67
86
|
* adapter. :sqlite is assumed by default.
|
68
|
-
* database, default is "hey_dude_configure_your_database".
|
69
|
-
either :memory: or file path for SQLite.
|
87
|
+
* database, default is "hey_dude_configure_your_database". In case of SQLite this
|
88
|
+
should be either :memory: or file path for SQLite.
|
70
89
|
* db_type: default is nil. Use "mssql" to connect to MSSQL using ODBC.
|
71
90
|
* encoding or charset, default is utf8.
|
72
91
|
* host. localhost is assumed by default.
|
73
92
|
* logger default is Merb.logger
|
74
|
-
* password. WARNING: default password is an empty string
|
93
|
+
* password. <b>WARNING: default password is an empty string</b>.
|
75
94
|
* socket Use socket to connect to DB.
|
76
95
|
* username or user, default is an empty string
|
77
96
|
|
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require "spec/rake/spectask"
|
|
7
7
|
##############################################################################
|
8
8
|
# Package && release
|
9
9
|
##############################################################################
|
10
|
-
RUBY_FORGE_PROJECT = "merb_sequel"
|
10
|
+
RUBY_FORGE_PROJECT = "pk-merb_sequel"
|
11
11
|
PROJECT_URL = "http://github.com/pk/merb_sequel"
|
12
12
|
PROJECT_SUMMARY = "Merb plugin that provides support for Sequel and Sequel::Model"
|
13
13
|
PROJECT_DESCRIPTION = PROJECT_SUMMARY
|
@@ -15,9 +15,9 @@ PROJECT_DESCRIPTION = PROJECT_SUMMARY
|
|
15
15
|
GEM_AUTHOR = "Wayne E. Seguin, Lance Carlson, Lori Holden, Pavel Kunc"
|
16
16
|
GEM_EMAIL = "wayneeseguin@gmail.com, lancecarlson@gmail.com, email@loriholden.com, pavel.kunc@gmail.com"
|
17
17
|
|
18
|
-
GEM_NAME = "merb_sequel"
|
18
|
+
GEM_NAME = "pk-merb_sequel"
|
19
19
|
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
20
|
-
GEM_VERSION = "1.0.
|
20
|
+
GEM_VERSION = "1.0.6" + PKG_BUILD
|
21
21
|
|
22
22
|
RELEASE_NAME = "REL #{GEM_VERSION}"
|
23
23
|
|
data/lib/merb_sequel.rb
CHANGED
@@ -24,11 +24,28 @@ if defined?(Merb::Plugins)
|
|
24
24
|
end
|
25
25
|
|
26
26
|
end
|
27
|
+
|
28
|
+
# Disconnects from DB before reaping workers
|
29
|
+
#
|
30
|
+
# We must disconnect from the DB before the worker process dies to be nice
|
31
|
+
# and not cause IO blocking.
|
32
|
+
#
|
33
|
+
# Disconnect only when fork_for_class_relaod is set and we're not in
|
34
|
+
# testing mode.
|
35
|
+
Merb::BootLoader.before_worker_shutdown do
|
36
|
+
if Merb::Config[:fork_for_class_load] && !Merb.testing?
|
37
|
+
Merb.logger.info "Disconnecting database connection before worker shutdown..."
|
38
|
+
dbs = []
|
39
|
+
::Sequel::DATABASES.each { |db| db.disconnect; dbs << db }
|
40
|
+
# Cleanup disconnected databases so they can be GCed
|
41
|
+
dbs.each {|db| ::Sequel::DATABASES.delete(db) }
|
42
|
+
end
|
43
|
+
end
|
27
44
|
|
28
45
|
# Disconnects from DB before starting reloading classes
|
29
46
|
#
|
30
|
-
#
|
31
|
-
#
|
47
|
+
# We must disconnect from the DB before the worker process dies to be nice
|
48
|
+
# and not cause IO blocking.
|
32
49
|
#
|
33
50
|
# Disconnect only when fork_for_class_relaod is set and we're not in
|
34
51
|
# testing mode.
|
@@ -37,7 +54,7 @@ if defined?(Merb::Plugins)
|
|
37
54
|
|
38
55
|
def self.run
|
39
56
|
if Merb::Config[:fork_for_class_load] && !Merb.testing?
|
40
|
-
Merb.logger.
|
57
|
+
Merb.logger.info "Disconnecting database connection before starting transaction."
|
41
58
|
::Sequel::DATABASES.each { |db| db.disconnect }
|
42
59
|
end
|
43
60
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pk-merb_sequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wayne E. Seguin, Lance Carlson, Lori Holden, Pavel Kunc
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-04 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -48,51 +48,29 @@ files:
|
|
48
48
|
- Rakefile
|
49
49
|
- TODO
|
50
50
|
- Generators
|
51
|
-
- lib/generators
|
52
51
|
- lib/generators/migration.rb
|
53
52
|
- lib/generators/model.rb
|
54
53
|
- lib/generators/resource_controller.rb
|
55
54
|
- lib/generators/session_migration.rb
|
56
|
-
- lib/generators/templates
|
57
|
-
- lib/generators/templates/migration
|
58
|
-
- lib/generators/templates/migration/schema
|
59
|
-
- lib/generators/templates/migration/schema/migrations
|
60
55
|
- lib/generators/templates/migration/schema/migrations/%file_name%.rb
|
61
|
-
- lib/generators/templates/model
|
62
|
-
- lib/generators/templates/model/app
|
63
|
-
- lib/generators/templates/model/app/models
|
64
56
|
- lib/generators/templates/model/app/models/%file_name%.rb
|
65
|
-
- lib/generators/templates/resource_controller
|
66
|
-
- lib/generators/templates/resource_controller/app
|
67
|
-
- lib/generators/templates/resource_controller/app/controllers
|
68
57
|
- lib/generators/templates/resource_controller/app/controllers/%file_name%.rb
|
69
|
-
- lib/generators/templates/resource_controller/app/views
|
70
|
-
- lib/generators/templates/resource_controller/app/views/%file_name%
|
71
58
|
- lib/generators/templates/resource_controller/app/views/%file_name%/edit.html.erb
|
72
59
|
- lib/generators/templates/resource_controller/app/views/%file_name%/index.html.erb
|
73
60
|
- lib/generators/templates/resource_controller/app/views/%file_name%/new.html.erb
|
74
61
|
- lib/generators/templates/resource_controller/app/views/%file_name%/show.html.erb
|
75
|
-
- lib/generators/templates/session_migration
|
76
|
-
- lib/generators/templates/session_migration/schema
|
77
|
-
- lib/generators/templates/session_migration/schema/migrations
|
78
62
|
- lib/generators/templates/session_migration/schema/migrations/%version%_sessions.rb
|
79
|
-
- lib/merb
|
80
|
-
- lib/merb/orms
|
81
|
-
- lib/merb/orms/sequel
|
82
63
|
- lib/merb/orms/sequel/connection.rb
|
83
64
|
- lib/merb/orms/sequel/database.yml.sample
|
84
|
-
- lib/merb/session
|
85
65
|
- lib/merb/session/sequel_session.rb
|
86
|
-
- lib/merb_sequel
|
87
66
|
- lib/merb_sequel/merbtasks.rb
|
88
|
-
- lib/merb_sequel/rspec
|
89
67
|
- lib/merb_sequel/rspec/sequel.rb
|
90
68
|
- lib/merb_sequel.rb
|
91
|
-
- lib/sequel_ext
|
92
69
|
- lib/sequel_ext/model.rb
|
93
70
|
has_rdoc: true
|
94
71
|
homepage: http://github.com/pk/merb_sequel
|
95
|
-
licenses:
|
72
|
+
licenses: []
|
73
|
+
|
96
74
|
post_install_message:
|
97
75
|
rdoc_options: []
|
98
76
|
|
@@ -112,10 +90,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
90
|
version:
|
113
91
|
requirements: []
|
114
92
|
|
115
|
-
rubyforge_project: merb_sequel
|
93
|
+
rubyforge_project: pk-merb_sequel
|
116
94
|
rubygems_version: 1.3.5
|
117
95
|
signing_key:
|
118
|
-
specification_version:
|
96
|
+
specification_version: 3
|
119
97
|
summary: Merb plugin that provides support for Sequel and Sequel::Model
|
120
98
|
test_files: []
|
121
99
|
|