“strive 7/31 ~ 8/6”
Use
-
[Gem] vcr
- For test, it could record real third party response to yml file
- Use it with webmock’s body
-
[Gem] webmock
-
[Gem] rubocop
- rubocop –auto-correct
-
[Gem] webmock
- If you use multiple sidekiq processes then you can specify limits per process
-
[Gem] figaro
- Figaro was written to make it easy to securely configure Rails applications.
-
[Gem] docker-api
-
[Gem] active_type
- ActiveType is our take on “presenter models” (or “form models”) in Rails. We want to have controllers (and forms) talk to models that are either not backed by a database table
-
[Gem] png_quantizator
- PngQuantizator is a little wrapper around pngquant
Read
-
[Ruby] Partial Downloads with Enumerators and Fibers
- before download, need to verify MIME type
- use Enumerators and Fiber to execute streaming downlaod
-
[Ruby] Ruby on Rails 基本主義en
-
[Ruby] A Review of Code Reloaders for Ruby
- Different Code Reloaders
-
[Ruby] Rbenv — How it works
-
[Ruby] Hiding secrets in a Vault
- Using Vault, Github authentication and ‘secrets’ gem to make secret files more secure.
-
[Ruby] New Features in Ruby 2.4
-
[Ruby] respond_to |format| is useful even without multiple formats
- benefit of respond_to
-
[Ruby] CONSIDER TURBOLINKS 5 FOR YOUR NEXT RAILS PROJECT
- Turbolinks 5 is a library for web applications that makes pages load faster
-
[Rspec] rspec described_class
- If the first argument to the outermost example group is a class, the class is exposed to each example via the described_class() method
-
[Ruby] run_callbacks
-
[Ruby] http://www.justinweiss.com/articles/the-lesser-known-features-in-rails-4-dot-2/
- Easily load config files => Rails.application.config_for(‘yml file name’)
-
[Ruby] The Recipe for the World's Largest Rails Monolith
- Many handmade tools
-
[Ruby] RSpec 中let 和subject 的區別是什麼?
- 主要語意的差別, subject主角, let配角
Book
-
on page 286
-
on page 172
Work design
-
API Architecture
-
Design
- client auth: follow aws, use current timestamp + private key as checksum, server need to verify checksum, also need to make sure timestamp in some duration (like 10 mins)
- user auth: logined user will have one or more token. use token as key, value is user id, and set expired time on every token, save them on redis, so when client send token, server could know the current user.
- error handler:
- one config, record key, status code of error, error message use key for i18n.
- every api action has its service object, when render api error will raise specific exception class and error key,this exception will rescue from base controller, and according error key to error render. All the data format will be the same, the different are message, key, status code
– learned from MarsZ
-
Implement
- controller only handle flow, other through service.
- use value object to handle user session, due to operation very like model CRUD, so use value, and base is redis hash
- exception only on controller raise, service use active model save error message, when return false, we could get error message from service and raise with exception class
-
** Learn **
- feature driven coding
- every commit with small main part of the feature
- service with callback
- exceptio class
- every concerns only focus one thing
- RSpec from base stack
- how to use service to architecture base of whole application
- feature driven coding