bard-rake 0.11.0 → 0.12.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bdd3cd36716893dfc28cc922187887d00af94a66
4
- data.tar.gz: bd7655840946b7dd07d4c0b8fd26b22d3f04e525
3
+ metadata.gz: dd0800d5bb47d5e38f50d968b029a25310b4050e
4
+ data.tar.gz: f095dfe1483e924e3aac8b34fc6cf96cfd3a54ec
5
5
  SHA512:
6
- metadata.gz: 97c05cac63774a679d646e872ff9a610ac4c28e0e562ba36de0ecc6595a98241cfd0ac41410304a75b77da42e2c4f5635dfb9ff102c6dea87f164f075ce59c06
7
- data.tar.gz: 6ad11af9408b642bab82acbf584730da4f640f7e5465478c6cf34af03d7a8a50f82cc8e30aa8f4b8d395cec311bcbf666a7c16d2be2ace134af35c30e861ecb6
6
+ metadata.gz: 5bcc580341d4d8d4c45b38fbc0eef9867ca068edb80a4b57335e7eead0753193c1df05ffcb760102f324605fbfb03e84aafd636861e2f001e0ca5451b683fca9
7
+ data.tar.gz: a45b285dba1faeb0f1e3a67697229fc97557f0655ef18db424631390299d5a4793180fdf67463f943ac9e97ba4feb278e74f7d8592c2da7bc127dd85c7ac7dce
data/bard-rake.gemspec CHANGED
@@ -4,7 +4,7 @@ require 'bard/rake/version'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "bard-rake"
7
- spec.version = BardRake::VERSION
7
+ spec.version = Bard::Rake::VERSION
8
8
  spec.authors = ["Micah Geisel"]
9
9
  spec.email = ["micah@botandrose.com"]
10
10
  spec.description = "Rake tasks for all bard projects.\n* Bootstrap projects\n* Database backup"
data/lib/bard/rake.rb CHANGED
@@ -7,5 +7,5 @@ def invoke_task_if_exists task_name
7
7
  Rake::Task[task_name].invoke if Rake::Task.task_defined? task_name
8
8
  end
9
9
 
10
- module BardRake
10
+ module Bard::Rake
11
11
  end
@@ -1,100 +1,102 @@
1
1
  namespace :db do
2
2
  desc "Dump the current database to db/data.sql"
3
3
  task :dump => :environment do
4
- klass = adapter_from_config BardRake.database_config
4
+ klass = adapter_from_config Bard::Rake.database_config
5
5
  klass.dump
6
6
  end
7
7
 
8
8
  desc "Load the db/data.sql data into the current database."
9
9
  task :load => ["db:drop:current", "db:create:current"] do
10
- klass = adapter_from_config BardRake.database_config
10
+ klass = adapter_from_config Bard::Rake.database_config
11
11
  klass.load
12
12
  end
13
13
 
14
14
  def adapter_from_config config
15
- "BardRake::#{config["adapter"].camelize}".constantize
15
+ "Bard::Rake::#{config["adapter"].camelize}".constantize
16
16
  end
17
17
  end
18
18
 
19
- module BardRake
20
- FILE_PATH = "db/data.sql"
19
+ module Bard
20
+ module Rake
21
+ FILE_PATH = "db/data.sql"
21
22
 
22
- def self.database_config
23
- @config ||= ActiveRecord::Base.configurations[Rails.env || "development"]
24
- end
23
+ def self.database_config
24
+ @config ||= ActiveRecord::Base.configurations[Rails.env || "development"]
25
+ end
25
26
 
26
- class Sqlite3
27
- class << self
28
- include Rake::DSL
27
+ class Sqlite3
28
+ class << self
29
+ include ::Rake::DSL
29
30
 
30
- def dump
31
- FileUtils.cp database, FILE_PATH
32
- end
31
+ def dump
32
+ FileUtils.cp database, FILE_PATH
33
+ end
33
34
 
34
- def load
35
- FileUtils.cp FILE_PATH, database
36
- end
35
+ def load
36
+ FileUtils.cp FILE_PATH, database
37
+ end
37
38
 
38
- private
39
+ private
39
40
 
40
- def database
41
- BardRake.database_config["database"]
41
+ def database
42
+ Bard::Rake.database_config["database"]
43
+ end
42
44
  end
43
45
  end
44
- end
45
46
 
46
- class Postgresql
47
- class << self
48
- include Rake::DSL
47
+ class Postgresql
48
+ class << self
49
+ include ::Rake::DSL
49
50
 
50
- def dump
51
- pg_dump = `which pg_dump`.strip
52
- raise RuntimeError, "Cannot find pg_dump." if pg_dump.blank?
53
- sh "#{pg_dump} -f#{FILE_PATH} #{database}"
54
- end
51
+ def dump
52
+ pg_dump = `which pg_dump`.strip
53
+ raise RuntimeError, "Cannot find pg_dump." if pg_dump.blank?
54
+ sh "#{pg_dump} -f#{FILE_PATH} #{database}"
55
+ end
55
56
 
56
- def load
57
- psql = `which psql`.strip
58
- raise RuntimeError, "Cannot find psql." if psql.blank?
59
- sh "#{psql} -q -d#{database} -f#{FILE_PATH}"
60
- end
57
+ def load
58
+ psql = `which psql`.strip
59
+ raise RuntimeError, "Cannot find psql." if psql.blank?
60
+ sh "#{psql} -q -d#{database} -f#{FILE_PATH}"
61
+ end
61
62
 
62
- private
63
+ private
63
64
 
64
- def database
65
- BardRake.database_config["database"]
65
+ def database
66
+ Bard::Rake.database_config["database"]
67
+ end
66
68
  end
67
69
  end
68
- end
69
70
 
70
- class Mysql
71
- class << self
72
- include Rake::DSL
73
-
74
- def dump
75
- mysqldump = `which mysqldump`.strip
76
- raise RuntimeError, "Cannot find mysqldump." if mysqldump.blank?
77
- sh "#{mysqldump} --single-transaction --quick --add-drop-database --databases -e #{mysql_options} > #{FILE_PATH}"
78
- end
79
-
80
- def load
81
- mysql = `which mysql`.strip
82
- raise RuntimeError, "Cannot find mysql." if mysql.blank?
83
- sh "#{mysql} #{mysql_options} < #{FILE_PATH}"
84
- end
85
-
86
- private
87
-
88
- def mysql_options
89
- config = BardRake.database_config
90
- options = " -u #{config["username"]}"
91
- options += " -p'#{config["password"]}'" if config["password"]
92
- options += " -h #{config["host"]}" if config["host"]
93
- options += " -S #{config["socket"]}" if config["socket"]
94
- options += " '#{config["database"]}'"
71
+ class Mysql
72
+ class << self
73
+ include ::Rake::DSL
74
+
75
+ def dump
76
+ mysqldump = `which mysqldump`.strip
77
+ raise RuntimeError, "Cannot find mysqldump." if mysqldump.blank?
78
+ sh "#{mysqldump} --single-transaction --quick --add-drop-database --databases -e #{mysql_options} > #{FILE_PATH}"
79
+ end
80
+
81
+ def load
82
+ mysql = `which mysql`.strip
83
+ raise RuntimeError, "Cannot find mysql." if mysql.blank?
84
+ sh "#{mysql} #{mysql_options} < #{FILE_PATH}"
85
+ end
86
+
87
+ private
88
+
89
+ def mysql_options
90
+ config = Bard::Rake.database_config
91
+ options = " -u #{config["username"]}"
92
+ options += " -p'#{config["password"]}'" if config["password"]
93
+ options += " -h #{config["host"]}" if config["host"]
94
+ options += " -S #{config["socket"]}" if config["socket"]
95
+ options += " '#{config["database"]}'"
96
+ end
95
97
  end
96
98
  end
97
- end
98
99
 
99
- Mysql2 = Mysql
100
+ Mysql2 = Mysql
101
+ end
100
102
  end
@@ -1,7 +1,9 @@
1
- module BardRake
2
- class Railtie < Rails::Engine
3
- rake_tasks do
4
- load "bard/rake.rb"
5
- end
1
+ module Bard
2
+ module Rake
3
+ class Railtie < Rails::Engine
4
+ rake_tasks do
5
+ load "bard/rake.rb"
6
+ end
7
+ end
6
8
  end
7
9
  end
@@ -1,4 +1,6 @@
1
- module BardRake
2
- VERSION = "0.11.0"
1
+ module Bard
2
+ module Rake
3
+ VERSION = "0.12.0"
4
+ end
3
5
  end
4
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard-rake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-12 00:00:00.000000000 Z
11
+ date: 2013-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -70,7 +70,6 @@ files:
70
70
  - README.md
71
71
  - README.rdoc
72
72
  - Rakefile
73
- - VERSION
74
73
  - bard-rake.gemspec
75
74
  - lib/bard-rake.rb
76
75
  - lib/bard/rake.rb
@@ -80,9 +79,6 @@ files:
80
79
  - lib/bard/rake/railtie.rb
81
80
  - lib/bard/rake/testing.rb
82
81
  - lib/bard/rake/version.rb
83
- - spec/bard-rake_spec.rb
84
- - spec/spec.opts
85
- - spec/spec_helper.rb
86
82
  homepage: http://github.com/botandrose/bard-rake
87
83
  licenses:
88
84
  - MIT
@@ -107,7 +103,4 @@ rubygems_version: 2.1.10
107
103
  signing_key:
108
104
  specification_version: 4
109
105
  summary: Rake tasks for all bard projects.
110
- test_files:
111
- - spec/bard-rake_spec.rb
112
- - spec/spec.opts
113
- - spec/spec_helper.rb
106
+ test_files: []
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.10.6
@@ -1,7 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "BardRake" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
6
- end
7
- end
data/spec/spec.opts DELETED
@@ -1 +0,0 @@
1
- --color
data/spec/spec_helper.rb DELETED
@@ -1,9 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- require 'bard-rake'
4
- require 'spec'
5
- require 'spec/autorun'
6
-
7
- Spec::Runner.configure do |config|
8
-
9
- end