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.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +13 -0
  4. data/.travis.yml +15 -43
  5. data/Gemfile +10 -10
  6. data/History.md +8 -0
  7. data/README.md +36 -0
  8. data/Rakefile +70 -2
  9. data/ci/rails-3.2.gemfile +15 -12
  10. data/ci/rails-4.0.gemfile +12 -12
  11. data/config.ru +1 -1
  12. data/lib/generators/sequel/migration/migration_generator.rb +10 -13
  13. data/lib/generators/sequel/model/model_generator.rb +11 -9
  14. data/lib/generators/sequel/observer/observer_generator.rb +6 -7
  15. data/lib/generators/sequel/session_migration/session_migration_generator.rb +30 -0
  16. data/lib/generators/sequel/session_migration/templates/migration.rb.erb +10 -0
  17. data/lib/generators/sequel.rb +9 -13
  18. data/lib/sequel-rails.rb +1 -1
  19. data/lib/sequel_rails/configuration.rb +29 -35
  20. data/lib/sequel_rails/migrations.rb +4 -4
  21. data/lib/sequel_rails/railtie.rb +16 -20
  22. data/lib/sequel_rails/railties/controller_runtime.rb +2 -8
  23. data/lib/sequel_rails/railties/database.rake +42 -46
  24. data/lib/sequel_rails/railties/i18n_support.rb +0 -2
  25. data/lib/sequel_rails/railties/legacy_model_config.rb +1 -1
  26. data/lib/sequel_rails/railties/log_subscriber.rb +5 -9
  27. data/lib/sequel_rails/sequel/database/active_support_notification.rb +4 -6
  28. data/lib/sequel_rails/sequel/plugins/rails_extensions.rb +2 -3
  29. data/lib/sequel_rails/session_store.rb +6 -42
  30. data/lib/sequel_rails/shellwords.rb +3 -3
  31. data/lib/sequel_rails/storage/abstract.rb +14 -16
  32. data/lib/sequel_rails/storage/jdbc.rb +8 -10
  33. data/lib/sequel_rails/storage/mysql.rb +13 -15
  34. data/lib/sequel_rails/storage/postgres.rb +42 -45
  35. data/lib/sequel_rails/storage/sqlite.rb +0 -1
  36. data/lib/sequel_rails/storage.rb +10 -10
  37. data/lib/sequel_rails/version.rb +1 -1
  38. data/lib/sequel_rails.rb +3 -3
  39. data/rubocop-todo.yml +24 -0
  40. data/sequel-rails.gemspec +21 -19
  41. data/spec/internal/Rakefile +2 -2
  42. data/spec/internal/config/initializers/session.rb +1 -1
  43. data/spec/internal/db/schema.rb.init +6 -0
  44. data/spec/lib/generators/sequel/migration_spec.rb +77 -77
  45. data/spec/lib/generators/sequel/session_migration_spec.rb +41 -0
  46. data/spec/lib/sequel_rails/configuration_spec.rb +161 -161
  47. data/spec/lib/sequel_rails/jdbc_spec.rb +4 -4
  48. data/spec/lib/sequel_rails/migrations_spec.rb +29 -29
  49. data/spec/lib/sequel_rails/railtie_spec.rb +31 -29
  50. data/spec/lib/sequel_rails/railties/database_rake_spec.rb +16 -15
  51. data/spec/lib/sequel_rails/railties/log_subscriber_spec.rb +6 -6
  52. data/spec/lib/sequel_rails/storage/mysql_spec.rb +31 -31
  53. data/spec/lib/sequel_rails/storage/postgres_spec.rb +67 -67
  54. data/spec/lib/sequel_rails/storage/sqlite_spec.rb +40 -40
  55. data/spec/lib/sequel_rails/storage_spec.rb +77 -89
  56. data/spec/spec_helper.rb +16 -10
  57. metadata +61 -28
  58. data/tasks/spec.rake +0 -81
@@ -1,6 +1,6 @@
1
1
  module SequelRails
2
2
  begin
3
- require "shellwords"
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])/, "\\\\\\1")
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
- return str
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
- puts "[sequel] Created database '#{database}'" if res
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
- puts "[sequel] Dropped database '#{database}'" if res
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
- puts "[sequel] Dumped structure of database '#{database}' to '#{filename}'" if res
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
- puts "[sequel] Loaded structure of database '#{database}' from '#{filename}'" if res
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["database"] || config["path"]
41
+ @database ||= config['database'] || config['path']
43
42
  end
44
43
 
45
44
  def username
46
- @username ||= config["username"] || config["user"] || ""
45
+ @username ||= config['username'] || config['user'] || ''
47
46
  end
48
47
 
49
48
  def password
50
- @password ||= config["password"] || ""
49
+ @password ||= config['password'] || ''
51
50
  end
52
51
 
53
52
  def host
54
- @host ||= config["host"] || ""
53
+ @host ||= config['host'] || ''
55
54
  end
56
55
 
57
56
  def port
58
- @port ||= config["port"] || ""
57
+ @port ||= config['port'] || ''
59
58
  end
60
59
 
61
60
  def owner
62
- @owner ||= config["owner"] || ""
61
+ @owner ||= config['owner'] || ''
63
62
  end
64
63
 
65
64
  def charset
66
- @charset ||= config["charset"] || ENV["CHARSET"] || "utf8"
65
+ @charset ||= config['charset'] || ENV['CHARSET'] || 'utf8'
67
66
  end
68
67
 
69
68
  def collation
70
- @collation ||= config["collation"] || ENV["COLLATION"]
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
- $?.exitstatus == 0
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'].match(/^jdbc:mysql/)
5
+ config['adapter'].start_with?('jdbc:mysql')
7
6
  end
8
7
 
9
8
  def _is_postgres?
10
- config['adapter'].match(/^jdbc:postgresql/)
9
+ config['adapter'].start_with?('jdbc:postgresql')
11
10
  end
12
11
 
13
12
  def _is_sqlite?
14
- config['adapter'].match(/^jdbc:sqlite/)
13
+ config['adapter'].start_with?('jdbc:sqlite')
15
14
  end
16
15
 
17
16
  def _root_url
18
- config['url'].scan(/^jdbc:mysql:\/\/[\w\.]*:?\d*/).first
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
- raise NotImplementedError
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
- raise NotImplementedError
70
+ fail NotImplementedError
72
71
  end
73
72
  end
74
73
 
75
74
  private
76
75
 
77
76
  def collation
78
- @collation ||= super || "utf8_unicode_ci"
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 == ":memory:"
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 = ["mysqldump"]
13
+ commands = ['mysqldump']
15
14
  add_connection_settings commands
16
- add_flag commands, "--no-data"
17
- add_option commands, "--result-file", filename
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 = ["mysql"]
22
+ commands = ['mysql']
24
23
  add_connection_settings commands
25
- add_option commands, "--database", database
26
- add_option commands, "--execute", %{SET FOREIGN_KEY_CHECKS = 0; SOURCE #{filename}; SET FOREIGN_KEY_CHECKS = 1}
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 || "utf8_unicode_ci"
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, "--user", username
38
- add_option commands, "--password", password
39
- add_option commands, "--host", host
40
- add_option commands, "--port", port.to_s
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 = ["mysql"]
43
+ commands = ['mysql']
45
44
  add_connection_settings commands
46
- add_option commands, "--execute", statement
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 = ["createdb"]
6
+ commands = ['createdb']
8
7
  add_connection_settings commands
9
- add_option commands, "--maintenance-db", maintenance_db
10
- add_option commands, "--encoding", encoding
11
- add_option commands, "--locale", locale
12
- add_option commands, "--lc-collate", collation
13
- add_option commands, "--lc-ctype", ctype
14
- add_option commands, "--template", template
15
- add_option commands, "--tablespace", tablespace
16
- add_option commands, "--owner", owner
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 = ["dropdb"]
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 = ["pg_dump"]
32
+ commands = ['pg_dump']
34
33
  add_connection_settings commands
35
- add_flag commands, "-i"
36
- add_flag commands, "-s"
37
- add_flag commands, "-x"
38
- add_flag commands, "-O"
39
- add_option commands, "--file", filename
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 = ["psql"]
46
+ commands = ['psql']
48
47
  add_connection_settings commands
49
- add_option commands, "--file", filename
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
- begin
57
- db = ::Sequel.connect(config)
58
- # Will only work on Postgres > 8.4
59
- pid_column = db.server_version < 90200 ? "procpid" : "pid"
60
- db.execute <<-SQL.gsub(/^\s{12}/,'')
61
- SELECT COUNT(pg_terminate_backend(#{pid_column}))
62
- FROM pg_stat_activity
63
- WHERE datname = '#{database}';
64
- SQL
65
- rescue => _
66
- # Will raise an error as it kills existing process running this
67
- # command. Seems to be only way to ensure *all* test connections
68
- # are closed
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["encoding"] || charset
71
+ @encoding ||= config['encoding'] || charset
74
72
  end
75
73
 
76
74
  def locale
77
- @locale ||= config["locale"] || ""
75
+ @locale ||= config['locale'] || ''
78
76
  end
79
77
 
80
78
  def template
81
- @template ||= config["template"] || ""
79
+ @template ||= config['template'] || ''
82
80
  end
83
81
 
84
82
  def ctype
85
- @ctype ||= config["ctype"] || ""
83
+ @ctype ||= config['ctype'] || ''
86
84
  end
87
85
 
88
86
  def tablespace
89
- @tablespace ||= config["tablespace"] || ""
87
+ @tablespace ||= config['tablespace'] || ''
90
88
  end
91
89
 
92
90
  def maintenance_db
93
- @maintenance_db ||= config["maintenance_db"] || ""
91
+ @maintenance_db ||= config['maintenance_db'] || ''
94
92
  end
95
93
 
96
94
  private
97
95
 
98
96
  def with_pgpassword
99
- ENV["PGPASSWORD"] = password unless password.blank?
97
+ ENV['PGPASSWORD'] = password unless password.blank?
100
98
  yield
101
99
  ensure
102
- ENV["PGPASSWORD"] = nil unless password.blank?
100
+ ENV['PGPASSWORD'] = nil unless password.blank?
103
101
  end
104
102
 
105
103
  def add_connection_settings(commands)
106
- add_option commands, "--username", username
107
- add_option commands, "--host", host
108
- add_option commands, "--port", port.to_s
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
@@ -34,7 +34,6 @@ module SequelRails
34
34
  def path
35
35
  @path ||= Pathname(File.expand_path(database, Rails.root))
36
36
  end
37
-
38
37
  end
39
38
  end
40
39
  end
@@ -1,10 +1,10 @@
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"
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
- puts "This task only modifies local databases. #{config['database']} is on a remote host."
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
- raise "Adapter not specified in config, please set the :adapter key." unless adapter
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
- raise "Adapter #{adapter} not supported (#{klass_name.inspect})"
80
+ fail "Adapter #{adapter} not supported (#{klass_name.inspect})"
81
81
  end
82
82
 
83
83
  const_get klass_name
@@ -1,3 +1,3 @@
1
1
  module SequelRails
2
- VERSION = "0.7.0"
2
+ VERSION = '0.8.0'
3
3
  end
data/lib/sequel_rails.rb CHANGED
@@ -1,8 +1,8 @@
1
- require "sequel_rails/version"
2
- require "sequel_rails/railtie" if defined? Rails
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=="jruby") || defined?(JRUBY_VERSION)
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
- $:.push File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
3
 
4
- require "sequel_rails/version"
4
+ require 'sequel_rails/version'
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "sequel-rails"
7
+ s.name = 'sequel-rails'
8
8
  s.version = SequelRails::VERSION
9
9
  s.platform = Gem::Platform::RUBY
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"
14
- s.summary = "Use Sequel with Rails 3"
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 = ["lib"]
19
- s.extra_rdoc_files = ["LICENSE", "README.md"]
20
- s.rdoc_options = ["--charset=UTF-8"]
21
- s.license = "MIT"
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.add_runtime_dependency "sequel", [">= 3.28", "< 5.0"]
24
- s.add_runtime_dependency "railties", ">= 3.2.0"
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 "rake", ">= 0.8.7"
27
- s.add_development_dependency "rspec", "~> 2.7.0"
28
- s.add_development_dependency "combustion", "~> 0.5.0"
29
- s.add_development_dependency "generator_spec", "~> 0.9.0"
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
@@ -5,6 +5,6 @@ rescue LoadError
5
5
  end
6
6
  Bundler.require :default, :development, :test
7
7
 
8
- Combustion.path = ""
9
- Combustion.initialize! "sequel_rails"
8
+ Combustion.path = ''
9
+ Combustion.initialize! 'sequel_rails'
10
10
  Combustion::Application.load_tasks
@@ -1 +1 @@
1
- Combustion::Application.config.session_store :cookie_store, :key => "sequel-rails", :secret => "secret-token"
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