seed_migration 1.0.4 → 1.0.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
  SHA1:
3
- metadata.gz: f8cbe10525d9a825e5345594b8ba3095fe7d63ed
4
- data.tar.gz: c90f8982dac4016e9a4ca2bcb76455cae8c0e099
3
+ metadata.gz: b5277f9fd85a999055845daef4b41ca50271deeb
4
+ data.tar.gz: e154804159aa8788775c6c60283d496e15475146
5
5
  SHA512:
6
- metadata.gz: d25e906db4e6b95970fc98d06408689a3863253de53b09d44218a4455d8ba6e2185aede1ab688be073741f8001ab5fb998dc29b41ed31ff558d9115ada285f0e
7
- data.tar.gz: 0e3e8a0dbd56640b66f50ceea6d6ef704eb038cfd544831e721247615cdb777ffdbb7ed1acb489ea864788ec199ef1109782afbfba299d74231beb3173b0813d
6
+ metadata.gz: 1101a67b70fe3fe05caf2e663fc013105be387b6ed65fe867468f0db0974c2c85485f6540ec455fa7acc8676966cdaa1deb999d550db6a9497d9a6209f56e8be
7
+ data.tar.gz: 276d1e83d6c31a7826bc0f72d4ee39dc68e67d545a49e027443a295edc331e8f1481e3e4ce921ebe34c27ef47c18955914931336842966c7cab502f5d6b61df2
@@ -10,7 +10,7 @@ module SeedMigration
10
10
  argument :timestamp, :type => :string, :required => false, :default => Time.now.utc.strftime("%Y%m%d%H%M%S")
11
11
 
12
12
  def create_seed_migration_file
13
- path = SeedMigration::Migrator::DATA_MIGRATION_DIRECTORY
13
+ path = SeedMigration::Migrator.data_migration_directory
14
14
  create_file path.join("#{timestamp}_#{file_name.gsub(/([A-Z])/, '_\1').downcase}.rb"), contents
15
15
  end
16
16
 
@@ -6,10 +6,14 @@ module SeedMigration
6
6
  mattr_accessor :extend_native_migration_task
7
7
  mattr_accessor :migration_table_name
8
8
  mattr_accessor :ignore_ids
9
+ mattr_accessor :update_seeds_file
10
+ mattr_accessor :migrations_path
9
11
 
10
12
  self.migration_table_name = 'seed_migration_data_migrations' # Hardcoded, evil!
11
13
  self.extend_native_migration_task = false
12
14
  self.ignore_ids = false
15
+ self.update_seeds_file = true
16
+ self.migrations_path = 'data'
13
17
  end
14
18
 
15
19
  def self.config(&block)
@@ -2,11 +2,14 @@ require 'pathname'
2
2
 
3
3
  module SeedMigration
4
4
  class Migrator
5
- DATA_MIGRATION_DIRECTORY = Rails.root.join("db", "data")
6
5
  SEEDS_FILE_PATH = Rails.root.join('db', 'seeds.rb')
7
6
 
7
+ def self.data_migration_directory
8
+ Rails.root.join("db", SeedMigration.migrations_path)
9
+ end
10
+
8
11
  def self.migration_path(filename)
9
- DATA_MIGRATION_DIRECTORY.join(filename).to_s
12
+ data_migration_directory.join(filename).to_s
10
13
  end
11
14
 
12
15
  def initialize(migration_path)
@@ -195,7 +198,7 @@ module SeedMigration
195
198
  end
196
199
 
197
200
  def self.create_seed_file
198
- if !Rails.env.development?
201
+ if !SeedMigration.update_seeds_file || !Rails.env.development?
199
202
  return
200
203
  end
201
204
  File.open(SEEDS_FILE_PATH, 'w') do |file|
@@ -1,3 +1,3 @@
1
1
  module SeedMigration
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seed_migration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy O'Neill
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-09-30 00:00:00.000000000 Z
14
+ date: 2014-10-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: sqlite3
@@ -93,20 +93,20 @@ executables: []
93
93
  extensions: []
94
94
  extra_rdoc_files: []
95
95
  files:
96
- - LICENSE.txt
97
- - README.md
98
- - Rakefile
99
96
  - app/models/seed_migration/data_migration.rb
100
97
  - db/migrate/20140310150145_create_data_migrations.rb
101
98
  - lib/extra_tasks.rb
102
99
  - lib/generators/seed_migration/seed_migration_generator.rb
103
- - lib/seed_migration.rb
104
100
  - lib/seed_migration/engine.rb
105
101
  - lib/seed_migration/migration.rb
106
102
  - lib/seed_migration/migrator.rb
107
103
  - lib/seed_migration/register_entry.rb
108
104
  - lib/seed_migration/version.rb
105
+ - lib/seed_migration.rb
109
106
  - lib/tasks/seed_migration_tasks.rake
107
+ - LICENSE.txt
108
+ - Rakefile
109
+ - README.md
110
110
  homepage: http://github.com/harrystech/seed_migration
111
111
  licenses:
112
112
  - MIT
@@ -127,9 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  version: '0'
128
128
  requirements: []
129
129
  rubyforge_project:
130
- rubygems_version: 2.2.2
130
+ rubygems_version: 2.0.14
131
131
  signing_key:
132
132
  specification_version: 4
133
133
  summary: Rails Data Migration
134
134
  test_files: []
135
- has_rdoc: