Skip to content

Commit

Permalink
Merge dddf262 into 3e1d527
Browse files Browse the repository at this point in the history
  • Loading branch information
purp committed Feb 15, 2017
2 parents 3e1d527 + dddf262 commit 3d24a73
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 42 deletions.
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--require spec_helper
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: ruby
rvm:
- 2.1.2
services:
- mysql
branches:
only:
- master
Expand All @@ -10,10 +12,13 @@ notifications:
on_failure: change
before_install:
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
before_script:
- mysql -e 'CREATE DATABASE hackweek_test;'
before_script:
- cp config/database.yml.example config/database.yml
- cp config/application.yml.example config/application.yml
- cp config/secrets.yml.example config/secrets.yml
- RAILS_ENV=test bundle exec rake db:migrate --trace
- RAILS_ENV=test bundle exec rake db:migrate --trace
env:
- TRAVIS=true
script:
- 'bundle exec rspec --color --format documentation'
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ end

# as databases
gem 'mysql2'
gem 'sqlite3' # Required for Travis-CI tests
# for stylesheets
gem 'sass-rails', '~> 5.0'
# for .js.coffee assets
Expand Down Expand Up @@ -73,6 +72,8 @@ gem 'capybara', :group => [:development, :test]
gem 'paperclip', '~> 4.1'
# as interactive debugger in error pages
gem 'web-console', '~> 2.0', group: :development
# Help with travis config testing
gem 'travis', :group => [:development, :test]

group :test do
# for cleaning the test DB
Expand Down
42 changes: 39 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
arel (6.0.4)
ast (2.0.0)
astrolabe (1.3.0)
parser (>= 2.2.0.pre.3, < 3.0)
autoprefixer-rails (5.1.7.1)
execjs
json
backports (3.6.8)
bcrypt (3.1.11)
better_errors (2.1.1)
coderay (>= 1.0.0)
Expand Down Expand Up @@ -100,6 +102,8 @@ GEM
domain_name (0.5.20160310)
unf (>= 0.0.5, < 1.0.0)
erubis (2.7.0)
ethon (0.10.1)
ffi (>= 1.3.0)
execjs (2.7.0)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
Expand All @@ -108,10 +112,22 @@ GEM
railties (>= 3.0.0)
faker (1.4.3)
i18n (~> 0.5)
faraday (0.11.0)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.11.0.1)
faraday (>= 0.7.4, < 1.0)
ffi (1.9.17)
figaro (1.1.0)
thor (~> 0.14)
font-awesome-rails (4.3.0.0)
railties (>= 3.2, < 5.0)
gh (0.15.0)
addressable (~> 2.4.0)
backports
faraday (~> 0.8)
multi_json (~> 1.0)
net-http-persistent (~> 2.9)
net-http-pipeline
globalid (0.3.7)
activesupport (>= 4.1.0)
gravtastic (3.2.6)
Expand All @@ -123,6 +139,7 @@ GEM
haml (>= 4.0.6, < 5.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
highline (1.7.8)
hirb (0.7.3)
hoptoad_notifier (2.4.11)
activesupport
Expand Down Expand Up @@ -150,6 +167,8 @@ GEM
kaminari (0.16.3)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
launchy (2.4.3)
addressable (~> 2.3)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
Expand All @@ -162,7 +181,10 @@ GEM
minitest (5.10.1)
mousetrap-rails (1.4.6)
multi_json (1.12.1)
multipart-post (2.0.0)
mysql2 (0.3.18)
net-http-persistent (2.9.4)
net-http-pipeline (1.0.1)
netrc (0.11.0)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
Expand Down Expand Up @@ -190,6 +212,9 @@ GEM
pry (~> 0.10)
pry-rails (0.3.3)
pry (>= 0.9.10)
pusher-client (0.6.2)
json
websocket (~> 1.0)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.5)
Expand Down Expand Up @@ -282,7 +307,6 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.10)
term-ansicolor (1.3.0)
tins (~> 1.0)
thinking-sphinx (3.1.3)
Expand All @@ -297,6 +321,17 @@ GEM
tilt (2.0.5)
timecop (0.7.3)
tins (1.3.5)
travis (1.8.6)
backports
faraday (~> 0.9)
faraday_middleware (~> 0.9, >= 0.9.1)
gh (~> 0.13)
highline (~> 1.6)
launchy (~> 2.1)
pusher-client (~> 0.4)
typhoeus (~> 0.6, >= 0.6.8)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.0)
Expand All @@ -311,6 +346,7 @@ GEM
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
websocket (1.2.4)
websocket-driver (0.5.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
Expand Down Expand Up @@ -360,11 +396,11 @@ DEPENDENCIES
selectize-rails
spring
spring-commands-rspec
sqlite3
thinking-sphinx
timecop
travis
uglifier (>= 1.3.0)
web-console (~> 2.0)

BUNDLED WITH
1.11.2
1.12.5
40 changes: 19 additions & 21 deletions config/database.yml.example
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
15 changes: 0 additions & 15 deletions config/database.yml.vagrant

This file was deleted.

51 changes: 51 additions & 0 deletions lib/tasks/dev.rake
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

0 comments on commit 3d24a73

Please sign in to comment.