nuke_pave 1.0.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3cd4417c5794a2185c18f37b51cf1881a3835265
4
+ data.tar.gz: 7142c90f44cf6a39863bbae6792f909748fee151
5
+ SHA512:
6
+ metadata.gz: d6332bfb28c7d144b6bc8ea30e608b64d756dd7f83cfec467e63744a6c137a23c6b89dae761625a3116df9f058eac3ff5aab614e8bc180cb88da4724053c1d21
7
+ data.tar.gz: f641ff7333fadb16cb1b598cc09724dcb791b2a6e1b2dc215523517c3867cbb9ef06c4946fe65cd99ed9ff7701de6fba8f3e3d9afbcf46d199beb787f60327da
@@ -0,0 +1,20 @@
1
+ Copyright 2014 David Bock
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ = NukePave
2
+
3
+ Nukes and paves your database, with safeguards to avoid accidentally doing it in production.
4
+
5
+ I've copied and pasted this rake task between projects for years... its time to grow up.
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'NukePave'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,10 @@
1
+ module NukePave
2
+
3
+ class NukePaveRailtie < Rails::Railtie
4
+ rake_tasks do
5
+ Dir[File.join(File.dirname(__FILE__),'tasks/*.rake')].each { |f| load f }
6
+ end
7
+ end
8
+
9
+
10
+ end
@@ -0,0 +1,3 @@
1
+ module NukePave
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,38 @@
1
+ namespace :db do
2
+
3
+ desc "drops, creates, migrates, and seeds database"
4
+ task :nuke_pave => :environment do
5
+ unless Rails.env == "Production"
6
+ Rake::Task["db:drop"].execute
7
+ logfile = Rails.root.join("log", "#{Rails.env}.log").to_s
8
+ `rm #{logfile}`
9
+ Rake::Task["db:create"].execute
10
+ Rake::Task["db:migrate"].execute
11
+ Rake::Task["db:seed"].execute
12
+ Rake::Task["db:sample"].execute if ["development", "demo"].include?(Rails.env)
13
+ puts " --_--"
14
+ puts " ( -_ _)."
15
+ puts " ( ~ ) )"
16
+ puts " (( ) ( ) () )"
17
+ puts " (. )) ( )"
18
+ puts " ``.. ..``"
19
+ puts " | |"
20
+ puts " (=| |=)"
21
+ puts " | | "
22
+ puts " (../( )\.))"
23
+ puts "Nuke and pave of #{Rails.env} complete."
24
+ else
25
+ puts "Sorry... won't touch production."
26
+ end
27
+ end
28
+
29
+ desc "loads samples, if they exist."
30
+ task :sample => :environment do
31
+ f = File.join(Rails.root, "db", "samples.rb")
32
+ if File.exists? f
33
+ load f
34
+ else
35
+ puts "would have loaded the contents of #{f} if it existed..."
36
+ end
37
+ end
38
+ end
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nuke_pave
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - David Bock
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.2'
27
+ description: Nukes and paves your database.
28
+ email:
29
+ - dbock@codesherpas.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - MIT-LICENSE
35
+ - README.rdoc
36
+ - Rakefile
37
+ - lib/nuke_pave.rb
38
+ - lib/nuke_pave/version.rb
39
+ - lib/tasks/nuke_pave_tasks.rake
40
+ homepage: http://www.codesherpas.com
41
+ licenses:
42
+ - MIT
43
+ metadata: {}
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 2.2.2
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: Nukes and paves your database.
64
+ test_files: []