bard-rake 0.4.0 → 0.4.1

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-rake.gemspec +10 -8
  3. data/lib/bard/rake/db.rb +40 -32
  4. metadata +7 -5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
data/bard-rake.gemspec CHANGED
@@ -4,14 +4,16 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "bard-rake"
8
- s.version = "0.4.0"
7
+ s.name = %q{bard-rake}
8
+ s.version = "0.4.1"
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"]
12
- s.date = "2011-12-12"
13
- s.description = "Rake tasks for all bard projects.\n* Bootstrap projects\n* Database backup"
14
- s.email = "micah@botandrose.com"
12
+ s.date = %q{2012-01-09}
13
+ s.description = %q{Rake tasks for all bard projects.
14
+ * Bootstrap projects
15
+ * Database backup}
16
+ s.email = %q{micah@botandrose.com}
15
17
  s.extra_rdoc_files = [
16
18
  "LICENSE",
17
19
  "README.rdoc"
@@ -33,10 +35,10 @@ Gem::Specification.new do |s|
33
35
  "spec/spec.opts",
34
36
  "spec/spec_helper.rb"
35
37
  ]
36
- s.homepage = "http://github.com/botandrose/bard-rake"
38
+ s.homepage = %q{http://github.com/botandrose/bard-rake}
37
39
  s.require_paths = ["lib"]
38
- s.rubygems_version = "1.8.12"
39
- s.summary = "Rake tasks for all bard projects."
40
+ s.rubygems_version = %q{1.6.2}
41
+ s.summary = %q{Rake tasks for all bard projects.}
40
42
 
41
43
  if s.respond_to? :specification_version then
42
44
  s.specification_version = 3
data/lib/bard/rake/db.rb CHANGED
@@ -24,47 +24,55 @@ module BardRake
24
24
  end
25
25
 
26
26
  class Postgresql
27
- def self.dump
28
- pg_dump = `which pg_dump`.strip
29
- raise RuntimeError, "Cannot find pg_dump." if pg_dump.blank?
30
- sh "#{pg_dump} -f#{FILE_PATH} #{database}"
31
- end
27
+ class << self
28
+ include Rake::DSL
32
29
 
33
- def self.load
34
- psql = `which psql`.strip
35
- raise RuntimeError, "Cannot find psql." if psql.blank?
36
- sh "#{psql} -q -d#{database} -f#{FILE_PATH}"
37
- end
30
+ def dump
31
+ pg_dump = `which pg_dump`.strip
32
+ raise RuntimeError, "Cannot find pg_dump." if pg_dump.blank?
33
+ sh "#{pg_dump} -f#{FILE_PATH} #{database}"
34
+ end
35
+
36
+ def load
37
+ psql = `which psql`.strip
38
+ raise RuntimeError, "Cannot find psql." if psql.blank?
39
+ sh "#{psql} -q -d#{database} -f#{FILE_PATH}"
40
+ end
38
41
 
39
- private
42
+ private
40
43
 
41
- def self.database
42
- BardRake.database_config["database"]
44
+ def database
45
+ BardRake.database_config["database"]
46
+ end
43
47
  end
44
48
  end
45
49
 
46
50
  class Mysql
47
- def self.dump
48
- mysqldump = `which mysqldump`.strip
49
- raise RuntimeError, "Cannot find mysqldump." if mysqldump.blank?
50
- sh "#{mysqldump} -e #{mysql_options} > #{FILE_PATH}"
51
- end
51
+ class << self
52
+ include Rake::DSL
52
53
 
53
- def self.load
54
- mysql = `which mysql`.strip
55
- raise RuntimeError, "Cannot find mysql." if mysql.blank?
56
- sh "#{mysql} #{mysql_options} < #{FILE_PATH}"
57
- end
54
+ def dump
55
+ mysqldump = `which mysqldump`.strip
56
+ raise RuntimeError, "Cannot find mysqldump." if mysqldump.blank?
57
+ sh "#{mysqldump} -e #{mysql_options} > #{FILE_PATH}"
58
+ end
59
+
60
+ def load
61
+ mysql = `which mysql`.strip
62
+ raise RuntimeError, "Cannot find mysql." if mysql.blank?
63
+ sh "#{mysql} #{mysql_options} < #{FILE_PATH}"
64
+ end
58
65
 
59
- private
60
-
61
- def self.mysql_options
62
- config = BardRake.database_config
63
- options = " -u #{config["username"]}"
64
- options += " -p'#{config["password"]}'" if config["password"]
65
- options += " -h #{config["host"]}" if config["host"]
66
- options += " -S #{config["socket"]}" if config["socket"]
67
- options += " '#{config["database"]}'"
66
+ private
67
+
68
+ def mysql_options
69
+ config = BardRake.database_config
70
+ options = " -u #{config["username"]}"
71
+ options += " -p'#{config["password"]}'" if config["password"]
72
+ options += " -h #{config["host"]}" if config["host"]
73
+ options += " -S #{config["socket"]}" if config["socket"]
74
+ options += " '#{config["database"]}'"
75
+ end
68
76
  end
69
77
  end
70
78
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-rake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 0
10
- version: 0.4.0
9
+ - 1
10
+ version: 0.4.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Micah Geisel
@@ -15,7 +15,8 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-12 00:00:00 Z
18
+ date: 2012-01-09 00:00:00 -08:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rspec
@@ -61,6 +62,7 @@ files:
61
62
  - spec/bard-rake_spec.rb
62
63
  - spec/spec.opts
63
64
  - spec/spec_helper.rb
65
+ has_rdoc: true
64
66
  homepage: http://github.com/botandrose/bard-rake
65
67
  licenses: []
66
68
 
@@ -90,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
92
  requirements: []
91
93
 
92
94
  rubyforge_project:
93
- rubygems_version: 1.8.12
95
+ rubygems_version: 1.6.2
94
96
  signing_key:
95
97
  specification_version: 3
96
98
  summary: Rake tasks for all bard projects.