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: 8c95c8d9301a3e3a6ab97029ae9364fd2c81691202b0eecb1d9f9aefa9f70197
4
- data.tar.gz: 4fa547aa1f4d965d714263492f37410f533af2cdd04cc6a2c2bb0965adf42bee
3
+ metadata.gz: 63075e442e0c11d1bea96ec41770177852a52e737881781ca483e8a4114cdeba
4
+ data.tar.gz: 8628199cb76d9d0312db4e69971df5ba4e0e74ce98e748a959be3873c664c814
5
5
  SHA512:
6
- metadata.gz: aeedf137ad548fee7e4a8e8da9433ba82ccb175aedf5a44f25feed660d9aad51a9f8039b4daa28a6472e6530204bb55855ab161f246a34959b40ffd79c2cedaa
7
- data.tar.gz: 7df7ad7561c9c6afe16854e85898b28154c39b7f07f056ad6c5faefa5d804b7c789418240341e1ff2d5b006fc45a898518e5ef33c820816cd74699fdd6daf614
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
- migration_class_name = version.gsub(/^\d{12}_/, '').camelcase
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
- file_name = "#{Time.now.strftime('%Y%m%d%H%M')}_#{name.downcase.gsub(' ', '_')}.rb"
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
@@ -1,5 +1,5 @@
1
1
  module I18n
2
2
  module Migrations
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  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
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-01 00:00:00.000000000 Z
11
+ date: 2018-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler