sequel-rake-tasks 0.0.3 → 0.0.4
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/lib/sequel_rake_tasks.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f7b2c0db8889e2a81ba874b93ec497d2754d6ad3
|
|
4
|
+
data.tar.gz: 691df9fe73570b494e81fd80f7ca55fd8debe15b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef62b4fd49ec44e95bda69fa2bdaa0235403ae48b3c626198c062293eed3d70dfb81fe471848fbf48e370b5470185fc623392359044b414c820a97592cdd0065
|
|
7
|
+
data.tar.gz: e60428cabf7dfc916194646b2dc4cca60fb5a75bbd44145d74a2cfeed7bbe91bfcaf58148eb88be536b0a20767eaff1e0501d02b1161e7810d4e002e2b48b3f6
|
data/lib/sequel_rake_tasks.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Sequel
|
|
|
13
13
|
:connection_config,
|
|
14
14
|
:migrator_klass,
|
|
15
15
|
:migrations_dir,
|
|
16
|
+
:migrations_opts,
|
|
16
17
|
:schema_file,
|
|
17
18
|
:seed_file,
|
|
18
19
|
:structure_file
|
|
@@ -22,6 +23,7 @@ module Sequel
|
|
|
22
23
|
@connection_config = options[:connection_config]
|
|
23
24
|
@migrator_klass = options[:migrator]
|
|
24
25
|
@migrations_dir = options[:migrations_dir]
|
|
26
|
+
@migrations_opts = options[:migrations_opts]
|
|
25
27
|
@schema_file = options[:schema_file]
|
|
26
28
|
@seed_file = options[:seed_file]
|
|
27
29
|
@structure_file = options[:structure_file]
|
|
@@ -33,7 +35,11 @@ module Sequel
|
|
|
33
35
|
end
|
|
34
36
|
|
|
35
37
|
def migrator
|
|
36
|
-
@migrator ||=
|
|
38
|
+
@migrator ||= begin
|
|
39
|
+
args = [connection, migrations_dir]
|
|
40
|
+
args << migrations_opts if migrations_opts
|
|
41
|
+
migrator_klass.new(*args)
|
|
42
|
+
end
|
|
37
43
|
end
|
|
38
44
|
|
|
39
45
|
def define_tasks
|
|
@@ -75,6 +81,11 @@ module Sequel
|
|
|
75
81
|
text = text.gsub(/ +$/, '') # remove trailing whitespace
|
|
76
82
|
File.open(schema_file, 'w') { |f| f.write(text) }
|
|
77
83
|
end
|
|
84
|
+
|
|
85
|
+
desc 'Loads the schema_file into the current environment\'s database'
|
|
86
|
+
task :load do
|
|
87
|
+
eval(File.read schema_file).apply(connection, :up)
|
|
88
|
+
end
|
|
78
89
|
end
|
|
79
90
|
|
|
80
91
|
namespace :structure do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sequel-rake-tasks
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Myles Megyesi
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2015-02-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rake
|