neo_gruby 0.2.0.pre.rc3 → 0.2.0.pre.rc4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/neo_gruby/cli/commands.rb +4 -3
- data/lib/neo_gruby/version.rb +1 -1
- metadata +1 -2
- data/lib/neo_gruby/cli/commands/db.rb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89326ede9eabada88bc8cd1919eb82345fe823f4bef275a053f17b7e04abd75a
|
4
|
+
data.tar.gz: e01a70764fa8ea8b49d5338a9f9b669ed8dd5387a78864556898f4163947a07a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30c4f4a011625c59c34c2427beaf74bf09581c7232783c5b6bb37ec392c71dde95bc0c9754317feb2bd85ddb6c522b1c4280c837899d8a7ad3957565779df31d
|
7
|
+
data.tar.gz: ad887e9ced72ece4b385b598765e067c3c104a1892ee598736afd9c05ee331001ba29db0a047a795f5bd58648761bbbdb28b7a5ac7fb03f2f45affc7166a9934
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require "dry/cli"
|
2
2
|
|
3
|
+
NeoGruby.cli = true
|
4
|
+
|
3
5
|
module NeoGruby
|
4
6
|
module CLI
|
5
7
|
module Commands
|
@@ -8,9 +10,8 @@ module NeoGruby
|
|
8
10
|
end
|
9
11
|
end
|
10
12
|
|
11
|
-
NeoGruby.cli = true
|
12
|
-
|
13
|
-
require_relative 'commands/db'
|
14
13
|
require_relative 'commands/protoc'
|
15
14
|
require_relative 'commands/server'
|
16
15
|
require_relative 'commands/console'
|
16
|
+
|
17
|
+
require './config/boot' if File.exist? './config/boot.rb'
|
data/lib/neo_gruby/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neo_gruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.pre.
|
4
|
+
version: 0.2.0.pre.rc4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Welington Sampaio
|
@@ -93,7 +93,6 @@ files:
|
|
93
93
|
- lib/neo_gruby/application.rb
|
94
94
|
- lib/neo_gruby/cli/commands.rb
|
95
95
|
- lib/neo_gruby/cli/commands/console.rb
|
96
|
-
- lib/neo_gruby/cli/commands/db.rb
|
97
96
|
- lib/neo_gruby/cli/commands/protoc.rb
|
98
97
|
- lib/neo_gruby/cli/commands/server.rb
|
99
98
|
- lib/neo_gruby/ext/class.rb
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require "dry/cli"
|
2
|
-
|
3
|
-
module NeoGruby
|
4
|
-
module CLI
|
5
|
-
module Commands
|
6
|
-
module Db
|
7
|
-
class Migrate < Dry::CLI::Command
|
8
|
-
desc "Run database migration"
|
9
|
-
|
10
|
-
argument :version, type: :string, desc: "Informe the migration name to destination"
|
11
|
-
|
12
|
-
def call(version: nil, **)
|
13
|
-
require './config/boot'
|
14
|
-
require 'sequel'
|
15
|
-
require 'yaml'
|
16
|
-
|
17
|
-
::Sequel.extension :migration
|
18
|
-
|
19
|
-
config = YAML.load_file(NeoGruby.root.join('config', 'database.yml'))
|
20
|
-
config[NeoGruby.env].keys.each do |name|
|
21
|
-
dir = NeoGruby.root.join('db/migrations', name)
|
22
|
-
puts dir if File.directory? dir
|
23
|
-
::Sequel::Migrator.run(NeoGruby.db[name.to_sym], dir, target: version) if File.directory? dir
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
register "db" do |prefix|
|
30
|
-
prefix.register "migrate", Db::Migrate
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|