data_migrator 1.4 → 1.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/data_migrator.rb CHANGED
@@ -10,6 +10,12 @@ module RussellEdge
10
10
  class DataMigrator
11
11
  REMOVE_FILES_REGEX = /^\./
12
12
 
13
+ #class methods
14
+ def self.next_migration_number
15
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
16
+ end
17
+ #end
18
+
13
19
  def initialize(migrations_path=nil)
14
20
  @default_migrations_path = migrations_path || "#{Rails.root}/db/data_migrations"
15
21
  end
@@ -50,10 +56,6 @@ module RussellEdge
50
56
  current_version
51
57
  end
52
58
 
53
- def next_migration_number
54
- Time.now.utc.strftime("%Y%m%d%H%M%S")
55
- end
56
-
57
59
  def run_up(passed_version)
58
60
  setup
59
61
 
@@ -2,6 +2,6 @@ class DataMigrationGenerator < Rails::Generators::NamedBase
2
2
  source_root File.expand_path('../templates', __FILE__)
3
3
 
4
4
  def generate_layout
5
- template "migration_template.rb", "db/data_migrations/#{DataMigrator.next_migration_number}_#{file_name}.rb"
5
+ template "migration_template.rb", "db/data_migrations/#{RussellEdge::DataMigrator.next_migration_number}_#{file_name}.rb"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_migrator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 4
9
- version: "1.4"
8
+ - 5
9
+ version: "1.5"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Russell Holmes, Adam Hull