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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7b3e04fe1740e4f747547954c1978d8818d1500
4
- data.tar.gz: 9c71855450bcbb288f71731ace7d0c962f2103ee
3
+ metadata.gz: 9fd59eced6b8c2a78606e83467b99a58ca0c27bd
4
+ data.tar.gz: 2fdcae04485dc6d4a741dc329f9c7fe757b5aaa1
5
5
  SHA512:
6
- metadata.gz: f70beb3dfe9419064fdfd4929ff2468fc522ba344162333a3a7853aef9696745a771b342aedd8af19efb5981968c334779d8ffe25883fb6556cbd2296aa2cd2b
7
- data.tar.gz: 62aff77bd1afc2a54b3da3ec9468349e0f5b461dd0a1a5eb63ae6436da6bf5fc663276d494ec51ff2efe705fdc81bf2ffc8cac30c9a83b6f541381b5d18452cd
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
- [Time.now.to_i.to_s,@file_name_description].compact.join('_').gsub(/ +/,'_')
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'
@@ -1,3 +1,3 @@
1
1
  module DatabasePatcher
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_patcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi