sequel-rails 0.7.0 → 0.8.0
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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +13 -0
- data/.travis.yml +15 -43
- data/Gemfile +10 -10
- data/History.md +8 -0
- data/README.md +36 -0
- data/Rakefile +70 -2
- data/ci/rails-3.2.gemfile +15 -12
- data/ci/rails-4.0.gemfile +12 -12
- data/config.ru +1 -1
- data/lib/generators/sequel/migration/migration_generator.rb +10 -13
- data/lib/generators/sequel/model/model_generator.rb +11 -9
- data/lib/generators/sequel/observer/observer_generator.rb +6 -7
- data/lib/generators/sequel/session_migration/session_migration_generator.rb +30 -0
- data/lib/generators/sequel/session_migration/templates/migration.rb.erb +10 -0
- data/lib/generators/sequel.rb +9 -13
- data/lib/sequel-rails.rb +1 -1
- data/lib/sequel_rails/configuration.rb +29 -35
- data/lib/sequel_rails/migrations.rb +4 -4
- data/lib/sequel_rails/railtie.rb +16 -20
- data/lib/sequel_rails/railties/controller_runtime.rb +2 -8
- data/lib/sequel_rails/railties/database.rake +42 -46
- data/lib/sequel_rails/railties/i18n_support.rb +0 -2
- data/lib/sequel_rails/railties/legacy_model_config.rb +1 -1
- data/lib/sequel_rails/railties/log_subscriber.rb +5 -9
- data/lib/sequel_rails/sequel/database/active_support_notification.rb +4 -6
- data/lib/sequel_rails/sequel/plugins/rails_extensions.rb +2 -3
- data/lib/sequel_rails/session_store.rb +6 -42
- data/lib/sequel_rails/shellwords.rb +3 -3
- data/lib/sequel_rails/storage/abstract.rb +14 -16
- data/lib/sequel_rails/storage/jdbc.rb +8 -10
- data/lib/sequel_rails/storage/mysql.rb +13 -15
- data/lib/sequel_rails/storage/postgres.rb +42 -45
- data/lib/sequel_rails/storage/sqlite.rb +0 -1
- data/lib/sequel_rails/storage.rb +10 -10
- data/lib/sequel_rails/version.rb +1 -1
- data/lib/sequel_rails.rb +3 -3
- data/rubocop-todo.yml +24 -0
- data/sequel-rails.gemspec +21 -19
- data/spec/internal/Rakefile +2 -2
- data/spec/internal/config/initializers/session.rb +1 -1
- data/spec/internal/db/schema.rb.init +6 -0
- data/spec/lib/generators/sequel/migration_spec.rb +77 -77
- data/spec/lib/generators/sequel/session_migration_spec.rb +41 -0
- data/spec/lib/sequel_rails/configuration_spec.rb +161 -161
- data/spec/lib/sequel_rails/jdbc_spec.rb +4 -4
- data/spec/lib/sequel_rails/migrations_spec.rb +29 -29
- data/spec/lib/sequel_rails/railtie_spec.rb +31 -29
- data/spec/lib/sequel_rails/railties/database_rake_spec.rb +16 -15
- data/spec/lib/sequel_rails/railties/log_subscriber_spec.rb +6 -6
- data/spec/lib/sequel_rails/storage/mysql_spec.rb +31 -31
- data/spec/lib/sequel_rails/storage/postgres_spec.rb +67 -67
- data/spec/lib/sequel_rails/storage/sqlite_spec.rb +40 -40
- data/spec/lib/sequel_rails/storage_spec.rb +77 -89
- data/spec/spec_helper.rb +16 -10
- metadata +61 -28
- data/tasks/spec.rake +0 -81
@@ -1,6 +1,6 @@
|
|
1
1
|
module SequelRails
|
2
2
|
begin
|
3
|
-
require
|
3
|
+
require 'shellwords'
|
4
4
|
Shellwords = ::Shellwords
|
5
5
|
rescue LoadError
|
6
6
|
# Taken from shellwords.rb (Ruby 2.0.0p247)
|
@@ -16,13 +16,13 @@ module SequelRails
|
|
16
16
|
# Treat multibyte characters as is. It is caller's responsibility
|
17
17
|
# to encode the string in the right encoding for the shell
|
18
18
|
# environment.
|
19
|
-
str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/,
|
19
|
+
str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/, '\\\\\\1')
|
20
20
|
|
21
21
|
# A LF cannot be escaped with a backslash because a backslash + LF
|
22
22
|
# combo is regarded as line continuation and simply ignored.
|
23
23
|
str.gsub!(/\n/, "'\n'")
|
24
24
|
|
25
|
-
|
25
|
+
str
|
26
26
|
end
|
27
27
|
|
28
28
|
def self.shelljoin(array)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module SequelRails
|
2
2
|
module Storage
|
3
3
|
class Abstract
|
4
|
-
|
5
4
|
attr_reader :config
|
6
5
|
|
7
6
|
def initialize(config)
|
@@ -10,26 +9,26 @@ module SequelRails
|
|
10
9
|
|
11
10
|
def create
|
12
11
|
res = _create
|
13
|
-
|
12
|
+
warn "[sequel] Created database '#{database}'" if res
|
14
13
|
res
|
15
14
|
end
|
16
15
|
|
17
16
|
def drop
|
18
17
|
::Sequel::Model.db.disconnect
|
19
18
|
res = _drop
|
20
|
-
|
19
|
+
warn "[sequel] Dropped database '#{database}'" if res
|
21
20
|
res
|
22
21
|
end
|
23
22
|
|
24
23
|
def dump(filename)
|
25
24
|
res = _dump filename
|
26
|
-
|
25
|
+
warn "[sequel] Dumped structure of database '#{database}' to '#{filename}'" if res
|
27
26
|
res
|
28
27
|
end
|
29
28
|
|
30
29
|
def load(filename)
|
31
30
|
res = _load filename
|
32
|
-
|
31
|
+
warn "[sequel] Loaded structure of database '#{database}' from '#{filename}'" if res
|
33
32
|
res
|
34
33
|
end
|
35
34
|
|
@@ -39,42 +38,42 @@ module SequelRails
|
|
39
38
|
end
|
40
39
|
|
41
40
|
def database
|
42
|
-
@database ||= config[
|
41
|
+
@database ||= config['database'] || config['path']
|
43
42
|
end
|
44
43
|
|
45
44
|
def username
|
46
|
-
@username ||= config[
|
45
|
+
@username ||= config['username'] || config['user'] || ''
|
47
46
|
end
|
48
47
|
|
49
48
|
def password
|
50
|
-
@password ||= config[
|
49
|
+
@password ||= config['password'] || ''
|
51
50
|
end
|
52
51
|
|
53
52
|
def host
|
54
|
-
@host ||= config[
|
53
|
+
@host ||= config['host'] || ''
|
55
54
|
end
|
56
55
|
|
57
56
|
def port
|
58
|
-
@port ||= config[
|
57
|
+
@port ||= config['port'] || ''
|
59
58
|
end
|
60
59
|
|
61
60
|
def owner
|
62
|
-
@owner ||= config[
|
61
|
+
@owner ||= config['owner'] || ''
|
63
62
|
end
|
64
63
|
|
65
64
|
def charset
|
66
|
-
@charset ||= config[
|
65
|
+
@charset ||= config['charset'] || ENV['CHARSET'] || 'utf8'
|
67
66
|
end
|
68
67
|
|
69
68
|
def collation
|
70
|
-
@collation ||= config[
|
69
|
+
@collation ||= config['collation'] || ENV['COLLATION']
|
71
70
|
end
|
72
71
|
|
73
72
|
private
|
74
73
|
|
75
74
|
def add_option(commands, name, value)
|
76
75
|
if value.present?
|
77
|
-
separator = name[0,2]==
|
76
|
+
separator = name[0, 2] == '--' ? '=' : ' '
|
78
77
|
commands << "#{name}#{separator}#{value}"
|
79
78
|
end
|
80
79
|
end
|
@@ -87,13 +86,12 @@ module SequelRails
|
|
87
86
|
`#{escaped_command}`
|
88
87
|
|
89
88
|
# Evaluate command status as a boolean like `system` does.
|
90
|
-
|
89
|
+
$CHILD_STATUS.exitstatus == 0
|
91
90
|
end
|
92
91
|
|
93
92
|
def safe_exec(args)
|
94
93
|
exec SequelRails::Shellwords.join(Array(args))
|
95
94
|
end
|
96
|
-
|
97
95
|
end
|
98
96
|
end
|
99
97
|
end
|
@@ -1,21 +1,20 @@
|
|
1
1
|
module SequelRails
|
2
2
|
module Storage
|
3
3
|
class Jdbc < Abstract
|
4
|
-
|
5
4
|
def _is_mysql?
|
6
|
-
config['adapter'].
|
5
|
+
config['adapter'].start_with?('jdbc:mysql')
|
7
6
|
end
|
8
7
|
|
9
8
|
def _is_postgres?
|
10
|
-
config['adapter'].
|
9
|
+
config['adapter'].start_with?('jdbc:postgresql')
|
11
10
|
end
|
12
11
|
|
13
12
|
def _is_sqlite?
|
14
|
-
config['adapter'].
|
13
|
+
config['adapter'].start_with?('jdbc:sqlite')
|
15
14
|
end
|
16
15
|
|
17
16
|
def _root_url
|
18
|
-
config['url'].scan(
|
17
|
+
config['url'].scan(%r{^jdbc:mysql://[\w\.]*:?\d*}).first
|
19
18
|
end
|
20
19
|
|
21
20
|
def db_name
|
@@ -59,7 +58,7 @@ module SequelRails
|
|
59
58
|
adapter = ::SequelRails::Storage::Postgres.new(config)
|
60
59
|
adapter._dump(filename)
|
61
60
|
else
|
62
|
-
|
61
|
+
fail NotImplementedError
|
63
62
|
end
|
64
63
|
end
|
65
64
|
|
@@ -68,21 +67,20 @@ module SequelRails
|
|
68
67
|
adapter = ::SequelRails::Storage::Postgres.new(config)
|
69
68
|
adapter._load(filename)
|
70
69
|
else
|
71
|
-
|
70
|
+
fail NotImplementedError
|
72
71
|
end
|
73
72
|
end
|
74
73
|
|
75
74
|
private
|
76
75
|
|
77
76
|
def collation
|
78
|
-
@collation ||= super ||
|
77
|
+
@collation ||= super || 'utf8_unicode_ci'
|
79
78
|
end
|
80
79
|
|
81
80
|
def in_memory?
|
82
81
|
return false unless _is_sqlite?
|
83
|
-
database ==
|
82
|
+
database == ':memory:'
|
84
83
|
end
|
85
|
-
|
86
84
|
end
|
87
85
|
end
|
88
86
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module SequelRails
|
2
2
|
module Storage
|
3
3
|
class Mysql < Abstract
|
4
|
-
|
5
4
|
def _create
|
6
5
|
execute "CREATE DATABASE IF NOT EXISTS `#{database}` DEFAULT CHARACTER SET #{charset} DEFAULT COLLATE #{collation}"
|
7
6
|
end
|
@@ -11,42 +10,41 @@ module SequelRails
|
|
11
10
|
end
|
12
11
|
|
13
12
|
def _dump(filename)
|
14
|
-
commands = [
|
13
|
+
commands = ['mysqldump']
|
15
14
|
add_connection_settings commands
|
16
|
-
add_flag commands,
|
17
|
-
add_option commands,
|
15
|
+
add_flag commands, '--no-data'
|
16
|
+
add_option commands, '--result-file', filename
|
18
17
|
commands << database
|
19
18
|
safe_exec commands
|
20
19
|
end
|
21
20
|
|
22
21
|
def _load(filename)
|
23
|
-
commands = [
|
22
|
+
commands = ['mysql']
|
24
23
|
add_connection_settings commands
|
25
|
-
add_option commands,
|
26
|
-
add_option commands,
|
24
|
+
add_option commands, '--database', database
|
25
|
+
add_option commands, '--execute', %{SET FOREIGN_KEY_CHECKS = 0; SOURCE #{filename}; SET FOREIGN_KEY_CHECKS = 1}
|
27
26
|
safe_exec commands
|
28
27
|
end
|
29
28
|
|
30
29
|
def collation
|
31
|
-
@collation ||= super ||
|
30
|
+
@collation ||= super || 'utf8_unicode_ci'
|
32
31
|
end
|
33
32
|
|
34
33
|
private
|
35
34
|
|
36
35
|
def add_connection_settings(commands)
|
37
|
-
add_option commands,
|
38
|
-
add_option commands,
|
39
|
-
add_option commands,
|
40
|
-
add_option commands,
|
36
|
+
add_option commands, '--user', username
|
37
|
+
add_option commands, '--password', password
|
38
|
+
add_option commands, '--host', host
|
39
|
+
add_option commands, '--port', port.to_s
|
41
40
|
end
|
42
41
|
|
43
42
|
def execute(statement)
|
44
|
-
commands = [
|
43
|
+
commands = ['mysql']
|
45
44
|
add_connection_settings commands
|
46
|
-
add_option commands,
|
45
|
+
add_option commands, '--execute', statement
|
47
46
|
safe_exec commands
|
48
47
|
end
|
49
|
-
|
50
48
|
end
|
51
49
|
end
|
52
50
|
end
|
@@ -1,19 +1,18 @@
|
|
1
1
|
module SequelRails
|
2
2
|
module Storage
|
3
3
|
class Postgres < Abstract
|
4
|
-
|
5
4
|
def _create
|
6
5
|
with_pgpassword do
|
7
|
-
commands = [
|
6
|
+
commands = ['createdb']
|
8
7
|
add_connection_settings commands
|
9
|
-
add_option commands,
|
10
|
-
add_option commands,
|
11
|
-
add_option commands,
|
12
|
-
add_option commands,
|
13
|
-
add_option commands,
|
14
|
-
add_option commands,
|
15
|
-
add_option commands,
|
16
|
-
add_option commands,
|
8
|
+
add_option commands, '--maintenance-db', maintenance_db
|
9
|
+
add_option commands, '--encoding', encoding
|
10
|
+
add_option commands, '--locale', locale
|
11
|
+
add_option commands, '--lc-collate', collation
|
12
|
+
add_option commands, '--lc-ctype', ctype
|
13
|
+
add_option commands, '--template', template
|
14
|
+
add_option commands, '--tablespace', tablespace
|
15
|
+
add_option commands, '--owner', owner
|
17
16
|
commands << database
|
18
17
|
safe_exec commands
|
19
18
|
end
|
@@ -21,7 +20,7 @@ module SequelRails
|
|
21
20
|
|
22
21
|
def _drop
|
23
22
|
with_pgpassword do
|
24
|
-
commands = [
|
23
|
+
commands = ['dropdb']
|
25
24
|
add_connection_settings commands
|
26
25
|
commands << database
|
27
26
|
safe_exec commands
|
@@ -30,13 +29,13 @@ module SequelRails
|
|
30
29
|
|
31
30
|
def _dump(filename)
|
32
31
|
with_pgpassword do
|
33
|
-
commands = [
|
32
|
+
commands = ['pg_dump']
|
34
33
|
add_connection_settings commands
|
35
|
-
add_flag commands,
|
36
|
-
add_flag commands,
|
37
|
-
add_flag commands,
|
38
|
-
add_flag commands,
|
39
|
-
add_option commands,
|
34
|
+
add_flag commands, '-i'
|
35
|
+
add_flag commands, '-s'
|
36
|
+
add_flag commands, '-x'
|
37
|
+
add_flag commands, '-O'
|
38
|
+
add_option commands, '--file', filename
|
40
39
|
commands << database
|
41
40
|
safe_exec commands
|
42
41
|
end
|
@@ -44,70 +43,68 @@ module SequelRails
|
|
44
43
|
|
45
44
|
def _load(filename)
|
46
45
|
with_pgpassword do
|
47
|
-
commands = [
|
46
|
+
commands = ['psql']
|
48
47
|
add_connection_settings commands
|
49
|
-
add_option commands,
|
48
|
+
add_option commands, '--file', filename
|
50
49
|
commands << database
|
51
50
|
safe_exec commands
|
52
51
|
end
|
53
52
|
end
|
54
53
|
|
55
54
|
def close_connections
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
55
|
+
db = ::Sequel.connect(config)
|
56
|
+
# Will only work on Postgres > 8.4
|
57
|
+
pid_column = db.server_version < 90_200 ? 'procpid' : 'pid'
|
58
|
+
db.execute <<-SQL.gsub(/^\s{12}/, '')
|
59
|
+
SELECT COUNT(pg_terminate_backend(#{pid_column}))
|
60
|
+
FROM pg_stat_activity
|
61
|
+
WHERE datname = '#{database}';
|
62
|
+
SQL
|
63
|
+
rescue Sequel::DatabaseDisconnectError
|
64
|
+
# Will raise an error as it kills existing process running this
|
65
|
+
# command. Seems to be only way to ensure *all* test connections
|
66
|
+
# are closed
|
67
|
+
nil
|
70
68
|
end
|
71
69
|
|
72
70
|
def encoding
|
73
|
-
@encoding ||= config[
|
71
|
+
@encoding ||= config['encoding'] || charset
|
74
72
|
end
|
75
73
|
|
76
74
|
def locale
|
77
|
-
@locale ||= config[
|
75
|
+
@locale ||= config['locale'] || ''
|
78
76
|
end
|
79
77
|
|
80
78
|
def template
|
81
|
-
@template ||= config[
|
79
|
+
@template ||= config['template'] || ''
|
82
80
|
end
|
83
81
|
|
84
82
|
def ctype
|
85
|
-
@ctype ||= config[
|
83
|
+
@ctype ||= config['ctype'] || ''
|
86
84
|
end
|
87
85
|
|
88
86
|
def tablespace
|
89
|
-
@tablespace ||= config[
|
87
|
+
@tablespace ||= config['tablespace'] || ''
|
90
88
|
end
|
91
89
|
|
92
90
|
def maintenance_db
|
93
|
-
@maintenance_db ||= config[
|
91
|
+
@maintenance_db ||= config['maintenance_db'] || ''
|
94
92
|
end
|
95
93
|
|
96
94
|
private
|
97
95
|
|
98
96
|
def with_pgpassword
|
99
|
-
ENV[
|
97
|
+
ENV['PGPASSWORD'] = password unless password.blank?
|
100
98
|
yield
|
101
99
|
ensure
|
102
|
-
ENV[
|
100
|
+
ENV['PGPASSWORD'] = nil unless password.blank?
|
103
101
|
end
|
104
102
|
|
105
103
|
def add_connection_settings(commands)
|
106
|
-
add_option commands,
|
107
|
-
add_option commands,
|
108
|
-
add_option commands,
|
104
|
+
add_option commands, '--username', username
|
105
|
+
add_option commands, '--host', host
|
106
|
+
add_option commands, '--port', port.to_s
|
109
107
|
end
|
110
|
-
|
111
108
|
end
|
112
109
|
end
|
113
110
|
end
|
data/lib/sequel_rails/storage.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
1
|
+
require 'sequel_rails/shellwords'
|
2
|
+
require 'sequel_rails/storage/abstract'
|
3
|
+
require 'sequel_rails/storage/sqlite'
|
4
|
+
require 'sequel_rails/storage/mysql'
|
5
|
+
require 'sequel_rails/storage/mysql2'
|
6
|
+
require 'sequel_rails/storage/postgres'
|
7
|
+
require 'sequel_rails/storage/jdbc'
|
8
8
|
|
9
9
|
module SequelRails
|
10
10
|
module Storage
|
@@ -59,7 +59,7 @@ module SequelRails
|
|
59
59
|
if config['host'].blank? || %w[ 127.0.0.1 localhost ].include?(config['host'])
|
60
60
|
yield config
|
61
61
|
else
|
62
|
-
|
62
|
+
warn "This task only modifies local databases. #{config['database']} is on a remote host."
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
@@ -72,12 +72,12 @@ module SequelRails
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def self.lookup_class(adapter)
|
75
|
-
|
75
|
+
fail 'Adapter not specified in config, please set the :adapter key.' unless adapter
|
76
76
|
return Jdbc if adapter =~ /jdbc/
|
77
77
|
|
78
78
|
klass_name = adapter.camelize.to_sym
|
79
79
|
unless self.const_defined?(klass_name)
|
80
|
-
|
80
|
+
fail "Adapter #{adapter} not supported (#{klass_name.inspect})"
|
81
81
|
end
|
82
82
|
|
83
83
|
const_get klass_name
|
data/lib/sequel_rails/version.rb
CHANGED
data/lib/sequel_rails.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'sequel_rails/version'
|
2
|
+
require 'sequel_rails/railtie' if defined? Rails
|
3
3
|
|
4
4
|
module SequelRails
|
5
5
|
def self.jruby?
|
6
|
-
(defined?(RUBY_ENGINE) && RUBY_ENGINE==
|
6
|
+
(defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby') || defined?(JRUBY_VERSION)
|
7
7
|
end
|
8
8
|
end
|
data/rubocop-todo.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# This configuration was generated by `rubocop --auto-gen-config`.
|
2
|
+
# The point is for the user to remove these configuration records
|
3
|
+
# one by one as the offences are removed from the code base.
|
4
|
+
|
5
|
+
ConstantName:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
ClassVars:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
CyclomaticComplexity:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
Documentation:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Encoding:
|
18
|
+
Enabled: false
|
19
|
+
|
20
|
+
LineLength:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
MethodLength:
|
24
|
+
Enabled: false
|
data/sequel-rails.gemspec
CHANGED
@@ -1,30 +1,32 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
3
3
|
|
4
|
-
require
|
4
|
+
require 'sequel_rails/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
7
|
+
s.name = 'sequel-rails'
|
8
8
|
s.version = SequelRails::VERSION
|
9
9
|
s.platform = Gem::Platform::RUBY
|
10
|
-
s.authors = [
|
11
|
-
s.email = [
|
12
|
-
s.homepage =
|
13
|
-
s.description =
|
14
|
-
s.summary =
|
10
|
+
s.authors = ['Brasten Sager (brasten)', 'Jonathan TRON']
|
11
|
+
s.email = ['brasten@gmail.com', 'jonathan.tron@metrilio.com']
|
12
|
+
s.homepage = 'http://talentbox.github.io/sequel-rails/'
|
13
|
+
s.description = 'Integrate Sequel with Rails (3.x and 4.x)'
|
14
|
+
s.summary = 'Use Sequel with Rails (3.x and 4.x)'
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
-
s.require_paths = [
|
19
|
-
s.extra_rdoc_files = [
|
20
|
-
s.rdoc_options = [
|
21
|
-
s.license =
|
17
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
18
|
+
s.require_paths = ['lib']
|
19
|
+
s.extra_rdoc_files = ['LICENSE', 'README.md']
|
20
|
+
s.rdoc_options = ['--charset=UTF-8']
|
21
|
+
s.license = 'MIT'
|
22
22
|
|
23
|
-
s.
|
24
|
-
s.
|
23
|
+
s.add_dependency 'activemodel'
|
24
|
+
s.add_dependency 'railties', '>= 3.2.0'
|
25
|
+
s.add_dependency 'sequel', ['>= 3.28', '< 5.0']
|
25
26
|
|
26
|
-
s.add_development_dependency
|
27
|
-
s.add_development_dependency
|
28
|
-
s.add_development_dependency
|
29
|
-
s.add_development_dependency
|
27
|
+
s.add_development_dependency 'combustion'
|
28
|
+
s.add_development_dependency 'generator_spec'
|
29
|
+
s.add_development_dependency 'rake', '>= 0.8.7'
|
30
|
+
s.add_development_dependency 'rspec'
|
31
|
+
s.add_development_dependency 'rubocop' unless RUBY_VERSION < '1.9.2'
|
30
32
|
end
|
data/spec/internal/Rakefile
CHANGED
@@ -1 +1 @@
|
|
1
|
-
Combustion::Application.config.session_store
|
1
|
+
Combustion::Application.config.session_store SequelRails::SessionStore
|
@@ -4,5 +4,11 @@ Sequel.migration do
|
|
4
4
|
primary_key :id
|
5
5
|
String :email
|
6
6
|
end
|
7
|
+
create_table :sessions do
|
8
|
+
primary_key :id
|
9
|
+
String :session_id, :null => false, :unique => true, :index => true
|
10
|
+
String :data, :text => true, :null => false
|
11
|
+
DateTime :updated_at, :null => true, :index => true
|
12
|
+
end
|
7
13
|
end
|
8
14
|
end
|