Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update ruby/rails #228

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
379830d
Update Ruby to 2.4.4
timurvafin Sep 7, 2018
41b1a57
WIP
timurvafin Sep 7, 2018
511ba5e
Replace factory_girl -> factory_bot
ArthurZaharov Sep 7, 2018
46abf78
add jwt
ArthurZaharov Sep 7, 2018
58ef027
WIP
timurvafin Sep 7, 2018
c368f2d
Add create user endpoint
ArthurZaharov Sep 7, 2018
4bcb008
wip with profiles
ArthurZaharov Sep 7, 2018
d06e28a
generate docs
ArthurZaharov Sep 7, 2018
1c2cfdb
Use raddocs gem for api documentation
ArthurZaharov Sep 7, 2018
c7e55d0
Use spring watcher listen gem
ArthurZaharov Sep 9, 2018
01a5099
Move json schemas to v1 folder
timurvafin Sep 10, 2018
e323822
Remove unused spec
timurvafin Sep 10, 2018
45ed675
Remove unused JsonApiRequest
timurvafin Sep 10, 2018
1732e7a
Remove byebug from git history
ArthurZaharov Sep 10, 2018
faa97f1
Setup ENV vars for Heroku
timurvafin Sep 10, 2018
1cbbe25
Merge branch 'update-ruby-rails' of github.com:fs/rails-base-api into…
timurvafin Sep 10, 2018
bc60de3
Configure puma for Heroku
timurvafin Sep 10, 2018
e4b4416
Update docs
timurvafin Sep 10, 2018
864cf60
Add rack-cors
timurvafin Sep 10, 2018
f29fd6d
Generate markdown API docs only
timurvafin Sep 10, 2018
2a79e79
Errors refactor
timurvafin Sep 11, 2018
435a688
Fix quality issues
timurvafin Sep 11, 2018
12ddb5e
Rename SignUps to Registrations
timurvafin Sep 11, 2018
4d6b301
Remove auth error doc
timurvafin Sep 11, 2018
e3da962
Comment unused S3_ASSET_HOST
timurvafin Sep 12, 2018
b991dcb
Update README and remove unused gems
timurvafin Sep 12, 2018
0a489a3
Move error code to interactor
timurvafin Sep 12, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
# Add your API tokens here
# Port to serve application
PORT=5000

# Host name with PORT of the application
HOST=localhost:5000

# CORS hostnames based on https://github.com/cyu/rack-cors
# CORS_ORIGINS=

# Current environment
RACK_ENV=development
ALLOW_REQUESTS_FROM=localhost:4000
SECRET_KEY_BASE=development
# ROLLBAR_ACCESS_TOKEN=

# Base secret key
SECRET_KEY_BASE=development_secret

# Database name prefix
# DATABASE_NAME=paste_database_prefix_here

# Specify assets server host name, eg.: d2oek0c5zwe48d.cloudfront.net
ASSET_HOST=lvh.me:5000
S3_ASSET_HOST=https://d1ltghz9ehkb4n.cloudfront.net
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be commented?


# Set Rollbar key for the app
# ROLLBAR_ACCESS_TOKEN=your_key_here

# We send email using this "from" address
[email protected]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we comment it for now? We have removed devise and we do not send emails.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we have mailer settings, and most of the applications send emails. Do you think our base application should be ready to send emails out of the box?


# Enable basic auth to close the app from unauthorized viewers
# AUTH_BASIC_REALM=your_application_name
# AUTH_BASIC_PASS=your_password_here

# Set single hostname
# CANONICAL_HOST=paste_single_hostname_here

# Comma separated list of IPs to access admin staff like RackMiniProfiler, Sidekiq Web, Flipper UI
IP_WHITELIST=127.0.0.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I can see we have not this gems for now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we need to add RackMiniProfiler now?

6 changes: 6 additions & 0 deletions .erdconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# more about rails-erd config file you can find
# here: https://github.com/voormedia/rails-erd#configuration
# and here: http://voormedia.github.io/rails-erd/customise.html

filename: doc/entity-relationship
filetype: png
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ vendor/ruby
.sass-cache
._*
.env
doc/entity-relationship.png
104 changes: 104 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
require: rubocop-rspec

Rails:
Enabled: true

AllCops:
TargetRubyVersion: 2.3
DisplayCopNames: true
Exclude:
- bin/**/*
- db/**/*
- vendor/**/*
- node_modules/**/*

Rails/UnknownEnv:
Environments:
- production
- development
- test
- staging

Rails/HasManyOrHasOneDependent:
Enabled: true

Rails/HasAndBelongsToMany:
Enabled: false

Rails/OutputSafety:
Enabled: false

RSpec/MultipleExpectations:
Enabled: false

RSpec/ExampleLength:
Enabled: false

RSpec/RepeatedDescription:
Enabled: false

Capybara/FeatureMethods:
Enabled: false

RSpec/MessageSpies:
EnforcedStyle: receive

RSpec/EmptyExampleGroup:
Exclude:
- spec/api/**/*

Style/AndOr:
Enabled: false

Style/Documentation:
Enabled: false

Style/MethodCalledOnDoEndBlock:
Enabled: true

Style/CollectionMethods:
Enabled: true

Style/SymbolArray:
Enabled: true

Style/StringLiterals:
EnforcedStyle: double_quotes
ConsistentQuotesInMultiline: true

Style/EmptyMethod:
EnforcedStyle: expanded
SupportedStyles:
- compact
- expanded

Style/FrozenStringLiteralComment:
Enabled: false

Style/StringMethods:
Enabled: true

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented

Layout/AlignParameters:
EnforcedStyle: with_fixed_indentation
SupportedStyles:
- with_first_parameter
- with_fixed_indentation

Metrics/LineLength:
Max: 120

Metrics/BlockLength:
Enabled: false

Layout/EndAlignment:
EnforcedStyleAlignWith: variable
SupportedStylesAlignWith:
- keyword
- variable

Lint/AmbiguousBlockAssociation:
Exclude:
- spec/**/*
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.6
2.5.1
45 changes: 22 additions & 23 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,60 +1,59 @@
source "https://rubygems.org"

ruby "2.3.6"
ruby "2.5.1"

# the most important stuff
gem "rails", "4.2.8"
gem "pg"
gem "rails-api"
gem "rails_api_format", git: "https://github.com/fs/rails-api-format.git"
gem "rails", "5.2.1"

# all other gems
gem "active_model_serializers", git: "https://github.com/rails-api/active_model_serializers.git"
gem "active_model_serializers"
gem "bcrypt"
gem "bootsnap", require: false
gem "decent_exposure"
gem "devise"
gem "health_check"
gem "interactor"
gem "kaminari"
gem "rack-cors", require: "rack/cors"
gem "knock"
gem "puma"
gem "rack-cors"
gem "responders"
gem "rollbar"
gem "seedbank"
gem "simple_token_authentication"
gem "thin"

group :development do
gem "letter_opener"
gem "foreman"
gem "bullet"

gem "foreman"
gem "letter_opener"
gem "rails-erd"
gem "spring"
gem "spring-commands-rspec"
gem "spring-watcher-listen"
end

group :development, :test do
gem "brakeman"
gem "bundler-audit"
gem "byebug"
gem "dotenv-rails"
gem "rspec-its"
gem "rspec-rails"
gem "mail_safe"

gem "brakeman"
gem "rubocop"
gem "bundler-audit"
gem "rubocop-rspec"
end

group :test do
gem "simplecov", require: false
gem "webmock", require: false

gem "database_cleaner"
gem "email_spec"
gem "shoulda-matchers", require: false
gem "json_matchers"
gem "json_spec"
gem "rspec_api_documentation"
gem "shoulda-matchers", require: false
gem "simplecov", require: false
gem "webmock", require: false
end

group :development, :test, :staging do
gem "factory_bot_rails"
gem "faker"
gem "factory_girl_rails"
gem "rspec_api_documentation"
gem "apitome"
end
Loading