database_patcher 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/database_patcher/patch_creator.rb +16 -4
- data/lib/database_patcher/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fd59eced6b8c2a78606e83467b99a58ca0c27bd
|
4
|
+
data.tar.gz: 2fdcae04485dc6d4a741dc329f9c7fe757b5aaa1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01e90492ce3597000c2451297c21875d54a2c4d5f305cabaead2b26396bbab310c85dc9b5a55d61ce3e4bcfde51b4fec4724935040488ecdfa86bbafc6bdb6e4
|
7
|
+
data.tar.gz: 2a30acc1bbf31e56c309ee36e9450b3f4882167a2dfcee31926185a628654684597c32c379d1b49ba20ec4e6379d4dddc0ef97d2adb987fc36f830940d80fa0b
|
@@ -14,8 +14,8 @@ class DatabasePatcher::PatchCreator
|
|
14
14
|
puts(file_path)
|
15
15
|
else
|
16
16
|
FileUtils.mkpath(base_path)
|
17
|
-
FileUtils.touch(File.join(base_path,'up' + extension))
|
18
|
-
FileUtils.touch(File.join(base_path,'down' + extension))
|
17
|
+
FileUtils.touch(File.join(base_path, 'up' + extension))
|
18
|
+
FileUtils.touch(File.join(base_path, 'down' + extension))
|
19
19
|
puts(base_path)
|
20
20
|
end
|
21
21
|
end
|
@@ -27,12 +27,24 @@ class DatabasePatcher::PatchCreator
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def basename
|
30
|
-
|
30
|
+
name = ''
|
31
|
+
name.concat(Time.now.to_i.to_s)
|
32
|
+
name.concat(file_name_description_part)
|
33
|
+
name
|
34
|
+
end
|
35
|
+
|
36
|
+
def file_name_description_part
|
37
|
+
case @file_name_description
|
38
|
+
when '', NilClass
|
39
|
+
''
|
40
|
+
else
|
41
|
+
'_' + @file_name_description.to_s.gsub(/ +/, '_')
|
42
|
+
end
|
31
43
|
end
|
32
44
|
|
33
45
|
def extension
|
34
46
|
case @type
|
35
|
-
when 'ruby','rb'
|
47
|
+
when 'ruby', 'rb'
|
36
48
|
'.rb'
|
37
49
|
when 'sql'
|
38
50
|
'.sql'
|