sequel_rails3 0.0.4 → 0.0.5
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/.gitignore +4 -0
- data/{spec/spec.opts → .rspec} +1 -0
- data/Gemfile +4 -0
- data/Rakefile +4 -46
- data/lib/sequel_rails3.rb +5 -0
- data/lib/sequel_rails3/railtie.rb +19 -0
- data/lib/sequel_rails3/version.rb +3 -0
- data/lib/tasks/db.rake +86 -0
- data/sequel_rails3.gemspec +18 -55
- data/spec/spec_helper.rb +7 -6
- metadata +57 -86
- data/.document +0 -5
- data/VERSION +0 -1
- data/spec/sequel_rails3_spec.rb +0 -7
data/.gitignore
ADDED
data/{spec/spec.opts → .rspec}
RENAMED
data/Gemfile
ADDED
data/Rakefile
CHANGED
@@ -1,48 +1,6 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = 'sequel_rails3'
|
8
|
-
gem.authors = ['Corin Langosch']
|
9
|
-
gem.date = Date.today.to_s
|
10
|
-
gem.email = 'info@netskin.com'
|
11
|
-
gem.homepage = 'http://github.com/gucki/sequel_rails3'
|
12
|
-
gem.summary = 'Use sequel as a replacement for activerecord with rails 3'
|
13
|
-
gem.description = 'Sequel plugin which provides geo distance-based filters and distance calculation functionality for model.'
|
14
|
-
gem.add_dependency "rails", ">= 3.0.0"
|
15
|
-
gem.add_dependency "sequel", ">= 3.0.0"
|
16
|
-
gem.add_development_dependency "rspec", ">= 1.2.9"
|
17
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
-
end
|
19
|
-
Jeweler::GemcutterTasks.new
|
20
|
-
rescue LoadError
|
21
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
22
|
-
end
|
23
|
-
|
24
|
-
#require 'spec/rake/spectask'
|
25
|
-
#Spec::Rake::SpecTask.new(:spec) do |spec|
|
26
|
-
# spec.libs << 'lib' << 'spec'
|
27
|
-
# spec.spec_files = FileList['spec/**/*_spec.rb']
|
28
|
-
#end
|
29
|
-
|
30
|
-
#Spec::Rake::SpecTask.new(:rcov) do |spec|
|
31
|
-
# spec.libs << 'lib' << 'spec'
|
32
|
-
# spec.pattern = 'spec/**/*_spec.rb'
|
33
|
-
# spec.rcov = true
|
34
|
-
#end
|
35
|
-
|
36
|
-
task :spec => :check_dependencies
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
37
3
|
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new('spec')
|
38
6
|
task :default => :spec
|
39
|
-
|
40
|
-
require 'rake/rdoctask'
|
41
|
-
Rake::RDocTask.new do |rdoc|
|
42
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
43
|
-
|
44
|
-
rdoc.rdoc_dir = 'rdoc'
|
45
|
-
rdoc.title = "sequel_rails3 #{version}"
|
46
|
-
rdoc.rdoc_files.include('README*')
|
47
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
48
|
-
end
|
data/lib/sequel_rails3.rb
CHANGED
@@ -31,5 +31,24 @@ module SequelRails3
|
|
31
31
|
include SequelRails3::Railties::ControllerRuntime
|
32
32
|
end
|
33
33
|
end
|
34
|
+
|
35
|
+
def self.migrator
|
36
|
+
Sequel::IntegerMigrator.new(db, File.join(Rails.root, 'db', 'migrate'))
|
37
|
+
end
|
38
|
+
|
39
|
+
def self.migrate_to(version)
|
40
|
+
Sequel::IntegerMigrator.apply(db, File.join(Rails.root, 'db', 'migrate'), version)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.schema(action)
|
44
|
+
case action
|
45
|
+
when :dump
|
46
|
+
File.open(File.join(Rails.root, 'db', 'schema.rb'), "w") do |f|
|
47
|
+
f.write(db.dump_schema_migration)
|
48
|
+
end
|
49
|
+
else
|
50
|
+
eval(File.read(File.join(Rails.root, 'db', 'schema.rb'))).apply(db, action)
|
51
|
+
end
|
52
|
+
end
|
34
53
|
end
|
35
54
|
end
|
data/lib/tasks/db.rake
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
namespace :db do
|
2
|
+
task :load_config => :environment do
|
3
|
+
Sequel.extension :migration
|
4
|
+
Sequel.extension :schema_dumper
|
5
|
+
end
|
6
|
+
|
7
|
+
desc 'Rolls the schema back to the previous version. Specify the number of steps with STEP=n.'
|
8
|
+
task :rollback => :load_config do
|
9
|
+
Rake::Task["db:migrate:down"].invoke
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Drops and recreates the database from db/schema.rb for the current environment.'
|
13
|
+
task :reset => ['db:schema:drop', 'db:schema:load']
|
14
|
+
|
15
|
+
desc 'Load the seed data from db/seeds.rb'
|
16
|
+
task :seed => :environment do
|
17
|
+
seed_file = File.join(Rails.root, 'db', 'seeds.rb')
|
18
|
+
load(seed_file) if File.exist?(seed_file)
|
19
|
+
puts "Database seeded."
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Create the database, load the schema, and initialize with the seed data.'
|
23
|
+
task :setup => ['db:schema:load', 'db:seed']
|
24
|
+
|
25
|
+
namespace :schema do
|
26
|
+
desc "Drops the schema from db/schema.rb."
|
27
|
+
task :drop => [:load_config, :dump] do
|
28
|
+
SequelRails3::Railtie.schema(:down)
|
29
|
+
puts "Database schema dropped."
|
30
|
+
end
|
31
|
+
|
32
|
+
desc "Loads the schema from db/schema.rb."
|
33
|
+
task :load => :load_config do
|
34
|
+
SequelRails3::Railtie.schema(:up)
|
35
|
+
puts "Database schema loaded version #{SequelRails3::Railtie.migrator.current}."
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Dumps the schema to db/schema.db."
|
39
|
+
task :dump => :load_config do
|
40
|
+
SequelRails3::Railtie.schema(:dump)
|
41
|
+
puts "Database schema version #{SequelRails3::Railtie.migrator.current} dumped."
|
42
|
+
end
|
43
|
+
|
44
|
+
desc "Shows the current schema version."
|
45
|
+
task :version => :load_config do
|
46
|
+
puts "Database schema version: #{SequelRails3::Railtie.migrator.current}."
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
desc "Runs all pending migrations and updates the schema afterwards. Target specific version with VERSION=x. Turn off output with VERBOSE=false."
|
51
|
+
task :migrate => :load_config do
|
52
|
+
SequelRails3::Railtie.migrate_to(nil)
|
53
|
+
Rake::Task["db:schema:dump"].invoke
|
54
|
+
Rake::Task["db:schema:version"].invoke
|
55
|
+
end
|
56
|
+
|
57
|
+
namespace :migrate do
|
58
|
+
desc 'Rollbacks the database one migration and re-migrate up. Specify the number of steps with STEP=x (default 1). Target specific version with VERSION=x.'
|
59
|
+
task :redo => :load_config do
|
60
|
+
Rake::Task["db:rollback"].invoke
|
61
|
+
Rake::Task["db:migrate"].invoke
|
62
|
+
Rake::Task["db:schema:dump"].invoke
|
63
|
+
end
|
64
|
+
|
65
|
+
desc 'Runs the "up" for a given migration VERSION=x or STEP=x (default 1).'
|
66
|
+
task :up => :load_config do
|
67
|
+
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
68
|
+
version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
|
69
|
+
version ||= SequelRails3::Railtie.migrator.current + step
|
70
|
+
puts "Migrating up to version #{version}..."
|
71
|
+
SequelRails3::Railtie.migrate_to(version)
|
72
|
+
Rake::Task["db:schema:dump"].invoke
|
73
|
+
end
|
74
|
+
|
75
|
+
desc 'Runs the "down" for a given migration VERSION=x or STEP=x (default 1).'
|
76
|
+
task :down => :load_config do
|
77
|
+
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
78
|
+
version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
|
79
|
+
version ||= SequelRails3::Railtie.migrator.current - step
|
80
|
+
puts "Migrating down to version #{version}..."
|
81
|
+
SequelRails3::Railtie.migrate_to(version)
|
82
|
+
Rake::Task["db:schema:dump"].invoke
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
data/sequel_rails3.gemspec
CHANGED
@@ -1,63 +1,26 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "sequel_rails3/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
6
|
+
s.name = "sequel_rails3"
|
7
|
+
s.version = SequelRails3::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Corin Langosch"]
|
10
|
+
s.email = ["info@netskin.com"]
|
11
|
+
s.homepage = "http://github.com/gucki/sequel_rails3"
|
12
|
+
s.summary = %q{Use sequel as a replacement for activerecord with rails 3}
|
13
|
+
s.description = %q{This gem allows you to easily use sequel instead of activerecord with rails 3.x.x}
|
9
14
|
|
10
|
-
s.
|
11
|
-
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
"LICENSE",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION",
|
25
|
-
"lib/sequel_rails3.rb",
|
26
|
-
"lib/sequel_rails3/configuration.rb",
|
27
|
-
"lib/sequel_rails3/logger.rb",
|
28
|
-
"lib/sequel_rails3/railtie.rb",
|
29
|
-
"lib/sequel_rails3/railties/controller_runtime.rb",
|
30
|
-
"sequel_rails3.gemspec",
|
31
|
-
"spec/sequel_rails3_spec.rb",
|
32
|
-
"spec/spec.opts",
|
33
|
-
"spec/spec_helper.rb"
|
34
|
-
]
|
35
|
-
s.homepage = %q{http://github.com/gucki/sequel_rails3}
|
15
|
+
s.rubyforge_project = "sequel_rails3"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
36
20
|
s.require_paths = ["lib"]
|
37
|
-
s.rubygems_version = %q{1.3.7}
|
38
|
-
s.summary = %q{Use sequel as a replacement for activerecord with rails 3}
|
39
|
-
s.test_files = [
|
40
|
-
"spec/sequel_rails3_spec.rb",
|
41
|
-
"spec/spec_helper.rb"
|
42
|
-
]
|
43
21
|
|
44
|
-
|
45
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
|
-
s.specification_version = 3
|
22
|
+
s.add_dependency "rails", "~>3.0"
|
47
23
|
|
48
|
-
|
49
|
-
|
50
|
-
s.add_runtime_dependency(%q<sequel>, [">= 3.0.0"])
|
51
|
-
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
52
|
-
else
|
53
|
-
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
54
|
-
s.add_dependency(%q<sequel>, [">= 3.0.0"])
|
55
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
56
|
-
end
|
57
|
-
else
|
58
|
-
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
59
|
-
s.add_dependency(%q<sequel>, [">= 3.0.0"])
|
60
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
61
|
-
end
|
24
|
+
s.add_development_dependency "rspec", "~>2.5"
|
25
|
+
s.add_development_dependency "rspec-rails", "~>2.5"
|
62
26
|
end
|
63
|
-
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
require 'rails'
|
5
|
+
require 'active_support/all'
|
6
|
+
|
3
7
|
require 'sequel_rails3'
|
4
|
-
require 'spec'
|
5
|
-
require 'spec/autorun'
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
+
RSpec.configure do |config|
|
9
10
|
end
|
metadata
CHANGED
@@ -1,123 +1,94 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel_rails3
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 4
|
9
|
-
version: 0.0.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.5
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Corin Langosch
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-08-02 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: rails
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &12497620 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 3
|
30
|
-
- 0
|
31
|
-
- 0
|
32
|
-
version: 3.0.0
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
33
22
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: sequel
|
37
23
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 3
|
45
|
-
- 0
|
46
|
-
- 0
|
47
|
-
version: 3.0.0
|
48
|
-
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
24
|
+
version_requirements: *12497620
|
25
|
+
- !ruby/object:Gem::Dependency
|
51
26
|
name: rspec
|
27
|
+
requirement: &12390400 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.5'
|
33
|
+
type: :development
|
52
34
|
prerelease: false
|
53
|
-
|
35
|
+
version_requirements: *12390400
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec-rails
|
38
|
+
requirement: &12376520 !ruby/object:Gem::Requirement
|
54
39
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
- 1
|
60
|
-
- 2
|
61
|
-
- 9
|
62
|
-
version: 1.2.9
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.5'
|
63
44
|
type: :development
|
64
|
-
|
65
|
-
|
66
|
-
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *12376520
|
47
|
+
description: This gem allows you to easily use sequel instead of activerecord with
|
48
|
+
rails 3.x.x
|
49
|
+
email:
|
50
|
+
- info@netskin.com
|
67
51
|
executables: []
|
68
|
-
|
69
52
|
extensions: []
|
70
|
-
|
71
|
-
|
72
|
-
-
|
73
|
-
-
|
74
|
-
|
75
|
-
- .document
|
53
|
+
extra_rdoc_files: []
|
54
|
+
files:
|
55
|
+
- .gitignore
|
56
|
+
- .rspec
|
57
|
+
- Gemfile
|
76
58
|
- LICENSE
|
77
59
|
- README.rdoc
|
78
60
|
- Rakefile
|
79
|
-
- VERSION
|
80
61
|
- lib/sequel_rails3.rb
|
81
62
|
- lib/sequel_rails3/configuration.rb
|
82
63
|
- lib/sequel_rails3/logger.rb
|
83
64
|
- lib/sequel_rails3/railtie.rb
|
84
65
|
- lib/sequel_rails3/railties/controller_runtime.rb
|
66
|
+
- lib/sequel_rails3/version.rb
|
67
|
+
- lib/tasks/db.rake
|
85
68
|
- sequel_rails3.gemspec
|
86
|
-
- spec/sequel_rails3_spec.rb
|
87
|
-
- spec/spec.opts
|
88
69
|
- spec/spec_helper.rb
|
89
|
-
has_rdoc: true
|
90
70
|
homepage: http://github.com/gucki/sequel_rails3
|
91
71
|
licenses: []
|
92
|
-
|
93
72
|
post_install_message:
|
94
73
|
rdoc_options: []
|
95
|
-
|
96
|
-
require_paths:
|
74
|
+
require_paths:
|
97
75
|
- lib
|
98
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
99
77
|
none: false
|
100
|
-
requirements:
|
101
|
-
- -
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
|
104
|
-
|
105
|
-
version: "0"
|
106
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ! '>='
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
83
|
none: false
|
108
|
-
requirements:
|
109
|
-
- -
|
110
|
-
- !ruby/object:Gem::Version
|
111
|
-
|
112
|
-
- 0
|
113
|
-
version: "0"
|
84
|
+
requirements:
|
85
|
+
- - ! '>='
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
114
88
|
requirements: []
|
115
|
-
|
116
|
-
|
117
|
-
rubygems_version: 1.3.7
|
89
|
+
rubyforge_project: sequel_rails3
|
90
|
+
rubygems_version: 1.7.2
|
118
91
|
signing_key:
|
119
92
|
specification_version: 3
|
120
93
|
summary: Use sequel as a replacement for activerecord with rails 3
|
121
|
-
test_files:
|
122
|
-
- spec/sequel_rails3_spec.rb
|
123
|
-
- spec/spec_helper.rb
|
94
|
+
test_files: []
|
data/.document
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.4
|