duck_duck_duck 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/duck_duck_duck.rb +10 -4
- data/specs/duck_duck_duck.rb +7 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20ab64a22819731148fd285dab0e88ffb6d55865
|
4
|
+
data.tar.gz: 772d54ecb03a4e998e38ca84ed1c0b556c8deabb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc860a684065b65e9dfcf924c77d9f3b241525b73ff3e584ad9757d43a1e69c30e98f01a62581a9b0a485500b326eaf1f9223f6785b1d68f09d021e432ce7c3
|
7
|
+
data.tar.gz: 97d096b52826386a9590c9daade0bf40f48627d728fb7c20ea5546c23acf35c06c5de60522c910c20dfebc87367c8e748b94403c2ed23c84458f0e38c97a64e0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
3.0.0
|
data/lib/duck_duck_duck.rb
CHANGED
@@ -139,12 +139,18 @@ class Duck_Duck_Duck
|
|
139
139
|
def create
|
140
140
|
`mkdir -p #{name}/migrates`
|
141
141
|
|
142
|
-
files = Dir.glob("#{name}/migrates/*.sql").grep(/\/\d
|
142
|
+
files = Dir.glob("#{name}/migrates/*.sql").grep(/\/\d+\-/).sort
|
143
143
|
|
144
|
+
size = 3
|
144
145
|
next_ver = begin
|
145
|
-
(files.last || '')[/\/(\d
|
146
|
-
v =
|
147
|
-
|
146
|
+
(files.last || '')[/\/(\d+)[^\/]+\z/]
|
147
|
+
v = if $1
|
148
|
+
size = $1.size
|
149
|
+
$1
|
150
|
+
else
|
151
|
+
'0'
|
152
|
+
end
|
153
|
+
"%0#{size}d" % (v.to_i + 1)
|
148
154
|
end
|
149
155
|
|
150
156
|
new_file = "#{name}/migrates/#{next_ver}-#{[action, sub_action].compact.join('-')}.sql"
|
data/specs/duck_duck_duck.rb
CHANGED
@@ -54,21 +54,21 @@ describe "create" do
|
|
54
54
|
@dir = tmp_dir
|
55
55
|
}
|
56
56
|
|
57
|
-
it "names the file in successive file versions:
|
57
|
+
it "names the file in successive file versions: 000-....sql" do
|
58
58
|
Dir.chdir(@dir) {
|
59
59
|
Exit_0("duck_duck_duck create MOD table_1")
|
60
60
|
Exit_0("duck_duck_duck create MOD table_2")
|
61
61
|
|
62
|
-
Exit_0("touch MOD/migrates/
|
62
|
+
Exit_0("touch MOD/migrates/005-skip_zero.sql")
|
63
63
|
Exit_0("duck_duck_duck create MOD table_3")
|
64
64
|
|
65
|
-
Exit_0("touch MOD/migrates/
|
65
|
+
Exit_0("touch MOD/migrates/009-skip_zero.sql")
|
66
66
|
Exit_0("duck_duck_duck create MOD table_100")
|
67
67
|
|
68
|
-
File.should.exists('MOD/migrates/
|
69
|
-
File.should.exists('MOD/migrates/
|
70
|
-
File.should.exists('MOD/migrates/
|
71
|
-
File.should.exists('MOD/migrates/
|
68
|
+
File.should.exists('MOD/migrates/001-table_1.sql')
|
69
|
+
File.should.exists('MOD/migrates/002-table_2.sql')
|
70
|
+
File.should.exists('MOD/migrates/006-table_3.sql')
|
71
|
+
File.should.exists('MOD/migrates/010-table_100.sql')
|
72
72
|
}
|
73
73
|
end
|
74
74
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duck_duck_duck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- da99
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.4.
|
170
|
+
rubygems_version: 2.4.6
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Migrations for apps composed of mini-apps.
|