bard 0.8.26 → 0.8.27

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.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/bard.gemspec +2 -2
  3. data/lib/bard/rake.rb +25 -0
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.26
1
+ 0.8.27
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bard}
8
- s.version = "0.8.26"
8
+ s.version = "0.8.27"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Micah Geisel", "Nick Hogle"]
12
- s.date = %q{2010-03-09}
12
+ s.date = %q{2010-03-11}
13
13
  s.default_executable = %q{bard}
14
14
  s.description = %q{This immaculate work of engineering genius allows mere mortals to collaborate with beings of transcendent intelligence like Micah, Michael, and Nick.}
15
15
  s.email = %q{info@botandrose.com}
@@ -3,6 +3,31 @@ task :restart do
3
3
  system "touch tmp/debug.txt" if ENV["DEBUG"] == 'true'
4
4
  end
5
5
 
6
+ namespace :db do
7
+ desc "Dump the current database to db/data.sql"
8
+ task :dump => :"backup:db" do
9
+ config = ActiveRecord::Base.configurations[RAILS_ENV || 'development']
10
+ db_file = Dir.glob("../#{config['database']}-*.sql").first
11
+ FileUtils.move db_file, "db/data.sql"
12
+ end
13
+
14
+ desc "Load the db/data.sql data into the current database."
15
+ task :load => :environment do
16
+ config = ActiveRecord::Base.configurations[RAILS_ENV || 'development']
17
+ Rake::Task["db:drop"].invoke
18
+ Rake::Task["db:create"].invoke
19
+ mysql = `which mysql`.strip
20
+ options = " -u#{config['username']}"
21
+ options += " -p#{config['password']}" if config['password']
22
+ options += " -h #{config['host']}" if config['host']
23
+
24
+ raise RuntimeError, "I only work with mysql." unless config['adapter'] == 'mysql'
25
+ raise RuntimeError, "Cannot find mysql." if mysql.blank?
26
+
27
+ sh "#{mysql} #{options} '#{config["database"]}' < db/data.sql"
28
+ end
29
+ end
30
+
6
31
  desc "Bootstrap project"
7
32
  task :bootstrap => %w(bootstrap:files gems:install db:create db:migrate restart)
8
33
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.26
4
+ version: 0.8.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-03-09 00:00:00 -08:00
13
+ date: 2010-03-11 00:00:00 -08:00
14
14
  default_executable: bard
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency