app_reset 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module AppReset
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -1,33 +1,31 @@
1
- unless Rails.env.production?
2
- host_is_engine = ! Rake::Task.tasks.map { |t| t.name =~ /app:/ }.uniq.compact.empty?
3
- task_name = host_is_engine ? 'reset' : 'app:reset'
1
+ host_is_engine = ! Rake::Task.tasks.map { |t| t.name =~ /app:/ }.uniq.compact.empty?
2
+ task_name = host_is_engine ? 'reset' : 'app:reset'
4
3
 
5
- rails_env = ENV['RAILS_ENV']
6
- rails_envs = rails_env.nil? ? ['development', 'test'] : [rails_env]
4
+ rails_env = ENV['RAILS_ENV']
5
+ rails_envs = rails_env.nil? ? ['development', 'test'] : [rails_env]
7
6
 
8
- desc 'Resets (and if available, seeds) your development and test databases'
9
- task task_name => 'db:create' do
10
- rails_envs.each do |env|
11
- puts '=' * 35
12
- puts "Resetting #{env} database ..."
13
- puts '=' * 35
7
+ desc 'Resets (and if available, seeds) your development and test databases'
8
+ task task_name => 'db:create' do
9
+ rails_envs.each do |env|
10
+ puts '=' * 35
11
+ puts "Resetting #{env} database ..."
12
+ puts '=' * 35
14
13
 
15
- # this workaround is faster than spawning subprocesses,
16
- # but due to the nature of it (it re-enables pretty much all tasks),
17
- # it probably is a bad idea to have it as a dependency for other tasks
18
- Rake::Task.tasks.each do |task|
19
- task.reenable unless task.name == 'load_app'
20
- end
21
-
22
- Rails.env = env
14
+ # this workaround is faster than spawning subprocesses,
15
+ # but due to the nature of it (it re-enables pretty much all tasks),
16
+ # it probably is a bad idea to have it as a dependency for other tasks
17
+ Rake::Task.tasks.each do |task|
18
+ task.reenable unless task.name == 'load_app'
19
+ end
23
20
 
24
- Rake::Task['db:migrate:reset'].invoke
21
+ Rails.env = env
25
22
 
26
- # execute the main app's seeds.rb file
27
- load 'db/seeds.rb'
28
- end
23
+ Rake::Task['db:migrate:reset'].invoke
29
24
 
30
- # ensure we reset the Rails.env in case other tasks depend on this
31
- ENV['RAILS_ENV'] = rails_env
25
+ # execute the main app's seeds.rb file
26
+ load 'db/seeds.rb'
32
27
  end
28
+
29
+ # ensure we reset the Rails.env in case other tasks depend on this
30
+ ENV['RAILS_ENV'] = rails_env
33
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_reset
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-05 00:00:00.000000000 Z
12
+ date: 2012-10-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -57,7 +57,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  segments:
59
59
  - 0
60
- hash: 3902845237607112477
60
+ hash: 140975577514646687
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
@@ -66,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  segments:
68
68
  - 0
69
- hash: 3902845237607112477
69
+ hash: 140975577514646687
70
70
  requirements: []
71
71
  rubyforge_project:
72
72
  rubygems_version: 1.8.24