i18n-migrations 0.2.4 → 0.2.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63075e442e0c11d1bea96ec41770177852a52e737881781ca483e8a4114cdeba
|
4
|
+
data.tar.gz: 8628199cb76d9d0312db4e69971df5ba4e0e74ce98e748a959be3873c664c814
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a51c120ff520f528f338cd18ed0112ef1f7e75c33e851e385f12b2351a87d02b48ee132f0bfb8c8409276b5182a9e4fc2ea53507d89d0e7fa7c6db20ad4b5bc
|
7
|
+
data.tar.gz: 18f4049a026d33bbf5947e9e18bb60861d042a0ccd8a0fe1786ecaa28ef268adf092951fdd1d97edfd6febb2c2c187cb096c999262a4b8b7e89f17efa5824831
|
@@ -14,7 +14,9 @@ module I18n
|
|
14
14
|
def play_migration(version:, locale:, data:, notes:, dictionary:, direction:)
|
15
15
|
filename = File.join(@migration_dir, "#{version}.rb")
|
16
16
|
require filename
|
17
|
-
|
17
|
+
|
18
|
+
raise("Can't parse version: #{version}") unless version =~ /^(\d{12})_(.*)/
|
19
|
+
migration_class_name = "#{$2.camelcase}#{$1}"
|
18
20
|
|
19
21
|
migration = begin
|
20
22
|
migration_class_name.constantize.new(locale, data, notes, dictionary, direction)
|
@@ -35,7 +35,8 @@ module I18n
|
|
35
35
|
|
36
36
|
def new_migration(name)
|
37
37
|
name = name.parameterize(separator: '_')
|
38
|
-
|
38
|
+
time = Time.now.strftime('%Y%m%d%H%M')
|
39
|
+
file_name = "#{time}_#{name.downcase.gsub(' ', '_')}.rb"
|
39
40
|
unless Dir.exist?(config.migration_dir)
|
40
41
|
puts "Creating migration directory #{config.migration_dir} because it didn't exist."
|
41
42
|
FileUtils.mkdir_p(config.migration_dir)
|
@@ -45,7 +46,7 @@ module I18n
|
|
45
46
|
f << <<-CONTENTS
|
46
47
|
require 'i18n-migrations'
|
47
48
|
|
48
|
-
class #{name.camelcase} < I18n::Migrations::Migration
|
49
|
+
class #{name.camelcase}#{time} < I18n::Migrations::Migration
|
49
50
|
def change
|
50
51
|
# add('foo.bar', 'The foo of the bar')
|
51
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-migrations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Lightsmith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|