The document discusses the tools and practices used by a Ruby development team, including using RVM for managing Ruby versions and gemsets, Postgres.app for the database, Pow for local development, Git for version control, GitHub pull requests for code reviews, CircleCI for continuous integration and deployment to Heroku, Capistrano or Mina for deployment automation, and services like Rollbar and HipChat for error tracking and communication. Consistent coding styles, Sublime Text settings, and code quality practices like testing and reviews are also recommended.
3. The basics of development in a team
● A code repository
● Consistent development environment
● Code quality and code style consistency
● CI and deployment procedure
● Error tracking
● Communication
11. Postgres.app
The easiest way to get started with PostgreSQL on the Mac
rake db:create db:migrate
12. Pow: Zero-configuration Rack server for Mac OS X
$ cd ~/.pow
$ ln -s /path/to/myapp
Then just go to http://myapp.dev/ and POW, it’s
running (or maybe you forgot to run bundle install)!
13. .powrc
if [ -f "$rvm_path/scripts/rvm" ];
then
source "$rvm_path/scripts/rvm"
rvm use .
fi
15. Code style and consistency
The Ruby and RoR community is strict when it
comes to coding style and conventions!
This is really helpful for teams working on
projects, onboarding of new developers is easy.
16. Sublime Text settings
For basic stuff, there’s these Sublime settings:
● Auto-delete trailing whitespaces
● Add newlines at the end of files
This will save you a bunch of unnecessary headaches.
17. Mandatory Sublime Settings
// Set to true to removing trailing whitespace on save
"trim_trailing_white_space_on_save": true,
// Set to true to ensure the last line of the file ends in a newline
// character when saving
"ensure_newline_at_eof_on_save": true,
18. Code quality
● Code review!
● Naforo - not currently maintained :(
● Github pull requests - good enough
19. Pull Requests
When merging feature branches into master,
do it via pull requests - this provides good
basics for code review.
20. Code repository
● Git
● When pulling from origin, do it using the --
rebase option, to avoid unnecessary merge
commits
● Don’t change merge commit messages!
● Is it sometimes acceptable to do a force
push, to make the repo cleaner?
21. CI and Deployment
● Heroku - making it super simple, but has
downsides
● Mina and Capistrano
● Circle CI
22. Easy to configure, runs tests, deploys code.
Hooks up to github, so it all runs every time you
push something into the repo. Deployment
procedure descirbed in the circle.yml file.
25. Wonders of Heroku
Super easy to deploy and scale your app.
Just push into your Heroku app’s repo and it will set it up
automatically. Use $$$liders to scale up your app!
No static IP
DNS is tricky (many DNS providers don’t offer CNAME
domain records for root domains), if you need a static IP,
you’ll need to set up your own proxy or use Proximo($$$).
26. $ bundle exec cap staging deploy
$ bundle exec cap production deploy
27. Example Capistrano Task
server 'example.com', roles: [:web, :app]
server 'example.org', roles: [:db, :workers]
desc "Report Uptimes"
task :uptime do
on roles(:all) do |host|
execute :any_command, "with args", :here, "and here"
info "Host #{host} (#{host.roles.to_a.join(', ')}):t#{capture(:uptime)}"
end
end
28. Really fast deployer and server automation tool
“Mina works really fast because it’s a deploy Bash script
generator. It generates an entire procedure as a Bash
script and runs it remotely in the server”
29. Mina example deploy
$ mina deploy --verbose
-----> Creating the build path
$ mkdir tmp/build-128293482394
-----> Cloning the Git repository
$ git clone https://github.com/nadarei/flipstack.git . -n --recursive
Cloning... done.
-----> Installing gem dependencies using Bundler
$ bundle install --without development:test
Using i18n (0.6.0)
Using multi_json (1.0.4)
...
Your bundle is complete! It was installed to ./vendor/bundle
-----> Moving to releases/4
$ mv "./tmp/build-128293482394" "releases/4"
-----> Symlinking to current
$ ln -nfs releases/4 current
-----> Launching
$ cd releases/4
$ sudo service nginx restart
-----> Done. Deployed v4
30. Error Tracking
Watch those overage fees!!!
Also includes some handy performance metrics
31. WebHooks:
● github pushes
● CI - tests and deployment
● code review notifications
● error tracking
Animated GIFs!