-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
120 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
# SQLite version 3.x | ||
# gem install sqlite3 | ||
# | ||
# Ensure the SQLite 3 gem is defined in your Gemfile | ||
# gem 'sqlite3' | ||
<% | ||
if ENV['TRAVIS'] | ||
username = "travis" | ||
else | ||
username = "root" | ||
password = "hackweek" | ||
end | ||
%> | ||
|
||
vagrant: &vagrant | ||
adapter: mysql2 | ||
encoding: utf8 | ||
username: <%= username %> | ||
password: <%= password %> | ||
|
||
development: | ||
adapter: sqlite3 | ||
database: db/development.sqlite3 | ||
<<: *vagrant | ||
database: hackweek_development | ||
pool: 5 | ||
timeout: 5000 | ||
|
||
# Warning: The database defined as "test" will be erased and | ||
# re-generated from your development database when you run "rake". | ||
# Do not set this db to the same as development or production. | ||
test: | ||
adapter: sqlite3 | ||
database: db/test.sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
|
||
production: | ||
adapter: sqlite3 | ||
database: db/production.sqlite3 | ||
pool: 5 | ||
timeout: 5000 | ||
<<: *vagrant | ||
database: hackweek_test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Don't add any includes that aren't in the Ruby std-lib here, | ||
# If you do, dev:bootstrap will fail on bundle:install | ||
|
||
require 'find' | ||
|
||
class String | ||
def red | ||
"\e[0;31;49m#{self}\e[0m" | ||
end | ||
|
||
def green | ||
"\e[0;32;49m#{self}\e[0m" | ||
end | ||
end | ||
|
||
namespace :dev do | ||
file_task_names = [] | ||
|
||
%w(application database secrets).each do |example_base| | ||
config_file = Rails.root.join('config', "#{example_base}.yml") | ||
config_example = Rails.root.join('config', "#{example_base}.yml.example") | ||
t = Rake::FileTask.define_task(config_file => config_example) | ||
file_task_names << t.name | ||
end | ||
|
||
desc "copy example config files into place if they aren't already" | ||
task copy_sample_configs: file_task_names | ||
|
||
desc 'install gems using Bundler' | ||
task :bundle_install do | ||
sh 'bundle install' | ||
end | ||
|
||
desc 'check for searchd' | ||
task :require_searchd do | ||
found = false | ||
|
||
ENV['PATH'].split(':').each do |path| | ||
next unless File.exists?(path) | ||
found = !Find.find(path).select {|f| f.match(/\bsearchd$/) && File.executable?(f)}.empty? | ||
break if found | ||
end | ||
|
||
fail "Can't find searchd for Sphinx. Please install or add to PATH.".red unless found | ||
end | ||
|
||
desc 'bootstrap development environment' | ||
task bootstrap: %w(copy_sample_configs bundle_install db:create db:migrate db:seed require_searchd ts:regenerate ts:index) do | ||
puts "\n\nCongrats! You should be all set to start hacking.".green | ||
end | ||
end |