nando 1.0.6 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/nando +5 -1
- data/lib/nando/interface.rb +1 -0
- data/lib/nando/migrator.rb +17 -1
- data/lib/nando/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8477a6de523a18f91ef35775eab752ddf4bd2b0f0c13ee6f6e220b0316c11b27
|
4
|
+
data.tar.gz: 164fca0acb142b42a6ef79aec42eff52ec5ca4635911220d0ec9904fc0ab6dd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c83229e31db8cafdb09d7e7541932ac2732d274dad77ff44a61145bd9afb20262e6fc226958ac8dc16759952da704798dbc39ca2132a04f52962be195d8d5f53
|
7
|
+
data.tar.gz: 17de7f834a3a6d3f2663239f481ea05b71d80860d8158fe30a204b59568e28e856136543b654f6421e403b019e7ea18b711b4b3741f7e3d74c3023bd83f50cb7
|
data/Gemfile.lock
CHANGED
data/exe/nando
CHANGED
@@ -23,6 +23,10 @@ parser = OptionParser.new do |opt|
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
opt.on("-d", "--dry-run", "Pass value") do |bool|
|
27
|
+
options[:dry_run] = true
|
28
|
+
end
|
29
|
+
|
26
30
|
opt.on("-h", "--help", "Show this message") do |value|
|
27
31
|
NandoInterface.print_help_message()
|
28
32
|
exit 0
|
@@ -35,7 +39,7 @@ begin
|
|
35
39
|
action = ARGV.shift()
|
36
40
|
case action
|
37
41
|
when 'up'
|
38
|
-
NandoMigrator.instance.migrate()
|
42
|
+
NandoMigrator.instance.migrate(options)
|
39
43
|
when 'down'
|
40
44
|
NandoMigrator.instance.rollback()
|
41
45
|
when 'apply'
|
data/lib/nando/interface.rb
CHANGED
@@ -31,6 +31,7 @@ module NandoInterface
|
|
31
31
|
flags = [
|
32
32
|
['-t/--type', 'Used to specify the migration type'],
|
33
33
|
['-f/--function', 'Used to specify which function files to add to a migration'],
|
34
|
+
['-d/--dry-run', 'Used to prevent the tool from applying migrations and only provide info'],
|
34
35
|
['-h/--help', 'Shows the help message']
|
35
36
|
]
|
36
37
|
|
data/lib/nando/migrator.rb
CHANGED
@@ -56,6 +56,7 @@ class NandoMigrator
|
|
56
56
|
def migrate (options = {})
|
57
57
|
_debug 'Migrating!'
|
58
58
|
|
59
|
+
migrations_to_apply = []
|
59
60
|
migration_files = get_migration_files(@migration_dir)
|
60
61
|
|
61
62
|
if migration_files.length == 0
|
@@ -73,7 +74,22 @@ class NandoMigrator
|
|
73
74
|
next
|
74
75
|
end
|
75
76
|
|
76
|
-
|
77
|
+
if options[:dry_run]
|
78
|
+
migrations_to_apply << {:migration_version => migration_version, :migration_name => migration_name}
|
79
|
+
else
|
80
|
+
execute_migration_method(:up, filename, migration_name, migration_version)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
if options[:dry_run]
|
85
|
+
if migrations_to_apply.count > 0
|
86
|
+
puts "Migrations that would be applied:"
|
87
|
+
for migration in migrations_to_apply do
|
88
|
+
puts "=> #{migration[:migration_version]} - '#{migration[:migration_name]}'"
|
89
|
+
end
|
90
|
+
else
|
91
|
+
_warn 'No migration would be applied'
|
92
|
+
end
|
77
93
|
end
|
78
94
|
|
79
95
|
end
|
data/lib/nando/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Alves
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|