bard-rake 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +24 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/bard-rake.gemspec +57 -0
- data/lib/bard/rake.rb +61 -0
- data/spec/bard-rake_spec.rb +7 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- metadata +90 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Micah Geisel
|
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.
|
data/README.rdoc
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
= bard-rake
|
2
|
+
|
3
|
+
Rake tasks for all bard projects.
|
4
|
+
* Bootstrap projects
|
5
|
+
* Database backup
|
6
|
+
|
7
|
+
= Usage
|
8
|
+
|
9
|
+
In your Rakefile:
|
10
|
+
require 'bard/rake'
|
11
|
+
|
12
|
+
== Note on Patches/Pull Requests
|
13
|
+
|
14
|
+
* Fork the project.
|
15
|
+
* Make your feature addition or bug fix.
|
16
|
+
* Add tests for it. This is important so I don't break it in a
|
17
|
+
future version unintentionally.
|
18
|
+
* Commit, do not mess with rakefile, version, or history.
|
19
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
20
|
+
* Send me a pull request. Bonus points for topic branches.
|
21
|
+
|
22
|
+
== Copyright
|
23
|
+
|
24
|
+
Copyright (c) 2010 Micah Geisel. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "bard-rake"
|
8
|
+
gem.summary = %Q{Rake tasks for all bard projects.}
|
9
|
+
gem.description = %Q{Rake tasks for all bard projects.
|
10
|
+
* Bootstrap projects
|
11
|
+
* Database backup}
|
12
|
+
gem.email = "micah@botandrose.com"
|
13
|
+
gem.homepage = "http://github.com/botandrose/bard-rake"
|
14
|
+
gem.authors = ["Micah Geisel"]
|
15
|
+
gem.add_development_dependency "rspec", ">= 1.2.9"
|
16
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
+
end
|
18
|
+
Jeweler::GemcutterTasks.new
|
19
|
+
rescue LoadError
|
20
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
21
|
+
end
|
22
|
+
|
23
|
+
require 'spec/rake/spectask'
|
24
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
25
|
+
spec.libs << 'lib' << 'spec'
|
26
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
27
|
+
end
|
28
|
+
|
29
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
30
|
+
spec.libs << 'lib' << 'spec'
|
31
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
32
|
+
spec.rcov = true
|
33
|
+
end
|
34
|
+
|
35
|
+
task :spec => :check_dependencies
|
36
|
+
|
37
|
+
task :default => :spec
|
38
|
+
|
39
|
+
require 'rake/rdoctask'
|
40
|
+
Rake::RDocTask.new do |rdoc|
|
41
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
+
|
43
|
+
rdoc.rdoc_dir = 'rdoc'
|
44
|
+
rdoc.title = "bard-rake #{version}"
|
45
|
+
rdoc.rdoc_files.include('README*')
|
46
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
data/bard-rake.gemspec
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{bard-rake}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Micah Geisel"]
|
12
|
+
s.date = %q{2010-05-03}
|
13
|
+
s.description = %q{Rake tasks for all bard projects.
|
14
|
+
* Bootstrap projects
|
15
|
+
* Database backup}
|
16
|
+
s.email = %q{micah@botandrose.com}
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
".gitignore",
|
24
|
+
"LICENSE",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bard-rake.gemspec",
|
29
|
+
"lib/bard/rake.rb",
|
30
|
+
"spec/bard-rake_spec.rb",
|
31
|
+
"spec/spec.opts",
|
32
|
+
"spec/spec_helper.rb"
|
33
|
+
]
|
34
|
+
s.homepage = %q{http://github.com/botandrose/bard-rake}
|
35
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = %q{1.3.6}
|
38
|
+
s.summary = %q{Rake tasks for all bard projects.}
|
39
|
+
s.test_files = [
|
40
|
+
"spec/spec_helper.rb",
|
41
|
+
"spec/bard-rake_spec.rb"
|
42
|
+
]
|
43
|
+
|
44
|
+
if s.respond_to? :specification_version then
|
45
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
|
+
s.specification_version = 3
|
47
|
+
|
48
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
49
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
50
|
+
else
|
51
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
data/lib/bard/rake.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
task :restart do
|
2
|
+
system "touch tmp/restart.txt"
|
3
|
+
system "touch tmp/debug.txt" if ENV["DEBUG"] == 'true'
|
4
|
+
end
|
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'].gsub(/_/, '-')}-*.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
|
+
|
31
|
+
desc "Bootstrap project"
|
32
|
+
task :bootstrap => %w(bootstrap:files gems:install db:create db:migrate restart)
|
33
|
+
|
34
|
+
namespace :bootstrap do
|
35
|
+
desc "Bootstrap project to run tests"
|
36
|
+
task :test => :bootstrap do
|
37
|
+
system "rake gems:install db:create db:schema:load RAILS_ENV=test"
|
38
|
+
system "rake gems:install RAILS_ENV=cucumber"
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "Bootstrap project to run in production"
|
42
|
+
task :production => :bootstrap do
|
43
|
+
if File.exist?("public/stylesheets/sass") or File.exist?("app/sass")
|
44
|
+
Sass::Plugin.options[:always_update] = true;
|
45
|
+
Sass::Plugin.update_stylesheets
|
46
|
+
end
|
47
|
+
Rake::Task["asset:packager:build_all"].invoke if File.exist?("vendor/plugins/asset_packager")
|
48
|
+
end
|
49
|
+
|
50
|
+
task :files do
|
51
|
+
system "git submodule sync"
|
52
|
+
system "git submodule init"
|
53
|
+
system "git submodule update --merge"
|
54
|
+
system "git submodule foreach 'git checkout `git name-rev --name-only HEAD`'"
|
55
|
+
system "cp config/database.sample.yml config/database.yml" unless File.exist?('config/database.yml')
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
Rake::Task[:default].clear
|
60
|
+
desc "Bootstrap the current project and run the tests."
|
61
|
+
task :default => ["bootstrap:test", :spec, :cucumber]
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bard-rake
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Micah Geisel
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-05-03 00:00:00 -05:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rspec
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 2
|
30
|
+
- 9
|
31
|
+
version: 1.2.9
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
description: |-
|
35
|
+
Rake tasks for all bard projects.
|
36
|
+
* Bootstrap projects
|
37
|
+
* Database backup
|
38
|
+
email: micah@botandrose.com
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files:
|
44
|
+
- LICENSE
|
45
|
+
- README.rdoc
|
46
|
+
files:
|
47
|
+
- .document
|
48
|
+
- .gitignore
|
49
|
+
- LICENSE
|
50
|
+
- README.rdoc
|
51
|
+
- Rakefile
|
52
|
+
- VERSION
|
53
|
+
- bard-rake.gemspec
|
54
|
+
- lib/bard/rake.rb
|
55
|
+
- spec/bard-rake_spec.rb
|
56
|
+
- spec/spec.opts
|
57
|
+
- spec/spec_helper.rb
|
58
|
+
has_rdoc: true
|
59
|
+
homepage: http://github.com/botandrose/bard-rake
|
60
|
+
licenses: []
|
61
|
+
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options:
|
64
|
+
- --charset=UTF-8
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
version: "0"
|
81
|
+
requirements: []
|
82
|
+
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 1.3.6
|
85
|
+
signing_key:
|
86
|
+
specification_version: 3
|
87
|
+
summary: Rake tasks for all bard projects.
|
88
|
+
test_files:
|
89
|
+
- spec/spec_helper.rb
|
90
|
+
- spec/bard-rake_spec.rb
|