Skip to content

Commit bb376e7

Browse files
committed
Updates to the setup script
Reason for Change ================= * I was trying to get the app setup locally and ran into some issues. * I usually look to `bin/setup` for all of the required info, some of the steps were missing. Changes ======= * Removed some info in `README.md` and moved it into the `bin/setup` script * Added the yarn setup task to the setup script * Run the specs at the end of the setup script to ensure all is well * Added a note about Google Chrome needing to be installed Minor ===== * Specify the Ruby version in one place, `.ruby-version` and have the `Gemfile` look for it there * Store rspec results in `/tmp` for reuse with things like `rspec --only-failures`
1 parent 3795a1c commit bb376e7

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

Gemfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# frozen_string_literal: true
22

33
source 'https://rubygems.org'
4-
ruby '2.7.4'
4+
5+
# https://andycroll.com/ruby/read-ruby-version-in-your-gemfile/
6+
ruby File.read(".ruby-version").strip
57

68
gem 'puma'
79
gem 'rails', '~> 6.1.0'

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ The CFP App does not provide a public facing website for your conference, though
1818

1919
### Prerequisite Requirements
2020

21-
* Ruby 2.7.2
22-
* Bundler (was installed with 2.1.4)
23-
* PostgreSQL
21+
* Ruby 2.7.4 (set in `.ruby-version`)
22+
* Bundler (was installed with 2.2.15)
23+
* PostgreSQL 14.1
24+
* Google Chrome browser must be installed to run tests
2425

2526
Make sure you have Ruby and Postgres installed in your environment. Double check in the [Gemfile](../blob/master/Gemfile) for the exact supported version. This is a Rails 6 app and uses bundler to install all required gems. We are also making the assumption that you're familiar with how Rails apps are setup and deployed. If this is not the case then you'll want to refer to documentation that will bridge any gaps in the instructions below.
2627

@@ -30,29 +31,28 @@ Run [bin/setup](bin/setup) script to install gem dependencies and setup database
3031
bin/setup
3132
```
3233

33-
This will create `.env` and a development database with seed data. Seeds will make an admin user with an email of `[email protected]` and password of `userpass` to get you started.
34+
This script will:
3435

35-
You will also need to install the JavaScript packages. To do that run:
36+
- Install Ruby dependencies
37+
- Install Javascript dependencies
38+
- Setup the database
39+
- Clear old logs and tempfiles
40+
- Create `.env` and a development database with seed data. Seeds will make an admin user with an email of `[email protected]` and password of `userpass` to get you started
41+
- Run the test suite
3642

37-
```bash
38-
yarn install --check-files
39-
```
40-
41-
Start the server:
43+
To start the server on port 3000:
4244

4345
```bash
4446
bin/rails server
4547
```
4648

47-
Runs on port 3000.
48-
4949
If you have the heroku toolbelt installed you can also use:
5050

5151
```bash
5252
heroku local
5353
```
5454

55-
This will boot up using Foreman and allow the .env file to be read / set for use locally. Runs on port 5000.
55+
This will boot up using Foreman and allow the `.env` file to be read / set for use locally. Runs on port 5000.
5656

5757
### Environment variables
5858

bin/setup

+5-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,8 @@ FileUtils.chdir APP_ROOT do
1717
system! 'gem install bundler --conservative'
1818
system('bundle check') || system!('bundle install')
1919

20-
# Install JavaScript dependencies
21-
# system('bin/yarn')
22-
23-
# puts "\n== Copying sample files =="
24-
# unless File.exist?('config/database.yml')
25-
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
26-
# end
20+
puts "\n== Installing JavaScript dependencies =="
21+
system! 'yarn install --check-files'
2722

2823
puts "\n== Preparing database =="
2924
system! 'bin/rails db:prepare'
@@ -33,4 +28,7 @@ FileUtils.chdir APP_ROOT do
3328

3429
puts "\n== Restarting application server =="
3530
system! 'bin/rails restart'
31+
32+
puts "\n== Run the tests =="
33+
system! 'bin/rspec'
3634
end

spec/spec_helper.rb

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
config.raise_errors_for_deprecations!
2121
config.filter_run :focus
2222
config.run_all_when_everything_filtered = true
23+
config.example_status_persistence_file_path = "tmp/examples.txt"
2324
=begin
2425
# These two settings work together to allow you to limit a spec run
2526
# to individual examples or groups you care about by tagging them with

0 commit comments

Comments
 (0)