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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 497369b03ba36d3a55bf46a78dd1beb05934e59b
4
- data.tar.gz: 65a754a30f0cb7e31177a7ba46f991ae7f8d5242
3
+ metadata.gz: ba9bd372ff83b9c692fa8ecba867b6e8b8494bbe
4
+ data.tar.gz: cb4713506a2c28edd3e15da82e552e34306de03c
5
5
  SHA512:
6
- metadata.gz: d360edb0a628aef9851f846209f5683af3b02ae518cf784c1fd2ef1bb554c1b5d3c271e9128e395b6e1a5933859e1e4e7643d0a2404c8c06b2d9ec37da9aa8da
7
- data.tar.gz: 15a8aad9c24407f6a1ae3762b31221d0132339763695aea11981b2605acca7e4b67172e5a37d2bb20894e174bec0de1cb09e314cb75cdcc195f5c209f94fc1f5
6
+ metadata.gz: 40175d59d578f421e5841e493492fff59c97dbef57d68fd4508adc37572a6bee1f3c1da3a1cfef37ad06bd857ff2a29b0b89efce450ecee37783ccb8e84f7b0f
7
+ data.tar.gz: 0de8860c92319ef34ca501984396766d7740da0b953db19f6d98221a2f0edf3b3b99a51d37e4ab2818a6e24a37efdaf4c4b64e9a15655a9ae3f84107c9b48d28
data/.gitignore CHANGED
@@ -12,3 +12,5 @@
12
12
  *.a
13
13
  mkmf.log
14
14
  dbconfig.yaml
15
+ .ruby-version
16
+ /pkg
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module SequelDbConfig
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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.1
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: 2014-11-04 00:00:00.000000000 Z
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.2.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