Skip to content

Commit 1d4ac7e

Browse files
committed
Merge branch 'main' into language-model-16
* main: Updated README.md (#39) Rubocop rules (#40)
2 parents 19cec14 + c644d00 commit 1d4ac7e

File tree

10 files changed

+95
-32
lines changed

10 files changed

+95
-32
lines changed

.rubocop.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
# Omakase Ruby styling for Rails
22
inherit_gem: { rubocop-rails-omakase: rubocop.yml }
33

4+
Style/TrailingCommaInArguments:
5+
EnforcedStyleForMultiline: consistent_comma
6+
Style/TrailingCommaInArrayLiteral:
7+
EnforcedStyleForMultiline: consistent_comma
8+
Style/TrailingCommaInHashLiteral:
9+
EnforcedStyleForMultiline: consistent_comma
10+
Style/StringLiterals:
11+
Enabled: true
12+
EnforcedStyle: double_quotes
13+
Include:
14+
- "app/**/*"
15+
- "config/**/*"
16+
- "lib/**/*"
17+
- "spec/**/*"
18+
- "Gemfile"
19+
Bundler/OrderedGems:
20+
Enabled: true
21+
422
# Overwrite or add rules to create your own house style
523
#
624
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ gem "bcrypt", "~> 3.1.7"
2525
gem "tzinfo-data", platforms: %i[ windows jruby ]
2626

2727
# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
28+
gem "solid_cable"
2829
gem "solid_cache"
2930
gem "solid_queue"
30-
gem "solid_cable"
3131

3232
# Reduces boot times through caching; required in config/boot.rb
3333
gem "bootsnap", require: false
@@ -47,18 +47,18 @@ group :development, :test do
4747

4848
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
4949
gem "brakeman", require: false
50+
gem "factory_bot_rails"
51+
gem "faker"
5052

5153
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
5254
gem "rubocop-rails-omakase", require: false
5355

5456
gem "rspec-rails"
55-
gem "factory_bot_rails"
56-
gem "faker"
5757
end
5858

5959
group :development do
60-
gem "hotwire-spark"
6160
gem "bullet"
61+
gem "hotwire-spark"
6262
gem "letter_opener"
6363
# Use console on exceptions pages [https://github.com/rails/web-console]
6464
gem "web-console"

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,56 @@ SkillRX is one of many projects initiated and run by Ruby for Good. You can find
1111
# Welcome Contributors!
1212
Thank you for checking out our work. We are in the process of setting up the repository, roadmap, values, and contribution guidelines for the project. We will be adding issues and putting out a call for contributions soon.
1313

14+
[Contribution guidelines for this project](CONTRIBUTING.md)
15+
16+
17+
# Install & Setup
18+
19+
Clone the codebase
20+
```
21+
git clone [email protected]:rubyforgood/skillrx.git
22+
```
23+
24+
Run the setup script to prepare DB and assets
25+
```sh
26+
bin/setup
27+
```
28+
29+
To run the app locally, use:
30+
```
31+
bin/dev
32+
```
33+
34+
To update dependencies in Gemfile, use:
35+
```
36+
bundle install
37+
```
38+
39+
You should see the seed organization by going to:
40+
```
41+
http://localhost:3000/
42+
```
43+
44+
45+
# Running specs
46+
47+
```sh
48+
# Default: Run all spec files (i.e., those matching spec/**/*_spec.rb)
49+
$ bundle exec rspec
50+
51+
# Run all spec files in a single directory (recursively)
52+
$ bundle exec rspec spec/models
53+
54+
# Run a single spec file
55+
$ bundle exec rspec spec/controllers/accounts_controller_spec.rb
56+
57+
# Run a single example from a spec file (by line number)
58+
$ bundle exec rspec spec/controllers/accounts_controller_spec.rb:8
59+
60+
# See all options for running specs
61+
$ bundle exec rspec --help
62+
```
63+
1464
# Setup
1565

1666
Clone this repo and run `bin/setup`. Run `bin/dev` or `bin/server` (if you like Overmind) to start working with app.

config/initializers/filter_parameter_logging.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Use this to limit dissemination of sensitive information.
55
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
66
Rails.application.config.filter_parameters += [
7-
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
7+
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc,
88
]

spec/models/region_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require 'rails_helper'
1+
require "rails_helper"
22

33
RSpec.describe Region, type: :model do
44
it { should validate_presence_of(:name) }

spec/rails_helper.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# This file is copied to spec/ when you run 'rails generate rspec:install'
2-
require 'spec_helper'
3-
ENV['RAILS_ENV'] ||= 'test'
4-
require_relative '../config/environment'
2+
require "spec_helper"
3+
ENV["RAILS_ENV"] ||= "test"
4+
require_relative "../config/environment"
55
# Prevent database truncation if the environment is production
66
abort("The Rails environment is running in production mode!") if Rails.env.production?
77
# Uncomment the line below in case you have `--require rails_helper` in the `.rspec` file
88
# that will avoid rails generators crashing because migrations haven't been run yet
99
# return unless Rails.env.test?
10-
require 'rspec/rails'
10+
require "rspec/rails"
1111
# Add additional requires below this line. Rails is not loaded until this point!
1212

1313
# Requires supporting ruby files with custom matchers and macros, etc, in
@@ -32,11 +32,11 @@
3232
rescue ActiveRecord::PendingMigrationError => e
3333
abort e.to_s.strip
3434
end
35-
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each(&method(:require))
35+
Dir[Rails.root.join("spec", "support", "**", "*.rb")].each(&method(:require))
3636
RSpec.configure do |config|
3737
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
3838
config.fixture_paths = [
39-
Rails.root.join('spec/fixtures')
39+
Rails.root.join("spec/fixtures"),
4040
]
4141

4242
# If you're not using ActiveRecord, or you'd prefer not to run each of your

spec/views/regions/edit.html.erb_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
require 'rails_helper'
1+
require "rails_helper"
22

33
RSpec.describe "regions/edit", type: :view do
44
let(:region) {
55
Region.create!(
6-
name: "MyString"
6+
name: "MyString",
77
)
88
}
99

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
require 'rails_helper'
1+
require "rails_helper"
22

33
RSpec.describe "regions/index", type: :view do
44
before(:each) do
5-
assign(:regions, [
6-
Region.create!(
7-
name: "Name"
8-
),
9-
Region.create!(
10-
name: "Name"
11-
)
12-
])
5+
assign(
6+
:regions,
7+
[
8+
Region.create!(name: "Name"),
9+
Region.create!(name: "Name"),
10+
],
11+
)
1312
end
1413

1514
it "renders a list of regions" do
1615
render
17-
cell_selector = 'table>tbody>tr'
16+
cell_selector = "table>tbody>tr"
1817
assert_select cell_selector, text: Regexp.new("Name".to_s), count: 2
1918
end
2019
end

spec/views/regions/new.html.erb_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
require 'rails_helper'
1+
require "rails_helper"
22

33
RSpec.describe "regions/new", type: :view do
44
before(:each) do
5-
assign(:region, Region.new(
6-
name: "MyString"
7-
))
5+
assign(:region, Region.new(name: "MyString"))
86
end
97

108
it "renders new region form" do

spec/views/regions/show.html.erb_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
require 'rails_helper'
1+
require "rails_helper"
22

33
RSpec.describe "regions/show", type: :view do
44
before(:each) do
5-
assign(:region, Region.create!(
6-
name: "Name"
7-
))
5+
assign(:region, Region.create!(name: "Name"))
86
end
97

108
it "renders attributes in <p>" do

0 commit comments

Comments
 (0)