data_migrator 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTBjZTc3Yzg3ODIyMTE1NjM1NzRiYmYzZDVkYmEyYTNlYzAwNzUxMw==
5
- data.tar.gz: !binary |-
6
- NjEyNDI4MmY3MDU4ZTI2ZDQ3ZWNiYzE4ZTZjNzAxYmQyYThjODM3Yw==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MDVmYTllNTQwNjljNDUyNzZhMDA1MTY5MzM3MmJhMzY5YWEwZDVkM2QyY2Rm
10
- NDI5ZjRjOTQ1NWU0MWY2MDZmYTZjM2M1MmRjYjM1YzBmOWZhNDM0NWUyZTI1
11
- NzEyYzRmNjFhMjcyZjFkNDA2ZjJlMTlkN2NjOWU5MjRjODQ0NDg=
12
- data.tar.gz: !binary |-
13
- YjY1MTAzMjFhMDU0OGI5NDI0YjZlOWZlM2UxNDlhYmRhZmIyYjQwZmM4YmVl
14
- N2NhMzQyMTMwYjg4ODliODFjMmJhNjAxZTkyNWIxMDY5ZWZkOWY1NzJhMjQ5
15
- MmFkNmI3MjhjNDUzODdlZGYwNzZiMmYzYzhiOWE1NTU2ZDVkNWQ=
2
+ SHA1:
3
+ metadata.gz: 6f3a9a4d51cfe574a006b795916430224b8371b6
4
+ data.tar.gz: fea2aa1f3166c066eb409edea332dc20b5e13e40
5
+ SHA512:
6
+ metadata.gz: 49068e423aabde866d5a1841068496d6a07d1619f32e3583e930d3183a00ea2b1a6226a497524e22a1774df02b419937745d649109694569da53fe6fbf570647
7
+ data.tar.gz: db1d8e7c14c5c33056aeb45ab0c043a7864ef9846534d14d93b025a8ef6a245535ba197bafa620550ff5fe92be78bc06d5f0389a27da227b126ade8b6ea15598
@@ -61,21 +61,21 @@ module RussellEdge
61
61
  migrations(path).each do |migration|
62
62
  source = File.read(migration[:filename])
63
63
  source = "# This migration comes from #{scope} (originally #{migration[:version]})\n#{source}"
64
-
64
+
65
65
  if duplicate = destination_migrations.detect { |m| m[:name] == migration[:name] }
66
66
  if options[:refresh] && duplicate[:scope] == scope.to_s
67
67
  Dir.glob(File.join(destination,"*_#{migration[:name].underscore}.#{scope.to_s}.rb")).each { |f| puts "Removing old migration #{migration[:name]}"; File.delete(f) }
68
68
  elsif options[:on_skip] && duplicate[:scope] != scope.to_s
69
- options[:on_skip].call(scope, migration)
69
+ options[:on_skip].call(scope, migration)
70
70
  end
71
71
  next unless options[:refresh]
72
72
  end
73
-
73
+
74
74
  migration[:version] = next_migration_number(last ? last[:version] + 1 : 0).to_i unless options[:preserve_timestamp]
75
75
  new_path = File.join(destination, "#{migration[:version]}_#{migration[:name].underscore}.#{scope}.rb")
76
76
  old_path, migration[:filename] = migration[:filename], new_path
77
77
  last = migration
78
-
78
+
79
79
  File.open(migration[:filename], "w") { |f| f.write source }
80
80
  copied << migration
81
81
  options[:on_copy].call(scope, migration, old_path) if options[:on_copy]
@@ -229,7 +229,7 @@ module RussellEdge
229
229
  klass.send(action.to_s)
230
230
  end
231
231
  end
232
- rescue Exception => ex
232
+ rescue StandardError => ex
233
233
  raise ex
234
234
  end
235
235
  time_str = "(%.4fs)" % time.real
@@ -266,7 +266,7 @@ module RussellEdge
266
266
  paths = file.split('/')
267
267
  filename = paths[paths.length - 1]
268
268
  version = filename.split('_')[0]
269
- klass_name = filename.gsub(/#{version}/, "").gsub(/.rb/, "")[1..filename.length]
269
+ klass_name = filename.gsub(/#{version}/, "").gsub(/\.rb/, "")[1..filename.length]
270
270
  klass_name = klass_name.split('.')[0] if klass_name.split('.').length > 1 #check for scope of engine name
271
271
 
272
272
  return filename, version.to_i, klass_name
@@ -312,4 +312,4 @@ module RussellEdge
312
312
  files
313
313
  end
314
314
  end
315
- end
315
+ end
@@ -2,7 +2,7 @@ module DataMigrator
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_migrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russell Holmes, Adam Hull
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-20 00:00:00.000000000 Z
11
+ date: 2017-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 3.2.0
27
27
  description: Allows you to create data migrations that can be run up and down to insert
@@ -31,17 +31,17 @@ executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
+ - MIT-LICENSE
35
+ - README.rdoc
34
36
  - db/migrate/20100819181805_create_data_migrations_table.rb
35
- - lib/data_migrator/version.rb
36
37
  - lib/data_migrator.rb
37
- - lib/extensions/railties/engine/configuration.rb
38
+ - lib/data_migrator/version.rb
38
39
  - lib/extensions/railties/engine.rb
40
+ - lib/extensions/railties/engine/configuration.rb
41
+ - lib/generators/data_migration/USAGE
39
42
  - lib/generators/data_migration/data_migration_generator.rb
40
43
  - lib/generators/data_migration/templates/migration_template.rb
41
- - lib/generators/data_migration/USAGE
42
44
  - lib/tasks/data_migrator.rake
43
- - MIT-LICENSE
44
- - README.rdoc
45
45
  - test/data_migrator_test.rb
46
46
  - test/test_helper.rb
47
47
  homepage: https://github.com/portablemind/data_migrator
@@ -53,17 +53,17 @@ require_paths:
53
53
  - lib
54
54
  required_ruby_version: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - ! '>='
56
+ - - ">="
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
- - - ! '>='
61
+ - - ">="
62
62
  - !ruby/object:Gem::Version
63
63
  version: '0'
64
64
  requirements: []
65
65
  rubyforge_project:
66
- rubygems_version: 2.0.7
66
+ rubygems_version: 2.4.8
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: Creates Data Migrations for data similar to schema migrations.