Skip to content

Commit 3d7bf48

Browse files
committed
Some updates
1 parent 375d57b commit 3d7bf48

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

ruby_on_rails/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The application (and relative GitHub repo) will be named after the `[project-nam
1111
> Have you decided if you need two environments (develop and main) or just one?
1212
> As a rule of thumb: for customers we always use two environments, for internal projects we usually only use one.
1313
> Why the difference? Because we can bare the risk of having a bug in an internal project, but we cannot do that for a customer.
14+
> Decide with your team if you want one or two branches.
1415
1516
1. [Initialise the Rails Application](app_initialisation.md)
1617
1. [Push to Git Repository](first_git_push.md)

ruby_on_rails/app_initialisation.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@ rails new [project-name] --database=postgresql --skip-kamal --skip-ci --skip-act
2020
where the `project-name` is exactly the one you chose before.
2121

2222
> ⚠️ You may want to choose a different database than Postgres, but most of the time this will be your choice.\
23-
> If you do not need a DB you may rethink the fact that you may not need Rails at all: Take a look at [Sinatra](http://www.sinatrarb.com/) or [Angular](https://angular.io/)\
2423
> You might also need actionmailbox of course, so always double-check the parameters that you are using.
2524
2625
> ⭐️ This setup does not include either js-bundling nor css-bundling by default.\
2726
> It will start with the simplest possible Rails setup and will use sprockets and importmaps.\
2827
> If you need to do fancy stuff, discuss with your team the opportunity of including a js-bundling and css-bundling tool.\
2928
> We want to go ["no build"](https://www.youtube.com/watch?v=iqXjGiQ_D-A) whenever possible.
3029
31-
* Run `bin/setup`
32-
3330
* Run `bundle exec rails db:migrate` to generate an empty `schema.rb` file.
31+
* Run `bin/setup`
3432

35-
* Then check your default Rails setup by running `rails s` and visiting http://localhost:3000.
33+
* Then check your default Rails setup by running `bin/run` and visiting http://[project-name].localhost:3000.
3634
You should be on Rails now, yay!
3735
* Finally check if http://localhost:3000/up is green.
3836

ruby_on_rails/template.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
RUBY
99
end
1010

11+
insert_into_file "Gemfile", after: /^group :development, :test do\n/ do
12+
<<~RUBY
13+
gem "dotenv"
14+
RUBY
15+
end
16+
1117
# replace bin/rails db:prepare with bin/rails db:setup in bin/setup
1218
gsub_file "bin/setup", "bin/rails db:prepare", "bin/rails db:setup"
1319

@@ -37,6 +43,9 @@
3743
RUBOCOP
3844
end
3945

46+
create_file ".env.example", force: true
47+
create_file ".env", force: true
48+
4049
create_file "bin/run", force: true do
4150
<<~RUN
4251
#!/usr/bin/env bash

0 commit comments

Comments
 (0)