talentbox-sequel-rails 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- talentbox-sequel-rails (0.3.1)
4
+ talentbox-sequel-rails (0.3.2)
5
5
  rails (~> 3.2.0)
6
6
  sequel (~> 3.28)
7
7
 
@@ -9,34 +9,34 @@ GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
11
  ZenTest (4.6.2)
12
- actionmailer (3.2.1)
13
- actionpack (= 3.2.1)
14
- mail (~> 2.4.0)
15
- actionpack (3.2.1)
16
- activemodel (= 3.2.1)
17
- activesupport (= 3.2.1)
12
+ actionmailer (3.2.3)
13
+ actionpack (= 3.2.3)
14
+ mail (~> 2.4.4)
15
+ actionpack (3.2.3)
16
+ activemodel (= 3.2.3)
17
+ activesupport (= 3.2.3)
18
18
  builder (~> 3.0.0)
19
19
  erubis (~> 2.7.0)
20
20
  journey (~> 1.0.1)
21
21
  rack (~> 1.4.0)
22
- rack-cache (~> 1.1)
22
+ rack-cache (~> 1.2)
23
23
  rack-test (~> 0.6.1)
24
24
  sprockets (~> 2.1.2)
25
- activemodel (3.2.1)
26
- activesupport (= 3.2.1)
25
+ activemodel (3.2.3)
26
+ activesupport (= 3.2.3)
27
27
  builder (~> 3.0.0)
28
- activerecord (3.2.1)
29
- activemodel (= 3.2.1)
30
- activesupport (= 3.2.1)
31
- arel (~> 3.0.0)
28
+ activerecord (3.2.3)
29
+ activemodel (= 3.2.3)
30
+ activesupport (= 3.2.3)
31
+ arel (~> 3.0.2)
32
32
  tzinfo (~> 0.3.29)
33
- activeresource (3.2.1)
34
- activemodel (= 3.2.1)
35
- activesupport (= 3.2.1)
36
- activesupport (3.2.1)
33
+ activeresource (3.2.3)
34
+ activemodel (= 3.2.3)
35
+ activesupport (= 3.2.3)
36
+ activesupport (3.2.3)
37
37
  i18n (~> 0.6)
38
38
  multi_json (~> 1.0)
39
- arel (3.0.0)
39
+ arel (3.0.2)
40
40
  autotest (4.4.6)
41
41
  ZenTest (>= 4.4.1)
42
42
  builder (3.0.0)
@@ -44,33 +44,33 @@ GEM
44
44
  erubis (2.7.0)
45
45
  hike (1.2.1)
46
46
  i18n (0.6.0)
47
- journey (1.0.1)
48
- json (1.6.5)
49
- mail (2.4.1)
47
+ journey (1.0.3)
48
+ json (1.6.6)
49
+ mail (2.4.4)
50
50
  i18n (>= 0.4.0)
51
51
  mime-types (~> 1.16)
52
52
  treetop (~> 1.4.8)
53
- mime-types (1.17.2)
54
- multi_json (1.0.4)
53
+ mime-types (1.18)
54
+ multi_json (1.3.2)
55
55
  polyglot (0.3.3)
56
56
  rack (1.4.1)
57
- rack-cache (1.1)
57
+ rack-cache (1.2)
58
58
  rack (>= 0.4)
59
59
  rack-ssl (1.3.2)
60
60
  rack
61
61
  rack-test (0.6.1)
62
62
  rack (>= 1.0)
63
- rails (3.2.1)
64
- actionmailer (= 3.2.1)
65
- actionpack (= 3.2.1)
66
- activerecord (= 3.2.1)
67
- activeresource (= 3.2.1)
68
- activesupport (= 3.2.1)
63
+ rails (3.2.3)
64
+ actionmailer (= 3.2.3)
65
+ actionpack (= 3.2.3)
66
+ activerecord (= 3.2.3)
67
+ activeresource (= 3.2.3)
68
+ activesupport (= 3.2.3)
69
69
  bundler (~> 1.0)
70
- railties (= 3.2.1)
71
- railties (3.2.1)
72
- actionpack (= 3.2.1)
73
- activesupport (= 3.2.1)
70
+ railties (= 3.2.3)
71
+ railties (3.2.3)
72
+ actionpack (= 3.2.3)
73
+ activesupport (= 3.2.3)
74
74
  rack-ssl (~> 1.3.2)
75
75
  rake (>= 0.8.7)
76
76
  rdoc (~> 3.4)
@@ -87,7 +87,7 @@ GEM
87
87
  rspec-expectations (2.7.0)
88
88
  diff-lcs (~> 1.1.2)
89
89
  rspec-mocks (2.7.0)
90
- sequel (3.32.0)
90
+ sequel (3.34.1)
91
91
  sprockets (2.1.2)
92
92
  hike (~> 1.2)
93
93
  rack (~> 1.0)
@@ -97,7 +97,7 @@ GEM
97
97
  treetop (1.4.10)
98
98
  polyglot
99
99
  polyglot (>= 0.3.1)
100
- tzinfo (0.3.31)
100
+ tzinfo (0.3.33)
101
101
  yard (0.7.3)
102
102
 
103
103
  PLATFORMS
@@ -1,5 +1,11 @@
1
+ == 0.3.2
2
+ * Ignore environments without `database` key (like ActiveRecord do it), to allow
3
+ shared configurations in `database.yml`.
4
+ * Fix db creation commands to let the `system` method escape the arguments
5
+ * Fix error when using `mysql2` gem
6
+
1
7
  == 0.3.1
2
- * Make `db:dump` Rake task depends on Rails `environment` task (Gabor Ratky)
8
+ * Make `db:schema:dump` Rake task depends on Rails `environment` task (Gabor Ratky)
3
9
 
4
10
  == 0.3.0
5
11
  * Update dependency to Rails (~> 3.2.0)
data/README.rdoc CHANGED
@@ -1,16 +1,18 @@
1
1
  = sequel-rails
2
2
 
3
- This gem provides the railtie that allows {sequel}[http://github.com/jeremyevans/sequel] to hook into {rails3}[http://github.com/rails/rails] and thus behave like a rails framework component. Just like activerecord does in rails, {sequel-rails}[http://github.com/brasten/sequel-rails] uses the railtie API to hook into rails. The two are actually hooked into rails almost identically.
3
+ This gem provides the railtie that allows {sequel}[http://github.com/jeremyevans/sequel] to hook into {rails3}[http://github.com/rails/rails] and thus behave like a rails framework component. Just like activerecord does in rails, {sequel-rails}[http://github.com/talentbox/sequel-rails] uses the railtie API to hook into rails. The two are actually hooked into rails almost identically.
4
4
 
5
5
  The code for this gem was initially taken from the excellent {dm-rails}[http://github.com/datamapper/dm-rails] project.
6
6
 
7
+ This is a fork of {brasten}[https://github.com/brasten]'s {sequel-rails}[https://github.com/brasten/sequel-rails] that has been updated to support newer versions of rails.
8
+
7
9
  == Using sequel-rails
8
10
 
9
11
  Using sequel with rails3 requires a couple minor changes.
10
12
 
11
13
  First, add the following to your Gemfile:
12
14
 
13
- gem 'sequel-rails'
15
+ gem 'talentbox-sequel-rails'
14
16
 
15
17
  ... be sure to run "bundle install" if needed!
16
18
 
@@ -79,8 +81,14 @@ The {dm-rails}[http://github.com/datamapper/dm-rails] team wrote most of this co
79
81
 
80
82
  == The sequel-rails team
81
83
 
84
+ {Original project}[https://github.com/brasten/sequel-rails]:
85
+
82
86
  * Brasten Sager (brasten)
83
87
 
88
+ This fork:
89
+
90
+ * Jonathan Tron (JonathanTron)
91
+
84
92
  == Copyright
85
93
 
86
94
  Copyright (c) 2010 The sequel-rails team. See {LICENSE}[http://github.com/brasten/sequel-rails/blob/master/LICENSE] for details.
@@ -26,7 +26,7 @@ module Rails
26
26
 
27
27
  def self.new(config)
28
28
  config = Rails::Sequel.configuration.environments[config.to_s] unless config.kind_of?(Hash)
29
-
29
+
30
30
  klass = lookup_class(config['adapter'])
31
31
  if klass.equal?(self)
32
32
  super(config)
@@ -40,6 +40,7 @@ module Rails
40
40
 
41
41
  def with_local_repositories
42
42
  Rails::Sequel.configuration.environments.each_value do |config|
43
+ next if config['database'].blank?
43
44
  if config['host'].blank? || %w[ 127.0.0.1 localhost ].include?(config['host'])
44
45
  yield(config)
45
46
  else
@@ -98,7 +99,7 @@ module Rails
98
99
  def owner
99
100
  @owner ||= config['owner'] || ''
100
101
  end
101
-
102
+
102
103
  def charset
103
104
  @charset ||= config['charset'] || ENV['CHARSET'] || 'utf8'
104
105
  end
@@ -138,13 +139,12 @@ module Rails
138
139
  private
139
140
 
140
141
  def execute(statement)
141
- commands = 'mysql '
142
- commands << "--user=#{username} " unless username.blank?
143
- commands << "--password=#{password} " unless password.blank?
144
- commands << "--host=#{host} " unless host.blank?
145
- commands << '-e '
146
- commands << statement
147
- system(commands)
142
+ commands = ["mysql"]
143
+ commands << "--user" << username unless username.blank?
144
+ commands << "--password" << password unless password.blank?
145
+ commands << "--host" << host unless host.blank?
146
+ commands << "-e" << statement
147
+ system(*commands)
148
148
  end
149
149
 
150
150
  def collation
@@ -152,49 +152,46 @@ module Rails
152
152
  end
153
153
 
154
154
  end
155
+ class Mysql2 < Mysql
156
+ end
155
157
 
156
158
  class Postgres < Storage
157
159
  def _create
158
160
  ENV["PGPASSWORD"] = password unless password.blank?
159
- commands = "createdb --encoding=#{charset} "
160
- commands << "--username=#{username} " unless username.blank?
161
- commands << "--owner=#{owner} " unless owner.blank?
162
- commands << "--port=#{port} " unless port.blank?
163
- commands << "--host=#{host} " unless host.blank?
161
+ commands = ["createdb", "--encoding", charset]
162
+ commands << "--username" << username unless username.blank?
163
+ commands << "--owner" << owner unless owner.blank?
164
+ commands << "--port" << port unless port.blank?
165
+ commands << "--host" << host unless host.blank?
164
166
  commands << database
165
- res = system(commands)
167
+ res = system(*commands)
166
168
  ENV["PGPASSWORD"] = nil
167
169
  res
168
170
  end
169
171
 
170
172
  def _drop
171
- system(
172
- 'dropdb',
173
- '-U',
174
- username,
175
- database
176
- )
173
+ system("dropdb", "-U", username, database)
177
174
  end
178
175
  end
179
-
176
+
180
177
  class Jdbc < Storage
181
-
178
+
182
179
  def _is_mysql?
183
180
  database.match(/^jdbc:mysql/)
184
181
  end
185
-
182
+
186
183
  def _root_url
187
184
  database.scan /^jdbc:mysql:\/\/\w*:?\d*/
188
185
  end
189
-
186
+
190
187
  def db_name
191
188
  database.scan(/^jdbc:mysql:\/\/\w+:?\d*\/(\w+)/).flatten.first
192
189
  end
193
-
190
+
194
191
  def _params
195
192
  database.scan /\?.*$/
196
193
  end
197
-
194
+
198
195
  def _create
199
196
  if _is_mysql?
200
197
  ::Sequel.connect("#{_root_url}#{_params}") do |db|
@@ -210,16 +207,16 @@ module Rails
210
207
  end
211
208
  end
212
209
  end
213
-
210
+
214
211
  private
215
-
212
+
216
213
  def collation
217
214
  @collation ||= config['collation'] || ENV['COLLATION'] || 'utf8_unicode_ci'
218
215
  end
219
-
220
-
216
+
217
+
221
218
  end
222
-
219
+
223
220
  end
224
221
  end
225
222
  end
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Sequel
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talentbox-sequel-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-02-17 00:00:00.000000000 Z
13
+ date: 2012-04-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sequel
17
- requirement: &2153959840 !ruby/object:Gem::Requirement
17
+ requirement: &2166376760 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '3.28'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2153959840
25
+ version_requirements: *2166376760
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rails
28
- requirement: &2153959320 !ruby/object:Gem::Requirement
28
+ requirement: &2166392200 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: 3.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2153959320
36
+ version_requirements: *2166392200
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rake
39
- requirement: &2153958840 !ruby/object:Gem::Requirement
39
+ requirement: &2166391160 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 0.8.7
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2153958840
47
+ version_requirements: *2166391160
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: yard
50
- requirement: &2153958360 !ruby/object:Gem::Requirement
50
+ requirement: &2166390060 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0.5'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2153958360
58
+ version_requirements: *2166390060
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rspec
61
- requirement: &2153957880 !ruby/object:Gem::Requirement
61
+ requirement: &2166389020 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ~>
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: 2.7.0
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2153957880
69
+ version_requirements: *2166389020
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: autotest
72
- requirement: &2153957400 !ruby/object:Gem::Requirement
72
+ requirement: &2166388360 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ~>
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: 4.4.6
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *2153957400
80
+ version_requirements: *2166388360
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rcov
83
- requirement: &2153956740 !ruby/object:Gem::Requirement
83
+ requirement: &2166387540 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ~>
@@ -88,7 +88,7 @@ dependencies:
88
88
  version: 0.9.11
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *2153956740
91
+ version_requirements: *2166387540
92
92
  description: Integrate Sequel with Rails 3
93
93
  email:
94
94
  - brasten@gmail.com
@@ -101,9 +101,9 @@ extra_rdoc_files:
101
101
  files:
102
102
  - .document
103
103
  - .gitignore
104
- - CHANGELOG
105
104
  - Gemfile
106
105
  - Gemfile.lock
106
+ - History.md
107
107
  - LICENSE
108
108
  - README.rdoc
109
109
  - Rakefile
@@ -129,10 +129,10 @@ files:
129
129
  - lib/sequel-rails/setup.rb
130
130
  - lib/sequel-rails/storage.rb
131
131
  - lib/sequel-rails/version.rb
132
- - sequel-rails.gemspec
133
132
  - spec/rcov.opts
134
133
  - spec/spec.opts
135
134
  - spec/spec_helper.rb
135
+ - talentbox-sequel-rails.gemspec
136
136
  - tasks/ci.rake
137
137
  - tasks/clean.rake
138
138
  - tasks/metrics.rake
@@ -154,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  segments:
156
156
  - 0
157
- hash: -458416955551314614
157
+ hash: -3768588127880768772
158
158
  required_rubygems_version: !ruby/object:Gem::Requirement
159
159
  none: false
160
160
  requirements:
@@ -163,10 +163,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  segments:
165
165
  - 0
166
- hash: -458416955551314614
166
+ hash: -3768588127880768772
167
167
  requirements: []
168
168
  rubyforge_project:
169
- rubygems_version: 1.8.10
169
+ rubygems_version: 1.8.15
170
170
  signing_key:
171
171
  specification_version: 3
172
172
  summary: Use Sequel with Rails 3