migrations 1.0.1 → 1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/migrate +18 -18
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e69def3df373366ad6f868b248912e320596bce2
4
- data.tar.gz: f224abb2b7208d8d400b3ca48dd0476886a6f8ff
3
+ metadata.gz: a4719d3f13ea04b7e91df4ef7dac7d8dc7bb8a17
4
+ data.tar.gz: f9053379c50e57e1e3f2c7e675fc956ea598a085
5
5
  SHA512:
6
- metadata.gz: 50351268a003013ec89158b0d19f0c45d2cc5d0dab3f4c1343148a3cd32552e654f740408ba07bc0f055578ce4ee104753e57863c2b9d6895f6d5707ef002422
7
- data.tar.gz: 2134585c270fc4949dbe23372ced7192d79096b718b2cb003590fb0f814ef65044134a9aca9894aa5a0eb33ff0138a3d42ebfa3ff0fc11e3280cbdd8398d3a06
6
+ metadata.gz: 83f7023de0646128e70c2e072897ec2c0ca1979461ba9677ee38d6459bc57b6f65ee05b843142844b56486c38b25df96cbd0cf57795cbd44d99d65241400244a
7
+ data.tar.gz: 9dc9ded5a101409c59a0ca9bf633f58225234195455e7669bb7a5857de452934695be9219e507a46430e57656bab4eecfb216eb8c78d369cf9e401adfdf897cb
data/bin/migrate CHANGED
@@ -4,20 +4,20 @@ require 'migrations'
4
4
 
5
5
  class MigrationCommand
6
6
  def initialize(args)
7
- if args.empty?
8
- usage
7
+ @prompt = true
8
+
9
+ for i in 0...args.length
10
+ if args[i] == '-y'
11
+ @prompt = false
12
+ args.delete_at(i)
13
+ end
9
14
  end
10
15
 
11
- @prompt = true
16
+ args.empty? and usage
12
17
 
13
18
  if respond_to? args[0]
14
19
  method = args.shift
15
20
 
16
- if args[args.length-1] == '-y'
17
- @prompt = false
18
- args.pop
19
- end
20
-
21
21
  if args.empty?
22
22
  send method
23
23
  else
@@ -34,16 +34,16 @@ class MigrationCommand
34
34
 
35
35
  format(
36
36
  'migrate list' => 'list all migrations',
37
- 'migrate up [-y]' => 'run all pending migrations',
38
- 'migrate up <n> [-y]' => 'run <n> pending migrations',
39
- 'migrate down [-y]' => 'revert previous migration',
40
- 'migrate down <n> [-y]' => 'revert previous <n> migrations',
41
- 'migrate down all [-y]' => 'revert all previous migrations',
42
- 'migrate to <version> [-y]' => 'migrate up or down to a specific version',
43
- 'migrate add <name> [-y]' => 'generate a new migration class',
44
- 'migrate set <version || "none"> [-y]' => 'set the migrated version without running any migrations',
45
- 'migrate apply <version> [-y]' => 'apply a specific migration without updating the version',
46
- 'migrate revert <version> [-y]' => 'revert a specific migration without updating the version'
37
+ 'migrate [-y] up' => 'run all pending migrations',
38
+ 'migrate [-y] up <n>' => 'run <n> pending migrations',
39
+ 'migrate [-y] down' => 'revert previous migration',
40
+ 'migrate [-y] down <n>' => 'revert previous <n> migrations',
41
+ 'migrate [-y] down all' => 'revert all previous migrations',
42
+ 'migrate [-y] to <version>' => 'migrate up or down to a specific version',
43
+ 'migrate [-y] add <name>' => 'generate a new migration class',
44
+ 'migrate [-y] set <version || "none">' => 'set the migrated version without running any migrations',
45
+ 'migrate [-y] apply <version>' => 'apply a specific migration without updating the version',
46
+ 'migrate [-y] revert <version>' => 'revert a specific migration without updating the version'
47
47
  )
48
48
  puts "\n"
49
49
  exit
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - m4rkw