sequel_db_config 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/lib/sequel_db_config.rb +19 -0
- data/lib/sequel_db_config/version.rb +1 -1
- data/sequel_db_config.gemspec +0 -0
- metadata +3 -4
- data/pkg/sequel_db_config-0.0.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba9bd372ff83b9c692fa8ecba867b6e8b8494bbe
|
4
|
+
data.tar.gz: cb4713506a2c28edd3e15da82e552e34306de03c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40175d59d578f421e5841e493492fff59c97dbef57d68fd4508adc37572a6bee1f3c1da3a1cfef37ad06bd857ff2a29b0b89efce450ecee37783ccb8e84f7b0f
|
7
|
+
data.tar.gz: 0de8860c92319ef34ca501984396766d7740da0b953db19f6d98221a2f0edf3b3b99a51d37e4ab2818a6e24a37efdaf4c4b64e9a15655a9ae3f84107c9b48d28
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
data/lib/sequel_db_config.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "sequel_db_config/version"
|
2
2
|
require "singleton"
|
3
3
|
require "yaml"
|
4
|
+
require "sequel"
|
4
5
|
|
5
6
|
module SequelDbConfig
|
6
7
|
# Your code goes here...
|
@@ -34,5 +35,23 @@ module SequelDbConfig
|
|
34
35
|
raise "Cannot open configuration file."
|
35
36
|
end
|
36
37
|
end
|
38
|
+
|
39
|
+
# Execute migration
|
40
|
+
# If version is nil, sequel will migrate to the latest version.
|
41
|
+
def migrate(path, version = nil)
|
42
|
+
if @connection_string == ""
|
43
|
+
raise "Configuration is not loaded."
|
44
|
+
end
|
45
|
+
unless Dir.exist?(path)
|
46
|
+
raise "Migration dir not exists. (#{path})"
|
47
|
+
end
|
48
|
+
Sequel.extension :migration
|
49
|
+
db = Sequel.connect(@connection_string)
|
50
|
+
if version
|
51
|
+
Sequel::Migrator.run(db, path, target: version.to_i)
|
52
|
+
else
|
53
|
+
Sequel::Migrator.run(db, path)
|
54
|
+
end
|
55
|
+
end
|
37
56
|
end
|
38
57
|
end
|
data/sequel_db_config.gemspec
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel_db_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kikuchi Ken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,7 +66,6 @@ files:
|
|
66
66
|
- Rakefile
|
67
67
|
- lib/sequel_db_config.rb
|
68
68
|
- lib/sequel_db_config/version.rb
|
69
|
-
- pkg/sequel_db_config-0.0.1.gem
|
70
69
|
- sequel_db_config.gemspec
|
71
70
|
homepage: ''
|
72
71
|
licenses:
|
@@ -88,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
87
|
version: '0'
|
89
88
|
requirements: []
|
90
89
|
rubyforge_project:
|
91
|
-
rubygems_version: 2.
|
90
|
+
rubygems_version: 2.6.11
|
92
91
|
signing_key:
|
93
92
|
specification_version: 4
|
94
93
|
summary: Sequel database configuration settings.
|
Binary file
|