genesis 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ genesis
@@ -0,0 +1 @@
1
+ ruby-1.9.3-p392
@@ -2,8 +2,11 @@ namespace :db do
2
2
 
3
3
  desc "Loads seed data for the current environment."
4
4
  task :genesis => :environment do
5
+ dry_run = ENV['DRY_RUN']
6
+
5
7
  Genesis::Seeder.verify_or_create_version_table
6
- ignores = %w(genesis_common.rb)
8
+ ignores = %w(genesis_common.rb
9
+ genesis_callbacks.rb)
7
10
  seeds = Dir[File.join( Rails.root, 'db', 'seeds', '*.rb' )] +
8
11
  Dir[File.join( Rails.root, 'db', 'seeds', Rails.env, '*.rb') ]
9
12
 
@@ -16,13 +19,35 @@ namespace :db do
16
19
  end
17
20
  end
18
21
 
19
-
20
-
21
22
  puts "", message( contexts, :using_contexts => using_contexts, :start => true ), ""
22
- Genesis::Seeder.run( seeds, ENV['VERSION'] || nil, ignores )
23
+ if dry_run
24
+ r = ActiveRecord::Base.connection.execute( "SELECT `schema_seeds`.* FROM `schema_seeds`" )
25
+ versions = []
26
+ executes = []
27
+ r.each_hash { |rec| versions << rec['version'] }
28
+
29
+ puts '-- DRY RUN --', 'Will execute seeds:', ''
30
+ seeds.reject! { |s| ignores.any? { |i| s.include?( i ) } }
31
+
32
+ seeds.each do |s|
33
+ match = s.match( /^.*\/((\d*)_.*\.rb)$/ )
34
+ if match
35
+ executes << match[1] unless versions.include?( match[2] )
36
+ end
37
+ end
38
+
39
+ puts executes.sort.join( "\n" )
40
+ puts ''
41
+ else
42
+ Genesis::Seeder.run( seeds, ENV['VERSION'] || nil, ignores )
43
+ end
23
44
  puts message( contexts, :using_contexts => using_contexts ), "", ""
24
45
  end
25
46
 
47
+ desc "Loads seed data for the current environment."
48
+ task :genesis => :environment do
49
+ end
50
+
26
51
  desc "Recreates the databse by migrating down to VERSION=0 and then db:migrate and db:seed"
27
52
  task :mulligan => :environment do
28
53
  raise 'Cannot seed production' if ENV['RAILS_ENV'] == 'production' || Rails.env.production?
@@ -1,3 +1,3 @@
1
1
  module Genesis
2
- VERSION = "1.7.0"
2
+ VERSION = "1.8.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genesis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -166,7 +166,8 @@ files:
166
166
  - .document
167
167
  - .gitignore
168
168
  - .rspec
169
- - .rvmrc
169
+ - .ruby-gemset
170
+ - .ruby-version
170
171
  - Gemfile
171
172
  - Guardfile
172
173
  - LICENSE
data/.rvmrc DELETED
@@ -1,2 +0,0 @@
1
- rvm use ruby-1.9.3-p392@genesis --create
2
- rvm info