diff --git a/.gitignore b/.gitignore index 37da9d7..5633da2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,14 @@ +# OS Files +.DS_Store +.DS_Store? +._* +.Trashes +ehthumbs.db +Thumbs.db + +# Other _site .sass-cache .jekyll-metadata .idea/* -.DS_Store +*.log diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 2bf1c1c..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.3.1 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7e3cd06 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# CHANGELOG + +## 1.0.0 - Initial Public Release + +Release Tag: v1.0.0 \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..821bd76 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# Contributing + +So you want to contribute to this document? Awesome! We openly accept collaboration and want your help! + +There's two ways you can contribute to this repository: + +1. Get access from @sumpygump, create a branch and issue a [Pull Request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request). +1. Make a fork and then issue a [Pull Request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) + +Thanks for any support or contributions you might want to make! We appreciate the interest and will be happy to take your thoughts into consideration. \ No newline at end of file diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 02eda2b..0000000 --- a/Gemfile +++ /dev/null @@ -1,9 +0,0 @@ -source 'https://rubygems.org' - -ruby '2.3.1' - -require 'json' -require 'open-uri' -versions = JSON.parse(open('https://pages.github.com/versions.json').read) -gem 'github-pages', versions['github-pages'] -gem 'jekyll' diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 6c6f4e0..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,144 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - activesupport (4.2.7) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.4.0) - coffee-script (2.4.1) - coffee-script-source - execjs - coffee-script-source (1.10.0) - colorator (1.1.0) - ethon (0.9.1) - ffi (>= 1.3.0) - execjs (2.7.0) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - ffi (1.9.14) - forwardable-extended (2.6.0) - gemoji (2.1.0) - github-pages (97) - activesupport (= 4.2.7) - github-pages-health-check (= 1.2.0) - jekyll (= 3.2.1) - jekyll-coffeescript (= 1.0.1) - jekyll-feed (= 0.5.1) - jekyll-gist (= 1.4.0) - jekyll-github-metadata (= 2.1.0) - jekyll-mentions (= 1.2.0) - jekyll-paginate (= 1.1.0) - jekyll-redirect-from (= 0.11.0) - jekyll-sass-converter (= 1.3.0) - jekyll-seo-tag (= 2.0.0) - jekyll-sitemap (= 0.10.0) - jekyll-swiss (= 0.4.0) - jemoji (= 0.7.0) - kramdown (= 1.11.1) - liquid (= 3.0.6) - listen (= 3.0.6) - mercenary (~> 0.3) - minima (= 1.2.0) - rouge (= 1.11.1) - terminal-table (~> 1.4) - github-pages-health-check (1.2.0) - addressable (~> 2.3) - net-dns (~> 0.8) - octokit (~> 4.0) - public_suffix (~> 1.4) - typhoeus (~> 0.7) - html-pipeline (2.4.2) - activesupport (>= 2) - nokogiri (>= 1.4) - i18n (0.7.0) - jekyll (3.2.1) - colorator (~> 1.0) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (~> 1.7) - safe_yaml (~> 1.0) - jekyll-coffeescript (1.0.1) - coffee-script (~> 2.2) - jekyll-feed (0.5.1) - jekyll-gist (1.4.0) - octokit (~> 4.2) - jekyll-github-metadata (2.1.0) - jekyll (~> 3.1) - octokit (~> 4.0) - jekyll-mentions (1.2.0) - activesupport (~> 4.0) - html-pipeline (~> 2.3) - jekyll (~> 3.0) - jekyll-paginate (1.1.0) - jekyll-redirect-from (0.11.0) - jekyll (>= 2.0) - jekyll-sass-converter (1.3.0) - sass (~> 3.2) - jekyll-seo-tag (2.0.0) - jekyll (~> 3.1) - jekyll-sitemap (0.10.0) - jekyll-swiss (0.4.0) - jekyll-watch (1.5.0) - listen (~> 3.0, < 3.1) - jemoji (0.7.0) - activesupport (~> 4.0) - gemoji (~> 2.0) - html-pipeline (~> 2.2) - jekyll (>= 3.0) - json (1.8.3) - kramdown (1.11.1) - liquid (3.0.6) - listen (3.0.6) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9.7) - mercenary (0.3.6) - mini_portile2 (2.1.0) - minima (1.2.0) - minitest (5.9.1) - multipart-post (2.0.0) - net-dns (0.8.0) - nokogiri (1.6.8.1) - mini_portile2 (~> 2.1.0) - octokit (4.3.0) - sawyer (~> 0.7.0, >= 0.5.3) - pathutil (0.14.0) - forwardable-extended (~> 2.6) - public_suffix (1.5.3) - rb-fsevent (0.9.7) - rb-inotify (0.9.7) - ffi (>= 0.5.0) - rouge (1.11.1) - safe_yaml (1.0.4) - sass (3.4.22) - sawyer (0.7.0) - addressable (>= 2.3.5, < 2.5) - faraday (~> 0.8, < 0.10) - terminal-table (1.7.3) - unicode-display_width (~> 1.1.1) - thread_safe (0.3.5) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.2) - thread_safe (~> 0.1) - unicode-display_width (1.1.1) - -PLATFORMS - ruby - -DEPENDENCIES - github-pages (= 97) - jekyll - json - -RUBY VERSION - ruby 2.3.1p112 - -BUNDLED WITH - 1.12.5 diff --git a/README.md b/README.md index 5734e1f..7e144a8 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,33 @@ ---- -layout: page -title: README -author: The Nerdery Ruby Standards Task Force ---- +# The Nerdery Ruby on Rails Coding Standards -# Introduction +## Table of Contents + 1. [Overview](#overview) + 1. [Ruby Best Practices](/standards/ruby.md#ruby) + 1. [Rails Best Practices](/standards/rails.md#rails) + 1. [Testing Best Practices](/standards/testing.md#testing) + 1. [Source Control](/standards/source-control.md#source-control) + 1. [3rd Party Gems](/standards/third-party.md#gems) + 1. [3rd Party Services](/standards/third-party.md#services) + 1. [Deployment](/standards/deployment.md#deployment) + 1. [Documentation](/standards/documentation.md#documentation) + 1. [Learning Resources](/standards/learning-resources.md#resources) + 1. [Changelog](/CHANGELOG.md) -This small Jekyll-based site houses the Ruby Standards used by developers at The Nerdery. If you're a Nerdery developer, you should totally know these standards by heart. If not? This is a great place to learn some (at least we think) awesome best practices. +## Overview -# Contributing +Our goal in the creation of this document is to not only improve consistency, but to also allow newer developers joining our discipline to have an easy to use reference point. Consistency is a key element of software quality and without it all of our efforts eventually turn to spaghetti. -There's two ways you can contribute to this repository: +Today at The Nerdery, the Ruby discipline is effectively the Ruby on Rails discipline. We do not do much pure Ruby work and we do not do Sinatra work. Thus, the focus of this document is not actually Ruby standards, but instead Ruby on Rails standards. -1. Get access from @sumpygump, create a branch and issue a [Pull Request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request). -1. Make a fork and then issue a [Pull Request](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) +### Expectations -We can actually discuss your PR and decide if we want to pull it into our main standards or not, so **don't be shy**. +* Understand and follow the standards outlined in this document. +* Write code knowing that someone else might be maintaining it. +* Select tools that benefit the project. -# Project Structure +### Goals -``` - | - |- index.md - the main standards document - |- _sass - where the sass lives - |- _layouts/default.html - the main page wrapper - |- _layouts/page.html - the main layout for the standards document -``` - -# Getting Started - - -You will need Ruby installed and properly functioning for this Jekyll site to run locally. If you don't already, you can certainly [consult this guide](http://somewhere.com/#installing-ruby) to get it installed properly. - -```sh -bundle install -bundle exec jekyll serve -``` - -After that, the site will be running @ http://localhost:4000 and sports live-reloading as you make changes. - -## Installation Troubleshooting - -If you run into an error on Mac OS X after running `bundle install` regarding -an error for nokogiri. The following steps may allow you to get the -dependencies installed properly, as per [this stackoverflow post](https://github.com/sparklemotion/nokogiri/issues/1483). - -```sh -brew uninstall --force xz -gem install nokogiri -v 1.6.8 -bundle config build.nokogiri --use-system-libraries -``` +* Be consistent +* Be awesome +* Write good, maintainable code +* Remember to test all the things :) \ No newline at end of file diff --git a/_config.yml b/_config.yml deleted file mode 100644 index 46c0036..0000000 --- a/_config.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Welcome to Jekyll! -# -# This config file is meant for settings that affect your whole blog, values -# which you are expected to set up once and rarely need to edit after that. -# For technical reasons, this file is *NOT* reloaded automatically when you use -# 'jekyll serve'. If you change this file, please restart the server process. - -# Site settings -title: Nerdery Ruby Standards -email: noreply@nerdery.com -description: The Nerdery's Ruby Standards -baseurl: "" # the subpath of your site, e.g. /blog -url: "http://yourdomain.com" # the base hostname & protocol for your site - -# Build settings -markdown: kramdown diff --git a/_includes/footer.html b/_includes/footer.html deleted file mode 100644 index 72239f1..0000000 --- a/_includes/footer.html +++ /dev/null @@ -1,38 +0,0 @@ - diff --git a/_includes/header.html b/_includes/header.html deleted file mode 100644 index b3f86db..0000000 --- a/_includes/header.html +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/_includes/icon-github.html b/_includes/icon-github.html deleted file mode 100644 index e501a16..0000000 --- a/_includes/icon-github.html +++ /dev/null @@ -1 +0,0 @@ -{% include icon-github.svg %}{{ include.username }} diff --git a/_includes/icon-github.svg b/_includes/icon-github.svg deleted file mode 100644 index 4422c4f..0000000 --- a/_includes/icon-github.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/_includes/icon-twitter.html b/_includes/icon-twitter.html deleted file mode 100644 index e623dbd..0000000 --- a/_includes/icon-twitter.html +++ /dev/null @@ -1 +0,0 @@ -{% include icon-twitter.svg %}{{ include.username }} diff --git a/_includes/icon-twitter.svg b/_includes/icon-twitter.svg deleted file mode 100644 index dcf660e..0000000 --- a/_includes/icon-twitter.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/_layouts/default.html b/_layouts/default.html deleted file mode 100644 index a0416f4..0000000 --- a/_layouts/default.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - {% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %} - - - - - - - - - -
- - - - - - - diff --git a/_layouts/page.html b/_layouts/page.html deleted file mode 100644 index 3d8d557..0000000 --- a/_layouts/page.html +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: default ---- - -
- {{ content }} -
diff --git a/_sass/_base.scss b/_sass/_base.scss deleted file mode 100644 index 3a22958..0000000 --- a/_sass/_base.scss +++ /dev/null @@ -1,151 +0,0 @@ -//================================================================ -// Mixins -//================================================================ - -@mixin centeredWrapper { - margin: 0 auto; - max-width: 650px; -} - -//================================================================ -// Base Elements -//================================================================ - -body { - font-family: - "Source_Sans_Pro", - -apple-system, - BlinkMacSystemFont, - "Segoe UI", - Roboto, - Helvetica, - Arial, - sans-serif, - "Apple Color Emoji", - "Segoe UI Emoji", - "Segoe UI Symbol"; -} - -blockquote { - background-color: #efefef; - color: #636363; - padding: 15px; -} - -img { - display: block; - width: 100%; -} - -ol { - margin-bottom: 15px; -} - -//================================================================ -// Banner -//================================================================ - -.banner { - padding: 0; - border-top: 10px solid #{$C_OFFBLACK_2}; - background-color: #{$C_GREY_TINT_8}; -} - -.globalLogo-container { - margin-left: 0; -} - -//================================================================ -// Page -//================================================================ - -.page-content { - @include centeredWrapper(); - padding: 0 20px; -} - -@media screen and #{$BP_MAJOR_LG_ARGUMENTS} { - .page-content { padding: 0; } -} - -//================================================================ -// Masthead -//================================================================ - -.masthead { - @include centeredWrapper(); - position: relative; - font-size: 0; -} - -.masthead > * { - display: inline-block; - vertical-align: middle; -} - -.masthead > * + * { margin-left: 10px; } - -.masthead-tag { - padding: 8px 6px; - position: absolute; - right: 0; - top: 50%; - transform: translateY(-50%); - border-radius: 3px; - background-color: #00b08a; - font-size: 12px; - color: #ffffff; -} - -//================================================================ -// Layer -//================================================================ - -.layer { -} - -.layer_hasWatermark { - background: #{$C_BRAND} url("../assets/images/bg-chevron-watermark.svg") 0 0 repeat; -} - -.layer-container { - max-width: 1300px; - margin: 0 auto; - box-sizing: border-box; -} - -//================================================================ -// Hero -//================================================================ - -.hero { - padding: 3rem 0; -} - -.hero-logo { - width: 56px; - margin: 0 auto; - margin-bottom: 2rem; -} - -.hero-title { - font-size: 3rem; - color: #ffffff; - text-align: center; -} - -//================================================================ -// Footer -//================================================================ - -.footer { - margin-top: 4rem; - background-color: #{$C_OFFBLACK_1}; - padding: 1rem 0; - color: #{$C_GREY_TINT_1}; -} - -.footerLegal { - text-align: center; - font-size: 0.8rem; -} diff --git a/_sass/_fonts.scss b/_sass/_fonts.scss deleted file mode 100644 index a434397..0000000 --- a/_sass/_fonts.scss +++ /dev/null @@ -1,47 +0,0 @@ -@font-face { - font-family: 'Source_Sans_Pro'; - src: url('../assets/fonts/SourceSansPro-Regular.eot'); - src: url('../assets/fonts/SourceSansPro-Regular.eot?#iefix') format('embedded-opentype'), - url('../assets/fonts/SourceSansPro-Regular.woff2') format('woff2'), - url('../assets/fonts/SourceSansPro-Regular.woff') format('woff'), - url('../assets/fonts/SourceSansPro-Regular.ttf') format('truetype'), - url('../assets/fonts/SourceSansPro-Regular.svg#SourceSansPro-Regular') format('svg'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'Source_Sans_Pro'; - src: url('../assets/fonts/SourceSansPro-It.eot'); - src: url('../assets/fonts/SourceSansPro-It.eot?#iefix') format('embedded-opentype'), - url('../assets/fonts/SourceSansPro-It.woff2') format('woff2'), - url('../assets/fonts/SourceSansPro-It.woff') format('woff'), - url('../assets/fonts/SourceSansPro-It.ttf') format('truetype'), - url('../assets/fonts/SourceSansPro-It.svg#SourceSansPro-It') format('svg'); - font-weight: normal; - font-style: italic; -} - -@font-face { - font-family: 'Source_Sans_Pro'; - src: url('../assets/fonts/SourceSansPro-Bold.eot'); - src: url('../assets/fonts/SourceSansPro-Bold.eot?#iefix') format('embedded-opentype'), - url('../assets/fonts/SourceSansPro-Bold.woff2') format('woff2'), - url('../assets/fonts/SourceSansPro-Bold.woff') format('woff'), - url('../assets/fonts/SourceSansPro-Bold.ttf') format('truetype'), - url('../assets/fonts/SourceSansPro-Bold.svg#SourceSansPro-Bold') format('svg'); - font-weight: bold; - font-style: normal; -} - -@font-face { - font-family: 'Source_Sans_Pro'; - src: url('../assets/fonts/SourceSansPro-BoldIt.eot'); - src: url('../assets/fonts/SourceSansPro-BoldIt.eot?#iefix') format('embedded-opentype'), - url('../assets/fonts/SourceSansPro-BoldIt.woff2') format('woff2'), - url('../assets/fonts/SourceSansPro-BoldIt.woff') format('woff'), - url('../assets/fonts/SourceSansPro-BoldIt.ttf') format('truetype'), - url('../assets/fonts/SourceSansPro-BoldIt.svg#SourceSansPro-BoldIt') format('svg'); - font-weight: bold; - font-style: italic; -} diff --git a/_sass/_highlight.scss b/_sass/_highlight.scss deleted file mode 100644 index 86f9e18..0000000 --- a/_sass/_highlight.scss +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Syntax highlighting styles - */ -.highlight, -.highlighter-rouge .highlight { - padding: 10px; - background: #ebeced; - border-radius: 3px; -} - -.highlight .c { color: #998; font-style: italic; } -.highlight .err { color: #a61717; background-color: #e3d2d2; } -.highlight .k { font-weight: bold; } -.highlight .o { font-weight: bold; } -.highlight .cm { color: #998; font-style: italic; } -.highlight .cp { color: #999; font-weight: bold; } -.highlight .c1 { color: #998; font-style: italic; } -.highlight .cs { color: #999; font-weight: bold; font-style: italic; } -.highlight .gd { color: #000; background-color: #fdd; } -.highlight .gd .x { color: #000; background-color: #faa; } -.highlight .ge { font-style: italic; } -.highlight .gr { color: #a00; } -.highlight .gh { color: #999; } -.highlight .gi { color: #000; background-color: #dfd; } -.highlight .gi .x { color: #000; background-color: #afa; } -.highlight .go { color: #888; } -.highlight .gp { color: #555; } -.highlight .gs { font-weight: bold; } -.highlight .gu { color: #aaa; } -.highlight .gt { color: #a00; } -.highlight .kc { font-weight: bold; } -.highlight .kd { font-weight: bold; } -.highlight .kp { font-weight: bold; } -.highlight .kr { font-weight: bold; } -.highlight .kt { color: #458; font-weight: bold; } -.highlight .m { color: #099; } -.highlight .s { color: #d14; } -.highlight .na { color: #008080; } -.highlight .nb { color: #0086B3; } -.highlight .nc { color: #458; font-weight: bold; } -.highlight .no { color: #008080; } -.highlight .ni { color: #800080; } -.highlight .ne { color: #900; font-weight: bold; } -.highlight .nf { color: #900; font-weight: bold; } -.highlight .nn { color: #555; } -.highlight .nt { color: #000080; } -.highlight .nv { color: #008080; } -.highlight .ow { font-weight: bold; } -.highlight .w { color: #bbb; } -.highlight .mf { color: #099; } -.highlight .mh { color: #099; } -.highlight .mi { color: #099; } -.highlight .mo { color: #099; } -.highlight .sb { color: #d14; } -.highlight .sc { color: #d14; } -.highlight .sd { color: #d14; } -.highlight .s2 { color: #d14; } -.highlight .se { color: #d14; } -.highlight .sh { color: #d14; } -.highlight .si { color: #d14; } -.highlight .sx { color: #d14; } -.highlight .sr { color: #009926; } -.highlight .s1 { color: #d14; } -.highlight .ss { color: #990073; } -.highlight .bp { color: #999; } -.highlight .vc { color: #008080; } -.highlight .vg { color: #008080; } -.highlight .vi { color: #008080; } -.highlight .il { color: #099; } \ No newline at end of file diff --git a/_sass/_markdown.scss b/_sass/_markdown.scss deleted file mode 100644 index 4ddacd0..0000000 --- a/_sass/_markdown.scss +++ /dev/null @@ -1,70 +0,0 @@ -.markdown { - & { - font-size: 16px; - line-height: 1.5; - color: #545454; - } - - h1, h2, h3, h4, h5, h6 { - margin: 40px 0 10px; - color: #007b89; - opacity: 0.6; - } - - h1, h4, h5, h6, strong { font-weight: bold; } - - h1 { - padding-bottom: 5px; - border-bottom: 1px solid #ebeced; - font-size: 28px; - opacity: 1; - } - - h2 { font-size: 20px; } - h3 { font-size: 16px; } - h4 { font-size: 14px; } - h5 { font-size: 12px; } - h6 { font-size: 10px; } - - p { margin-bottom: 20px; } - - strong, em { color: #454545; } - - em { font-style: italic; } - - a { color: #67bfa6; } - a:visited { color: #a38b9a; } - a:hover { color: #007b89; } - - ul, - ol { - margin-left: 20px; - margin-bottom: 1rem; - } - - ol ol, - ul ol { - padding-left: 40px; - list-style-type: lower-roman; - } - - #markdown-toc ol { - margin-bottom: 0; - } - - ul ul ol, - ul ol ol, - ol ul ol, - ol ol ol { list-style-type: lower-alpha; } - - code { - font-size: 0.9rem; - font-family: monospace; - background-color: #ededed; - padding: 2px; - } - - pre { - margin-bottom: 1rem; - } -} diff --git a/_sass/_reset.scss b/_sass/_reset.scss deleted file mode 100644 index d1c88d7..0000000 --- a/_sass/_reset.scss +++ /dev/null @@ -1,40 +0,0 @@ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font-size: 100%; - font: inherit; - vertical-align: baseline; -} -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; -} -body { - line-height: 1; -} -blockquote, q { - quotes: none; -} -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; -} -table { - border-collapse: collapse; - border-spacing: 0; -} diff --git a/_sass/_vars.scss b/_sass/_vars.scss deleted file mode 100644 index 8f2606a..0000000 --- a/_sass/_vars.scss +++ /dev/null @@ -1,104 +0,0 @@ -// ---------------------------------------------------------------------------- -// Site Globals -// ---------------------------------------------------------------------------- -$SITE_MID_WIDTH: 980px; // reduced from 1100 as per marketing request -$SITE_MAX_WIDTH: 1300px; // layer container uses this with border-box so the inner padding allows everything to be 1280px -$SPACING_STD: 10px; - -// ---------------------------------------------------------------------------- -// Colors -// ---------------------------------------------------------------------------- - -$C_WHITE: #ffffff; -$C_BLACK: #000000; -$C_OFFBLACK: #2d4245; -$C_OFFBLACK_1: #1c2d2d; -$C_OFFBLACK_2: #3A4546; -$C_ERROR: #ff0000; - -// CRUSHER TEAL -$C_BRAND: #007b89; -$C_BRAND_SHADE: #116268; -$C_BRAND_TINT_1: #52a8af; -$C_BRAND_TINT_2: #83c7cc; -$C_BRAND_TINT_3: #addee1; - -// MINT CREAM -$C_MINT_CREAM: #99BEB6; - -// WARBIRD GREEN -$C_BRAND2: #00b08a; -$C_BRAND2_SHADE: #2a876f; -$C_BRAND2_TINT_1: #67bfa6; -$C_BRAND2_TINT_2: #98d2c3; -$C_BRAND2_TINT_3: #c7e5dd; - -// TROY PLUM -$C_BRAND3: #664659; -$C_BRAND3_SHADE: #422439; -$C_BRAND3_TINT_1: #89677d; -$C_BRAND3_TINT_2: #a38b9a; -$C_BRAND3_TINT_3: #c6b5c0; - -// BLUE -$C_BRAND4: #052e59; - -// DATA GOLD -$C_BRAND_CTA: #e2de00; -$C_BRAND_CTA_SHADE: #ccc72c; - -// EARL GREY -$C_GREY: #4e5859; -$C_GREY_SHADE: #293c3d; -$C_GREY_TINT_1: #6f7a79; -$C_GREY_TINT_2: #889091; -$C_GREY_TINT_3: #a6b1b2; -$C_GREY_TINT_4: #b8c0c1; -$C_GREY_TINT_5: #cad0d1; -$C_GREY_TINT_6: #dcdfe0; -$C_GREY_TINT_7: #ebeded; -$C_GREY_TINT_8: #ebeced; - -// ---------------------------------------------------------------------------- -// Font Families -// ---------------------------------------------------------------------------- - -$FONT_FAMILY_SOURCE: "Source_Sans_Pro", Arial, Helvetica, sans-serif; -$FONT_FAMILY_GEO: "Geogrotesque", 'Verdana', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif; -// ---------------------------------------------------------------------------- -// Font Sizes -// ---------------------------------------------------------------------------- - -$FONT_SIZE_DEFAULT: 16px; - -// ---------------------------------------------------------------------------- -// Font Weights -// ---------------------------------------------------------------------------- - -$FONT_WEIGHT_NORMAL: 400; -$FONT_WEIGHT_MEDIUM: 600; -$FONT_WEIGHT_BOLD: 700; - -// ---------------------------------------------------------------------------- -// Font Styles -// ---------------------------------------------------------------------------- - -$FONT_STYLE_NORMAL: normal; -$FONT_STYLE_ITALIC: italic; - -// ---------------------------------------------------------------------------- -// Breakpoint Sizes -// ---------------------------------------------------------------------------- -// Breakpoint variables, use "min-width" -$BP_MAJOR_LG_MEDIA: "screen"; -$BP_MAJOR_LG_ARGUMENTS: "(min-width: 960px)"; -$BP_MAJOR_LG_WIDTH: 960; -$BP_MAJOR_MD_MEDIA: "screen"; -$BP_MAJOR_MD_ARGUMENTS: "(min-width: 768px)"; -$BP_MAJOR_MD_WIDTH: 768; -$BP_MAJOR_SM_MEDIA: "screen"; -$BP_MAJOR_SM_ARGUMENTS: "(min-width: 320px)"; -$BP_MAJOR_SM_WIDTH: 320; -$BP_MAJOR_BASE_MEDIA: "screen"; -$BP_MAJOR_BASE_ARGUMENTS: "(min-width: 1em)"; -$BP_MAJOR_BASE_WIDTH: 1; diff --git a/_sass/globalHeader/_globalHeader.scss b/_sass/globalHeader/_globalHeader.scss deleted file mode 100644 index e419b76..0000000 --- a/_sass/globalHeader/_globalHeader.scss +++ /dev/null @@ -1,261 +0,0 @@ -/*doc ---- -title: Global Header -name: globalHeader -category: Landmark ---- - -The Global Header object contains the site's branding, search, main navigation and secondary navigation. - -At smaller screens, the main navigation and secondary nav menu are hidden from view. Clicking the menu toggle button will expand the main and secondary nav. - -The Global Header also contains a hidden search form that is revealed by clicking on the search icon. - -Active state styles for the search menu are located in _globalSearch.scss. - -Class | Description -------------------------------------- | --------------------------------------------------------------- -`.globalHeader` | Base class. -`.globalHeader-primary` | Child of base class. Container for primary content like main navigation and logo -`.globalHeader-primary-nav` | Child of base class. Container for main navigation. -`.globalHeader-primary-search` | Child of `globalHeader-primary`. Container for search toggle and search form. -`.globalHeader-primary-search-icon` | Child of `globalHeader-primary-search`. Search toggle open button. -`.globalHeader-primary-search-close` | Child of `globalHeader-primary-search`. Search toggle close button. -`.globalHeader-secondary` | Child of base class. Container for secondary navigation or other supplemental content. -`.globalHeader-secondary-nav` | Child of base class. Container for main navigation. -`.globalHeader-mobiTrigger` | Child of base class. Container for mobile menu toggle button. -`.globalHeader-mobiTrigger-menu` | Child of `.globalHeader-mobiTrigger`. Mobile menu toggle button. - - -## State Classes -Class | Description ------------------------------- | --------------------------------------------------------------- -`.searchIsOpen` | State class to indcate whether the search form is visible. -`.mobiMenuIsOpen` | State class to indcate whether the mobile menu is visible. -`.scrollIsLocked` | State class to prevent body content from scrolling when menu or search is open. - - -*/ - -.globalHeader { - position: relative; - z-index: 2; - overflow: hidden; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -} - -.globalHeader:after, -.globalHeader:before { - content: ""; - position: fixed; - top: 0; - left: 0; - height: 100%; - width: 100%; -} - -.globalHeader:before { - background: linear-gradient(to bottom, #2caf98 30%,#17838c 100%); // TODO: add include for gradient - z-index: -1; -} - -.globalHeader:after { - background-image: url('../media/images/svgs/bg-mobile-sneezeguard.svg'); - background-size: 100%; - z-index: -1; -} - -// hides the navigation when the the mobile menu is closed -.globalHeader:not(.mobiMenuIsOpen) .globalHeader-primary-nav, -.globalHeader:not(.mobiMenuIsOpen) .globalHeader-secondary { - height: 0; - width: 0; - border: none; -} - -.globalHeader:not(.mobiMenuIsOpen):after, -.globalHeader:not(.mobiMenuIsOpen):before { - content: none; -} - -.globalHeader-primary-nav { - background-color: rgba(255,255,255,0.77); - border-top: 1px solid $C-BRAND; - text-align: center; -} - -.globalHeader-primary-nav > * > * + * { - border-top: 1px solid $C-BRAND; -} - -.globalHeader-primary-nav > * > * > a { - font-family: $FONT_FAMILY_GEO; - font-size: 22px; - color: $C_OFFBLACK; - text-decoration: none; - display: block; - padding: $SPACING_STD * 2; -} - -.globalHeader-primary-search { - position: absolute; - top: 5px; - right: 87px; -} - -// active state is defined in _globalSearch.scss -.globalHeader-primary-search-icon { - height: 25px; - width: 25px; - padding: 18px; - border: none; - background-color: transparent; - background: none; - box-sizing: content-box; - -webkit-appearance: none; -} - -button.globalHeader-primary-search-icon, -button.globalHeader-primary-search-close { - border: none; - background-color: transparent; - box-sizing: initial; - background: none; - overflow: visible; -} - -.globalHeader-primary-search-icon > svg { - fill: $C_WHITE; - height: 25px; - width: 25px; -} - -:not(.searchIsOpen) .globalSearch, -:not(.searchIsOpen) .globalSearch-input { - position: absolute; - height: 0; - width: 0; - overflow: hidden; - border: none; -} - -.scrollIsLocked { // place on the body tag when Search or mobile menu are open - position: fixed; - overflow: hidden; -} - -.globalHeader.searchIsOpen, -.globalHeader.mobiMenuIsOpen { - overflow: visible; -} - -.globalSearch-submit { - position: absolute; - height: 0; - width: 0; - overflow: hidden; - right: -9999px; -} - -input[placeholder].globalSearch-input { - color: $C_GREY_TINT_2; - text-transform: uppercase; - font-family: $FONT_FAMILY_SOURCE; - font-weight: $FONT_WEIGHT_BOLD; -} - -input.globalSearch-input:focus { - color: $C_GREY_TINT_2; - font-weight: normal; - text-transform: none; -} - -.globalHeader-primary-search-close { - -webkit-appearance: none; - border: none; - background-color: transparent; - box-sizing: initial; - padding: 0; -} - -.globalHeader-mobiTrigger { - position: absolute; - width: 20px; - height: 20px; - top: 5px; - right: 5px; - padding: 20px; - cursor: pointer; - transition: background-color 0.3s ease-in-out; -} - -.globalHeader-mobiTrigger-menu { - display: block; - height: 8px; - border-bottom: 2px solid $C_WHITE; - opacity: 1; - transition: border 0.2s ease-in-out; -} - -.globalHeader-mobiTrigger-menu:before, -.globalHeader-mobiTrigger-menu:after { - position: relative; - content: ""; - display: block; - height: 2px; - background-color: $C_WHITE; - transition: all 0.5s ease; -} - -.globalHeader-mobiTrigger-menu:after { - top: 14px; -} - -/* START .mobiMenuIsOpen styles */ -.mobiMenuIsOpen { - z-index: 3; -} - -.mobiMenuIsOpen .globalHeader-mobiTrigger-menu { - border: 0 solid transparent; -} - -.mobiMenuIsOpen .globalHeader-mobiTrigger-menu:before { - transform: rotate(-135deg); - transform-origin: center center; - top: 9px; -} - -.mobiMenuIsOpen .globalHeader-mobiTrigger-menu:after { - transform: rotate(135deg); - transform-origin: center center; - top: 7px; -} - -/* END .mobiMenuIsOpen styles */ - -.globalHeader-secondary { - background-color: rgba(255,255,255,0.77); - border-top: 1px solid $C-BRAND; - border-bottom: 1px solid $C-BRAND; - font-size: 0; /* Setting up Inline-block layout */ -} - -.globalHeader-secondary-nav > * > * { - text-align: center; - display: inline-block; - width: 33.333367%; - box-sizing: border-box; -} - -.globalHeader-secondary-nav > * > * + * { - border-left: 1px solid $C_BRAND; -} - -.globalHeader-secondary-nav > * > * a { - display: block; - font-size: 16px; - text-decoration: none; - color: $C_OFFBLACK; - padding: $SPACING_STD; -} diff --git a/_sass/globalHeader/_globalHeader_lg.scss b/_sass/globalHeader/_globalHeader_lg.scss deleted file mode 100644 index 5c01d77..0000000 --- a/_sass/globalHeader/_globalHeader_lg.scss +++ /dev/null @@ -1,180 +0,0 @@ -// Global Header - large screen styles -.globalHeader { - padding: $SPACING_STD * 6 0 $SPACING_STD * 2; /* Spacing for globalHeader-secondary's absolute positioning */ - background: $C_WHITE; //Pattern in Mobile - overflow: visible; -} - -.globalHeader:after, -.globalHeader:before { - content: none; -} - -// hides the navigation when the the mobile menu is closed -.globalHeader:not(.mobiMenuIsOpen) .globalHeader-primary-nav, -.globalHeader:not(.mobiMenuIsOpen) .globalHeader-secondary { - height: auto; - width: 100%; -} - -.globalHeader:not(.mobiMenuIsOpen):after, -.globalHeader:after { - content: " "; - width: 100%; - height: 1px; - position: absolute; - top: inherit; - left: 0; - right: 0; - bottom: -1px; - z-index: -1; - background: $C_GREY_TINT_6; -} - -.globalHeader-primary { - position: relative; - max-width: $SITE_MAX_WIDTH; - margin: 0 auto; - display: table; - width: calc(100% - 40px); - padding: 0 $SPACING_STD * 2; -} - -.globalHeader-primary > * { - display: table-cell; -} - -/* Primary Navigation */ -.globalHeader-primary-nav { - background-color: none; - border-top: none; - text-align: right; - overflow: hidden; -} - -.globalHeader-primary-nav > * > * { - border-top: none; - display: inline-block; -} - -.globalHeader-primary-nav > * > * > a { - padding: $SPACING_STD * 2.5 $SPACING_STD * 2 $SPACING_STD * 2.1; -} - -.globalHeader-primary-nav > * > * > a { - position: relative; -} - -.globalHeader-primary-nav > * > * > a:hover, -.globalHeader-primary-nav > * > * > a:focus, -.globalHeader-primary-nav > * > * > a:active { - outline-offset: -1px; -} - -.globalHeader-primary-nav > * > * > a:after, -.globalHeader-primary-nav > * > * > a:before { - content: ''; - z-index: -1; - position: absolute; - left: 0; - height: 2px; - width: 100%; - opacity: 0; - transition: height 0.5s ease-in-out, opacity 0.25s ease-out; -} - -.globalHeader-primary-nav > * > * > a:after { - bottom: calc(50% - 1px); - background-color: $C_GREY_TINT_8; -} - -.globalHeader-primary-nav > * > * > a:before { - top: calc(50% - 1px); - background-color: $C_GREY_TINT_8; -} - -.globalHeader-primary-nav > * > * > a:hover:after, -.globalHeader-primary-nav > * > * > a:hover:before { - height: 100%; - opacity: 1; -} - -.globalHeader-primary-search { - position: static; - vertical-align: middle; - text-align: right; -} - -.globalHeader-primary-search-icon { - padding: $SPACING_STD * 0.5; - display: inline-block; - vertical-align: bottom; - cursor: pointer; -} - -.globalHeader-primary-search-icon > svg { - fill: $C_OFFBLACK; -} - -.globalHeader-mobiTrigger { - display: none; -} - -.globalHeader-secondary { - border: none; - background-color: $C_OFFBLACK_1; - position: absolute; - width: 100%; - top: 0; -} - -/* BEGIN Secondary Navigation */ -.globalHeader-secondary-nav > * { - max-width: $SITE_MAX_WIDTH; - width: calc(100% - 40px); - padding: 0 $SPACING_STD * 2; - margin: 0 auto; - text-align: right; -} - -.globalHeader-secondary-nav > * > * { - width: auto; - transform: skewX(-15deg); - transition: background-color 0.2s ease-in-out; -} - -.globalHeader-secondary-nav > * > *:hover { - background-color: $C_OFFBLACK; -} - -.globalHeader-secondary-nav > * > * + * { - border-left: none; -} - -.globalHeader-secondary-nav > * > * a { - display: block; - font-size: 15px; - text-decoration: none; - color: $C_WHITE; - padding: $SPACING_STD * 1.25 $SPACING_STD * 3; - transform: skewX(15deg); /* To offset the transform of the parent */ -} - - -/* State Classes */ - -// place on the body tag when Search or mobile menu are open -.scrollIsLocked { - position: static; - overflow: visible; -} - -/* Mixins */ - -.mix-accent_brand { - background-color: $C_BRAND_SHADE; -} - -.mix-accent_grey { - background-color: $C_GREY_TINT_7; -} diff --git a/_sass/globalHeader/_globalLogo.scss b/_sass/globalHeader/_globalLogo.scss deleted file mode 100644 index 2052f13..0000000 --- a/_sass/globalHeader/_globalLogo.scss +++ /dev/null @@ -1,129 +0,0 @@ -/*doc ---- -title: Global Logo -name: globalLogo -category: Landmark ---- - -The Global Logo object is used to display the company logo in the header. The logo is separated into 2 components, the logomark and the type. They will appear side-by-side on desktop and stacked at mobile. - - -Class | Description ------------------------------- | --------------------------------------------------------------- -`.globalLogo` | Base class. -`.globalLogo-container` | Child of base class. Container for primary content like main navigation and logo -`.globalLogo-container-mark` | Child of `.globalLogo-container`. Container for logo icon/emblem. -`.globalLogo-container-type` | Child of `.globalLogo-container`. Container for logo text. - - -```html_example - -``` - -*/ -.globalLogo { - min-height: 70px; - position: relative; - background-color: #1c2d2d; -} - -.globalLogo-container { - position: absolute; - margin-left: 25px; - height: 100%; - max-width: 30%; - min-width: 70px; - background-color: $C_GREY_SHADE; - padding: 0 $SPACING_STD; - -} - -.globalLogo-container > * { - display: inline-block; - padding: $SPACING_STD 0; - text-align: center; - font-size: 0; - fill: $C-WHITE; -} - -.globalLogo-container-mark { - width: 25px; - height: auto; - margin: 0 auto; -} - -.globalLogo-container-type { - margin-top: 6px; - width: 70px; - height: auto; -} - -// adding specific max-height on svg to fix layout issues in IE -.globalLogo-container-mark .globalLogo-container-svg { - max-height: 32px; -} - -.globalLogo-container-type .globalLogo-container-svg { - max-height: 8px; -} - -// for using a header element instead of svg for text portion of logo - -.globalLogo-hdg { - margin-left: 10px; -} - -.globalLogo-hdg_pipe { - font-size: 36px; -} - -.globalLogo-hdg_txt { - font-size: 30px; -} diff --git a/_sass/globalHeader/_globalLogo_lg.scss b/_sass/globalHeader/_globalLogo_lg.scss deleted file mode 100644 index 000d891..0000000 --- a/_sass/globalHeader/_globalLogo_lg.scss +++ /dev/null @@ -1,45 +0,0 @@ -// Global Logo - large screen styles -.globalLogo { - background: none; - transform: scale(1.1); // Scaling proportionally to preserve repective spacing relationships -} - -.globalLogo-container { - display: block; - position: absolute; - top: 6px; - max-width: 100%; - min-width: 340px; - height: inherit; - background: transparent; - margin-left: -28px; /* negative margin to line up pocket arrow to content left */ -} - -.globalLogo-container > * { - fill: $C_BRAND; -} - -.globalLogo-container > * > * { - display: inline-block; - text-align: left; - vertical-align: middle; -} - -.globalLogo-container-mark { - width: 39px; -} - -.globalLogo-container-type { - margin-top: 3px; - margin-left: $SPACING_STD * 1.3; - width: 165px; -} - -// adding specific max-height on svg to fix layout issues in IE. -.globalLogo-container-mark .globalLogo-container-svg { - max-height: 36px; -} - -.globalLogo-container-type .globalLogo-container-svg { - max-height: 20px; -} diff --git a/assets/fonts/SourceSansPro-Bold.eot b/assets/fonts/SourceSansPro-Bold.eot deleted file mode 100644 index 7fd8a03..0000000 Binary files a/assets/fonts/SourceSansPro-Bold.eot and /dev/null differ diff --git a/assets/fonts/SourceSansPro-Bold.svg b/assets/fonts/SourceSansPro-Bold.svg deleted file mode 100644 index 3a08d2a..0000000 --- a/assets/fonts/SourceSansPro-Bold.svg +++ /dev/null @@ -1,6050 +0,0 @@ - - - - -Created by FontForge 20120731 at Wed Jan 20 20:12:46 2016 - By ,,, -Copyright 2010, 2012 Adobe Systems Incorporated. All Rights Reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/fonts/SourceSansPro-Bold.ttf b/assets/fonts/SourceSansPro-Bold.ttf deleted file mode 100644 index 50d81bd..0000000 Binary files a/assets/fonts/SourceSansPro-Bold.ttf and /dev/null differ diff --git a/assets/fonts/SourceSansPro-Bold.woff b/assets/fonts/SourceSansPro-Bold.woff deleted file mode 100644 index 058f9e3..0000000 Binary files a/assets/fonts/SourceSansPro-Bold.woff and /dev/null differ diff --git a/assets/fonts/SourceSansPro-Bold.woff2 b/assets/fonts/SourceSansPro-Bold.woff2 deleted file mode 100644 index 560d4a3..0000000 Binary files a/assets/fonts/SourceSansPro-Bold.woff2 and /dev/null differ diff --git a/assets/fonts/SourceSansPro-BoldIt.eot b/assets/fonts/SourceSansPro-BoldIt.eot deleted file mode 100644 index e3797fd..0000000 Binary files a/assets/fonts/SourceSansPro-BoldIt.eot and /dev/null differ diff --git a/assets/fonts/SourceSansPro-BoldIt.svg b/assets/fonts/SourceSansPro-BoldIt.svg deleted file mode 100644 index 8a44ac3..0000000 --- a/assets/fonts/SourceSansPro-BoldIt.svg +++ /dev/null @@ -1,4318 +0,0 @@ - - - - -Created by FontForge 20120731 at Wed Jan 20 20:12:41 2016 - By ,,, -Copyright 2010, 2012 Adobe Systems Incorporated. All Rights Reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/fonts/SourceSansPro-BoldIt.ttf b/assets/fonts/SourceSansPro-BoldIt.ttf deleted file mode 100644 index d20dd0c..0000000 Binary files a/assets/fonts/SourceSansPro-BoldIt.ttf and /dev/null differ diff --git a/assets/fonts/SourceSansPro-BoldIt.woff b/assets/fonts/SourceSansPro-BoldIt.woff deleted file mode 100644 index 0c681c9..0000000 Binary files a/assets/fonts/SourceSansPro-BoldIt.woff and /dev/null differ diff --git a/assets/fonts/SourceSansPro-BoldIt.woff2 b/assets/fonts/SourceSansPro-BoldIt.woff2 deleted file mode 100644 index b569620..0000000 Binary files a/assets/fonts/SourceSansPro-BoldIt.woff2 and /dev/null differ diff --git a/assets/fonts/SourceSansPro-It.eot b/assets/fonts/SourceSansPro-It.eot deleted file mode 100644 index 5a8050a..0000000 Binary files a/assets/fonts/SourceSansPro-It.eot and /dev/null differ diff --git a/assets/fonts/SourceSansPro-It.svg b/assets/fonts/SourceSansPro-It.svg deleted file mode 100644 index 6991a98..0000000 --- a/assets/fonts/SourceSansPro-It.svg +++ /dev/null @@ -1,4359 +0,0 @@ - - - - -Created by FontForge 20120731 at Wed Jan 20 20:12:42 2016 - By ,,, -Copyright 2010, 2012 Adobe Systems Incorporated. All Rights Reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/fonts/SourceSansPro-It.ttf b/assets/fonts/SourceSansPro-It.ttf deleted file mode 100644 index e5a1a86..0000000 Binary files a/assets/fonts/SourceSansPro-It.ttf and /dev/null differ diff --git a/assets/fonts/SourceSansPro-It.woff b/assets/fonts/SourceSansPro-It.woff deleted file mode 100644 index 02e2ef6..0000000 Binary files a/assets/fonts/SourceSansPro-It.woff and /dev/null differ diff --git a/assets/fonts/SourceSansPro-It.woff2 b/assets/fonts/SourceSansPro-It.woff2 deleted file mode 100644 index 6d9e37d..0000000 Binary files a/assets/fonts/SourceSansPro-It.woff2 and /dev/null differ diff --git a/assets/fonts/SourceSansPro-Regular.eot b/assets/fonts/SourceSansPro-Regular.eot deleted file mode 100644 index e22fdc5..0000000 Binary files a/assets/fonts/SourceSansPro-Regular.eot and /dev/null differ diff --git a/assets/fonts/SourceSansPro-Regular.svg b/assets/fonts/SourceSansPro-Regular.svg deleted file mode 100644 index d4cdd8b..0000000 --- a/assets/fonts/SourceSansPro-Regular.svg +++ /dev/null @@ -1,6376 +0,0 @@ - - - - -Created by FontForge 20120731 at Wed Jan 20 20:12:44 2016 - By ,,, -Copyright 2010, 2012 Adobe Systems Incorporated. All Rights Reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/fonts/SourceSansPro-Regular.ttf b/assets/fonts/SourceSansPro-Regular.ttf deleted file mode 100644 index 91e9ea5..0000000 Binary files a/assets/fonts/SourceSansPro-Regular.ttf and /dev/null differ diff --git a/assets/fonts/SourceSansPro-Regular.woff b/assets/fonts/SourceSansPro-Regular.woff deleted file mode 100644 index a0d9f1b..0000000 Binary files a/assets/fonts/SourceSansPro-Regular.woff and /dev/null differ diff --git a/assets/fonts/SourceSansPro-Regular.woff2 b/assets/fonts/SourceSansPro-Regular.woff2 deleted file mode 100644 index c2e9a91..0000000 Binary files a/assets/fonts/SourceSansPro-Regular.woff2 and /dev/null differ diff --git a/assets/icons/favicon.ico b/assets/icons/favicon.ico deleted file mode 100644 index 5b192aa..0000000 Binary files a/assets/icons/favicon.ico and /dev/null differ diff --git a/assets/images/bg-chevron-watermark.svg b/assets/images/bg-chevron-watermark.svg deleted file mode 100644 index fb1fe7b..0000000 --- a/assets/images/bg-chevron-watermark.svg +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/assets/images/ruby-logo.svg b/assets/images/ruby-logo.svg deleted file mode 100644 index 59cf324..0000000 --- a/assets/images/ruby-logo.svg +++ /dev/null @@ -1,948 +0,0 @@ - - - -image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/css/main.scss b/css/main.scss deleted file mode 100644 index 1287867..0000000 --- a/css/main.scss +++ /dev/null @@ -1,24 +0,0 @@ ---- -# Only the main Sass file needs front matter (the dashes are enough) ---- -@charset "utf-8"; - -@import - "vars", - "globalHeader/_globalHeader", - "globalHeader/_globalLogo", - "reset", - "base", - "fonts", - "markdown", - "highlight"; - -/* --------------------------------------------------------------------- - Desktop Specific Styles ------------------------------------------------------------------------- */ -@media screen and #{$BP_MAJOR_LG_ARGUMENTS} { - @import - "globalHeader/_globalHeader_lg", - "globalHeader/_globalLogo_lg"; -} - diff --git a/feed.xml b/feed.xml deleted file mode 100644 index a6628bd..0000000 --- a/feed.xml +++ /dev/null @@ -1,30 +0,0 @@ ---- -layout: null ---- - - - - {{ site.title | xml_escape }} - {{ site.description | xml_escape }} - {{ site.url }}{{ site.baseurl }}/ - - {{ site.time | date_to_rfc822 }} - {{ site.time | date_to_rfc822 }} - Jekyll v{{ jekyll.version }} - {% for post in site.posts limit:10 %} - - {{ post.title | xml_escape }} - {{ post.content | xml_escape }} - {{ post.date | date_to_rfc822 }} - {{ post.url | prepend: site.baseurl | prepend: site.url }} - {{ post.url | prepend: site.baseurl | prepend: site.url }} - {% for tag in post.tags %} - {{ tag | xml_escape }} - {% endfor %} - {% for cat in post.categories %} - {{ cat | xml_escape }} - {% endfor %} - - {% endfor %} - - diff --git a/index.md b/index.md deleted file mode 100644 index c6a5f00..0000000 --- a/index.md +++ /dev/null @@ -1,306 +0,0 @@ ---- -layout: page -author: The Nerdery Ruby Standards Task Force ---- - -# Introduction - -Our goal in the creation of this document is to not only improve consistency, but to also allow newer developers joining our discipline to have an easy to use reference point. Consistency is a key element of software quality and without it all of our efforts eventually turn to spaghetti. - -Today at The Nerdery, the Ruby discipline is effectively the Ruby on Rails discipline. We *do not* do much pure Ruby work and we *do not* do Sinatra work. Thus, the focus of this document is not actually *Ruby* standards, but instead **Ruby on Rails** standards. - -# Contributing - -So you want to contribute to this document? Awesome! We openly accept collaboration and want your help! Please contact @sumpygump for commit access to our [repo on GitHub](https://github.com/thenerdery/ruby-standards)! You can also open issues over on GitHub and even fork the project to make your own changes before submitting them back to main. - -# Further Resources - -Remember, this is a standards guide - **not a tutorial**. If you are interested in learning Ruby then that's fantastic! Below you'll find a curated list of some of the best resources for getting started: - -1. [Nerdery Getting Started Guide](https://ruby.nerderylabs.com/training/training-module-0/) - for getting started. -1. [Code School](https://www.codeschool.com/learn/ruby) - fun, interactive video lessons. -1. [Ruby Warrior](https://www.bloc.io/ruby-warrior/) - a game for learning Ruby. -1. [Rails Best Practices](http://rails-bestpractices.com/) - for learning a *right* way. -1. [Rails Guides](http://guides.rubyonrails.org/) - the ultimate API document for figuring Rails out. -1. [Ruby Koans](http://rubykoans.com/) - learn the quirks of Ruby by fixing unit tests. - -

Table of Contents

- -1. TOC -{:toc} - -# Ruby Language Standards - -The Ruby community as a whole is fairly homogeneous and thoroughly focused on maintaining that community. As a result, we have an excellent [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide) available to us that puts forth most of the usual "how many tabs, how to name methods" sorts of questions. At The Nerdery, we use this. - -We are extremely fortunate in our community to have [Rubocop](https://github.com/bbatsov/rubocop) available to use - which will automatically check for standards violations against the community Ruby Style Guide. Please make sure that you use **and enforce** this on any of your Ruby projects. - -```ruby - group :development, :test do - gem 'rubocop' - end -``` - -# Installing Ruby on Rails - -The following "Installing Ruby on Rails" sections are lifted directly from Jordan's [Rails Best Practices](http://www.phantomdata.com/2016/07/21/rails-best-practices.html) guide. - -We work in a company with lots of different disciplines all commingling on a regular basis. PHP, .NET, Java, Rails and Python... we all get along pretty well. We're also quite adaptable and end up going where the work is - which might not necessarily be in our favorite discipline. The most common frustrations I see developers thrown into the Rails world is that of not having started from a good base. - -You see, Ruby is pretty popular. You might not know it, but a metric ton of the critical tools you use daily are built upon it. For the most part, unless you're running Windows, Ruby is already installed. ***gasp*** it was that easy? - -Not quite. That version that's installed is probably pretty old. Not only that, but Ruby's ecosystem is actually pretty complex and diverse. Over the years we've figured out ways to all work together - but most operating systems don't install Ruby that way. - -If you use your system Ruby, you are probably going to have a bad time. Follow below for steps to obviate that. - -## Linux - -Linux setup is pretty straight forward. If you've tried other guides, make sure to examine and clear any remnants from your `~/.bash_profile` and `~/.profile`. - -```sh -# Install basic developer tooling -sudo apt-get install build-essential libssl-dev git subversion imagemagick \ - libmagick-dev curl automake libpcre3-dev bison libmysqlclient-dev \ - libxslt-dev libpq-dev libreadline-dev libyaml-dev libcurl4-openssl-dev \ - postgresql postgresql-server-dev-9.1 git nodejs - -# Install RVM to properly select Ruby versions -gpg --keyserver hkp://keys.gnupg.net \ - --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -\curl -sSL https://get.rvm.io | bash -s stable - -# Install Ruby and Rails (you may have to restart your terminal) -rvm install ruby 2.3.1 -rvm use ruby 2.3.1 -gem install bundler rails -``` - -## OSX - -OSX setup is also pretty straight forward. If you've tried other guides, make sure to examine and clear any remnants from your `~/.bash profile` and `~/.profile`. - -```sh -# Install Homebrew so you can install other things -/usr/bin/ruby -e \ - "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -# Install a database and the most common image library -brew install imagemagick postgresql - -# Install RVM to properly select Ruby versions -gpg --keyserver hkp://keys.gnupg.net \ - --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 -\curl -sSL https://get.rvm.io | bash -s stable - -# Install Ruby and Rails (you may have to restart your terminal) -rvm install ruby 2.3.1 -rvm use ruby 2.3.1 -gem install bundler rails -``` - -# An MVC Primer - -Ruby on Rails is one of many frameworks that follows the MVC design pattern. This pattern dictates a distinct separation of concerns between the 3 major components: Model, View and Controller. Each component represents a layer which a request works its way through as it is serviced. - -Rails' concept of MVC dictates that a request is first serviced by a Controller which coordinates various components. This generally means that a Controller will speak to various Models to gather information and feed it up into a View. - -The Model Layer, as described by Rails, is responsible for handling the majority of business logic found within the application. For the vast majority of CRUD applications, this can be the files found within app/models. We'll talk about methods for obviating Model Bloat later. - -Once a Controller has gathered enough information from the Model layer - this information is fed up to a View layer by way of instance variables (`@cats = Cat.all`). This view layer is typically a `.erb` file which leverages standard Ruby syntax intermingled with HTML code. - -This separation gives us clear choices as to the locations of most items and helps to prevent spaghetti code by having different components talking which have no business knowing about each-other. - -## Stepping Outside of MVC - -MVC is not a silver bullet for every single problem. It *is* a damned good way to solve common web application architectures but it is often necessary to step outside of these boundaries. It is a subject of much debate and has no generally agreed upon solution within the Rails community. Since there is no clear winner, we have simply selected a pattern for you to follow: - -1. All domain-specific non-mvc code goes into `app/` - **eg: app/services/cakes_service.rb, app/factories/car_factory.rb, app/whatever** -1. All non-domain-specific non-mvc code goes into `lib/` - **eg: lib/thumbnail_generator.rb, lib/hmac_authenticator.rb, lib/ci_bootstrapper.rb** - -The predominant way that you will step out of the MVC pattern is through the usage and implementation of **service classes**. These classes are typically developed to split out particular *concerns* of a given domain object. You may find this at odds with Rails Concerns and rightfully so. Rails Concerns are a hotly debated topic in the Rails community, and as a whole we simply eschew towards using the more agnostic Service Class approach. - -You can find an in depth discussion about implementing service classes over on [Stitch Fix's blog](http://multithreaded.stitchfix.com/blog/2015/06/02/anatomy-of-service-objects-in-rails/). - -# Rails Clean Code Basics - -1. Keep your controllers small - they control things, they don't **do** things -1. Keep your models small - logic that can be cleanly collected into a specific *business concern* should be split out into a *service class*. -1. Run `rubycritic` and `rubocop` to ensure that your code is up to standards - -# Source Control Practices - -## Hosting - -There are 2 primary means for hosting source control on Nerdery Rails projects: - -1. GitHub -1. Self-hosted Nerdery BitBucket - -GitHub is our usual go-to for source control hosting as it provides the highest level of 3rd party service integration. This level of service allows for easy integration with 3rd party tools like CircleCI, CodeClimate and Heroku. - -Our internally self-hosted Nerdery BitBucket service provides a bare-bones code hosting solution that is useful when a client does not wish to pay any additional fees. It lacks 3rd party support for our typical tools (such as CircleCI, Code Climate and Gemnasium), so you will need to budget in additional time (40-80hours) for integration with our internal CI server Bamboo. - -## Branching Strategies - -We firmly believe that branching strategies should be appropriate for the particular project and team-type associated. The most important thing, when it comes to branching strategies, is clear communication and consistent amongst a given project. As such, including a **contributing** section within the `README.md` is best practice and strongly encouraged. - -An example of such a section from a recent project (2016/09/16) is as such: - -> **Contributing** -> -> This project is leveraging *Pull Requests* for handling code management. For each **feature** that you are looking to build, create a branch off of `develop` with the format of `feature/my-feature`. Once complete, make a Pull Request and a lead should review your request and merge it into develop once complete. -> -> Before making a PR, ensure that you have merged develop back into your branch and that all tests & rubocops are passing. Your PR will not be merged in if these conditions are not met. -> -> For **emergency fixes**, branch off of `master` to make your fix. Once tested and complete, merge this branch back into master and then develop. - -If a branching strategy has not been specified for a project, consider the [git-flow](http://danielkummer.github.io/git-flow-cheatsheet/) approach as a good starting point. - - -# Deployment - -There are really 2 primary ways to handle deployment on Rails projects at The Nerdery: - -1. Capistrano -1. Ansible / Chef - -Each has their place depending on your current environment. - -Capistrano is good for systems which use manually provisioned machines or for which you want to keep the code deployment outside of the server provisioning scripts. This allows you to deploy code without provisioning everything again. It introduces a number of best practices and is a clear choice over a straight manual deployment. - -The other option is using your provisioning scripts to handle your deployments. This methodology typically involves a git repository that is cloned during your provisioning step and heavily depends upon you treating your new systems as cattle and not pets. It provides no good long-term maintenance plan for a specific instance, instead assuming that you will kill that instance and spawn a new one when you are doing a deployment. - -There are extensive debates and subjective opinions on server provisioning in general. We have yet to reach a generally accepted consensus, neither at The Nerdery nor the community at large. Please take the time to have these discussions with knowledgeable individuals to determine best fit for your project. - -# 3rd Party Libraries - -## Admin Interfaces - -This is a highly subjective choice that should be deeply considered for the given project. There are roughly 2 modern choices on this subject: - -1. [Administrate](https://github.com/thoughtbot/administrate) -1. Custom - -Administrate is a useful gem for non-customizable, easy and quick administrative interfaces. The type of project that this would be useful on is probably the same one that uses Twitter Bootstrap and needs to be done tomorrow. It falls down heavily when we need to start customizing the administrative back-end to support client demands. - -Honestly, writing custom CRUD operations for basic forms is a trivial and relatively fast task. It is boring and thankless work, but in the end it provides a solid foundation upon which we can make the customizations that most of our clients are looking for in a Rails based project. - -*Please note*, ActiveAdmin purposefully does not show up in this list because they have been slow to keep up with major versions of Rails. Even as of this writing, Rails 5 support is present only in master and is listed as "preliminary". - -## Authentication - -Our usual choice for Authentication needs is [Devise](https://github.com/plataformatec/devise). It is the de-facto standard for the Rails community and carries with it strong community support and high quality documentation. It is also very easy to customize and skin to our exact needs as defined on a project by project basis. - - -Our typical setup procedure for devise looks something like: - -```sh -$ rails generate devise:install -$ rails generate devise User -$ rails generate devise:views -``` - -For the most part, any deviations from Devise's standard functionality is a result of custom needs on a project. Devise has excellent documentation on their GitHub page and can easily be extended to support most of our needs. - -If you find yourself repeatedly doing something, please don't hesitate to open an issue so that we can document it here. - -## Background Jobs - -Background Job runners are a fairly cut-and-dry bunch without too many differentiators. Our developer have the most experience with [Delayed::Job](https://github.com/collectiveidea/delayed_job), so that is what we'll usually expect to find on a given project. - -If you find one that you *really* like and feel is way superior, please open an issue or a PR so that we can have a discussion about it. - -## File Uploads and Storage - -[Carrierwave](https://github.com/carrierwaveuploader/carrierwave) is another choice we often use. It provides all the same support for storage (thanks to Fog). One main difference, between it and Paperclip, is its ability to [cache a file after upload so it does not require uploading again after an invalid form submission](https://github.com/carrierwaveuploader/carrierwave#making-uploads-work-across-form-redisplays). Our primary recommendation is to use CarrierWave. - -[Paperclip](https://github.com/thoughtbot/paperclip) is a good choice for handling file uploads and storage. It provides excellent support for local storage as well as storage to S3 via Fog. Its usage and support is well understood by most Rails developers and carries a high amount of hive-knowledge. - -## Pagination - -[Kaminari](https://github.com/amatsuda/kaminari) - just use it. - -# 3rd Party Services - -Our standard package of 3rd party services includes the following: - -1. AWS for Application Hosting -1. GitHub for Code Hosting -1. CircleCI for Continuous Integration / Deployment - -Since GitHub and CircleCI are discussed above, the rest of this section will deal specifically with AWS. - -There are many hosting providers that provide a variety of costs, but AWS provides the simplest and cleanest growth path of any provider. It easily and cost-effectively allows us to scale from a small single-server application to a load balanced multi-tiered SoA style app while still maintaining a continuity of service. - -Our typical usages of AWS include: - -1. EC2 instances for hosting applications -1. RDS instances for hosting databases -1. S3 for hosting uploaded files -1. ElastiCache instances for hosting in-memory data stores -1. OpsWorks for provisioning each if the size or complexity is large - -# Documentation - -Good documentation makes a long-lived project easier to understand and maintain. It can help introduce new developers to an unfamiliar codebase, or serve as a reference point for the team coming back to code 6 months later. Documentation may also cover important architectural decisions, complex business logic, or quirks and workarounds of the tech we're working with. Just as we put effort into making tests that last to ensure our application is stable and robust, we also focus on providing meaningful documentation. - -A great article on improving Rails-based documentation published by Aaron Sumner can be found here. Many of the practices described below are pulled from his philosophy. - -## Start with the README -Your application’s README is still its gateway, the first thing new developers will likely read when they access its source code. If your app’s README consists of the default given to every new Rails app, it’s time to change it. - -Your README should include: - -* A brief description of what the application does. -* How to install dependencies, especially those that are more complex than a simple `bundle install`. For example, if I need to to install Redis or ImageMagick to work on the app, or configure environment variables to talk to external services, let me know up front. -* How to run the application’s test suite, to verify that setup was successful. Again, note special external dependencies, like PhantomJS. -* How to generate the docs, to get to a more detailed description of the application’s code. - -## Remove generated documentation from source control - -The HTML version of your Rails docs will need to be regenerated regularly, in order to keep up with the code they explain. Ignoring the doc/app directory makes sure that stale documentation doesn't stick around from commit to commit, and just makes commits cleaner in general. This is why it’s important to mention how to generate the docs in your README as they won’t be easily accessible, otherwise. - -## Write clear documentation - -* __Don't assume knowledge of the business__: If you've been working in the application for awhile, the names you've given your classes and methods may seem obvious, but to a newcomer they can be a large hurdle to overcome. Help explain ___why___ things are called what they are. -* __Do assume knowledge of Rails__: The rule of thumb is to document ___why___, now ___how___. Document under the assumption that the reader can read Ruby code, or at least knows how to search Google or Stack Overflow to learn more about specific methods. - -## YARD + RDOC - -We recommend utilizing the [YARD gem](http://yardoc.org/) in conjunction with the standard [RDOC documentation system](http://rdoc.sourceforge.net/doc/) to provide clear and consistent documentation on our projects. YARD fills in some of the gaps that RDOC does not address by allowing us to organize our codes meta and behavioural data through the use of [tags](http://www.rubydoc.info/gems/yard/file/docs/Tags.md). Not only does this create consistency between our projects, but it also more closely represents the way documentation blocks are handled via the other disciplines at The Nerdery, making point of entry into the language easier for an outside developer to understand. - -### The `.yardopts` file - -YARD accepts [many different options](http://www.rubydoc.info/gems/yard/YARD/CLI/Yardoc), and for ease of development it is recommended that you use a `.yardopts` file to outline these options. YARD will automatically parse this file every time `yard` is run and conform to it's requests. A recommended starter file is outlined below - - --private - --markup=markdown - app/**/*.rb - - lib/**/*.rb - - -This starter file tells YARD to document all private methods, interpret and render markup in the docblocks, and generate documenation for all *.rb files located in the app and lib folders. - -### Markdown format - -YARD supports [multiple formats](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Which_Markup_Format_) for it's markup rendering. Due to the industry wide acceptance and use of standard Markdown for most circumstances we recommends utilizing `markdown` as the format of choice on our Ruby projects. - -### Do's & Dont's - -[YARD](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md) and [RDOC](http://rdoc.sourceforge.net/doc/) are very extensive. We encourage you to read over the documentation and explore the vast amount of options available to you, however documenting too much, or using unwise practices can make your documentation just as bad as not having any at all. In this section we'll cover our recommended practices while using this documentation engine combination: - -#### __DO__ -* Provide a documentation block at the top of every class file. This should contain: - * A description of the classes function (___why___ not ___how___) within the application. - * Your [author name](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#author). - * A [version number](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#since) of when the class was first added to the project. -* Provide a documentation block at the top of every method with the exception of standard CRUD controller operations (`index`|`new`|`create`|`show`|`edit`|`update`|`destroy`). This should contain: - * A description of the methods function (___why___ not ___how___) within the class. - * All [paramaters](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#param) of the method. - * All [options](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#option) if an options Hash is being used as a param. - * A [return](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#return) value. If no return value is produced by the method `void` would be the expected return. -* Document all [model attributes](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Documenting_Attributes). Obviously this means writing each to their own line and not strining them together via commas. In the event you need separate documenation for the attributes getter and setter then follow [these steps]( http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Documentation_for_a_Separate_Attribute_Writer). -* Use [Duck-Type specifiers](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#Duck-Types) when appropriately. - -#### __DON'T__ -* Use YARD based [reference tags](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Reference_Tags). Although this methodology reduces DRY documentation it also enforces coupling. -* Overload your documentation. Having overly cumbersome documentation is just as bad as having no documentation at all. Keep your docblocks small, concise, and to the point. Often throughout the RubyDocs and YARD documentation pages you will be presented with large docblocks filled with markdown and html structures, unless this type of documentation adds significant understandability to the class or method we ask that you refrain from emulating this. "Short, Sweet, To The Point" -* Don't create [custom tags](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#Adding_Custom_Tags) unless absolutely vital to the understandability of the documentation. If you are presented with a case where you do need to make them ensure that you are always namespacing them. \ No newline at end of file diff --git a/standards/deployment.md b/standards/deployment.md new file mode 100644 index 0000000..dafa584 --- /dev/null +++ b/standards/deployment.md @@ -0,0 +1,14 @@ +# Deployment + +There are really 2 primary ways to handle deployment on Rails projects at The Nerdery: + +1. Capistrano +1. Ansible / Chef + +Each has their place depending on your current environment. + +Capistrano is good for systems which use manually provisioned machines or for which you want to keep the code deployment outside of the server provisioning scripts. This allows you to deploy code without provisioning everything again. It introduces a number of best practices and is a clear choice over a straight manual deployment. + +The other option is using your provisioning scripts to handle your deployments. This methodology typically involves a git repository that is cloned during your provisioning step and heavily depends upon you treating your new systems as cattle and not pets. It provides no good long-term maintenance plan for a specific instance, instead assuming that you will kill that instance and spawn a new one when you are doing a deployment. + +There are extensive debates and subjective opinions on server provisioning in general. We have yet to reach a generally accepted consensus, neither at The Nerdery nor the community at large. Please take the time to have these discussions with knowledgeable individuals to determine best fit for your project. \ No newline at end of file diff --git a/standards/documentation.md b/standards/documentation.md new file mode 100644 index 0000000..c87fc1c --- /dev/null +++ b/standards/documentation.md @@ -0,0 +1,65 @@ +# Documentation + +Good documentation makes a long-lived project easier to understand and maintain. It can help introduce new developers to an unfamiliar codebase, or serve as a reference point for the team coming back to code 6 months later. Documentation may also cover important architectural decisions, complex business logic, or quirks and workarounds of the tech we're working with. Just as we put effort into making tests that last to ensure our application is stable and robust, we also focus on providing meaningful documentation. + +A great article on improving Rails-based documentation published by Aaron Sumner can be found here. Many of the practices described below are pulled from his philosophy. + +## Start with the README +Your application’s README is still its gateway, the first thing new developers will likely read when they access its source code. If your app’s README consists of the default given to every new Rails app, it’s time to change it. + +Your README should include: + +* A brief description of what the application does. +* How to install dependencies, especially those that are more complex than a simple `bundle install`. For example, if I need to to install Redis or ImageMagick to work on the app, or configure environment variables to talk to external services, let me know up front. +* How to run the application’s test suite, to verify that setup was successful. Again, note special external dependencies, like PhantomJS. +* How to generate the docs, to get to a more detailed description of the application’s code. + +## Remove generated documentation from source control + +The HTML version of your Rails docs will need to be regenerated regularly, in order to keep up with the code they explain. Ignoring the doc/app directory makes sure that stale documentation doesn't stick around from commit to commit, and just makes commits cleaner in general. This is why it’s important to mention how to generate the docs in your README as they won’t be easily accessible, otherwise. + +## Write clear documentation + +* __Don't assume knowledge of the business__: If you've been working in the application for awhile, the names you've given your classes and methods may seem obvious, but to a newcomer they can be a large hurdle to overcome. Help explain ___why___ things are called what they are. +* __Do assume knowledge of Rails__: The rule of thumb is to document ___why___, now ___how___. Document under the assumption that the reader can read Ruby code, or at least knows how to search Google or Stack Overflow to learn more about specific methods. + +## YARD + RDOC + +We recommend utilizing the [YARD gem](http://yardoc.org/) in conjunction with the standard [RDOC documentation system](http://rdoc.sourceforge.net/doc/) to provide clear and consistent documentation on our projects. YARD fills in some of the gaps that RDOC does not address by allowing us to organize our codes meta and behavioural data through the use of [tags](http://www.rubydoc.info/gems/yard/file/docs/Tags.md). Not only does this create consistency between our projects, but it also more closely represents the way documentation blocks are handled via the other disciplines at The Nerdery, making point of entry into the language easier for an outside developer to understand. + +### The `.yardopts` file + +YARD accepts [many different options](http://www.rubydoc.info/gems/yard/YARD/CLI/Yardoc), and for ease of development it is recommended that you use a `.yardopts` file to outline these options. YARD will automatically parse this file every time `yard` is run and conform to it's requests. A recommended starter file is outlined below + + --private + --markup=markdown + app/**/*.rb - + lib/**/*.rb - + +This starter file tells YARD to document all private methods, interpret and render markup in the docblocks, and generate documenation for all *.rb files located in the app and lib folders. + +### Markdown format + +YARD supports [multiple formats](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Which_Markup_Format_) for it's markup rendering. Due to the industry wide acceptance and use of standard Markdown for most circumstances we recommends utilizing `markdown` as the format of choice on our Ruby projects. + +### Do's & Dont's + +[YARD](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md) and [RDOC](http://rdoc.sourceforge.net/doc/) are very extensive. We encourage you to read over the documentation and explore the vast amount of options available to you, however documenting too much, or using unwise practices can make your documentation just as bad as not having any at all. In this section we'll cover our recommended practices while using this documentation engine combination: + +#### __DO__ +* Provide a documentation block at the top of every class file. This should contain: + * A description of the classes function (___why___ not ___how___) within the application. + * Your [author name](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#author). + * A [version number](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#since) of when the class was first added to the project. +* Provide a documentation block at the top of every method with the exception of standard CRUD controller operations (`index`|`new`|`create`|`show`|`edit`|`update`|`destroy`). This should contain: + * A description of the methods function (___why___ not ___how___) within the class. + * All [paramaters](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#param) of the method. + * All [options](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#option) if an options Hash is being used as a param. + * A [return](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#return) value. If no return value is produced by the method `void` would be the expected return. +* Document all [model attributes](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Documenting_Attributes). Obviously this means writing each to their own line and not strining them together via commas. In the event you need separate documenation for the attributes getter and setter then follow [these steps]( http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Documentation_for_a_Separate_Attribute_Writer). +* Use [Duck-Type specifiers](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#Duck-Types) when appropriately. + +#### __DON'T__ +* Use YARD based [reference tags](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Reference_Tags). Although this methodology reduces DRY documentation it also enforces coupling. +* Overload your documentation. Having overly cumbersome documentation is just as bad as having no documentation at all. Keep your docblocks small, concise, and to the point. Often throughout the RubyDocs and YARD documentation pages you will be presented with large docblocks filled with markdown and html structures, unless this type of documentation adds significant understandability to the class or method we ask that you refrain from emulating this. "Short, Sweet, To The Point" +* Don't create [custom tags](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#Adding_Custom_Tags) unless absolutely vital to the understandability of the documentation. If you are presented with a case where you do need to make them ensure that you are always namespacing them. \ No newline at end of file diff --git a/standards/learning-resources.md b/standards/learning-resources.md new file mode 100644 index 0000000..fab922c --- /dev/null +++ b/standards/learning-resources.md @@ -0,0 +1,66 @@ +# Learning Resources + +If you are interested in learning Ruby then that's fantastic! Below you'll find a curated list of some of the best resources for getting started: + +1. [Nerdery Getting Started Guide](https://ruby.nerderylabs.com/training/training-module-0/) - for getting started. +1. [Code School](https://www.codeschool.com/learn/ruby) - fun, interactive video lessons. +1. [Ruby Warrior](https://www.bloc.io/ruby-warrior/) - a game for learning Ruby. +1. [Rails Best Practices](http://rails-bestpractices.com/) - for learning a *right* way. +1. [Rails Guides](http://guides.rubyonrails.org/) - the ultimate API document for figuring Rails out. +1. [Ruby Koans](http://rubykoans.com/) - learn the quirks of Ruby by fixing unit tests. + +# Installing Ruby on Rails + +Credit: Jordan's [Rails Best Practices](http://www.phantomdata.com/2016/07/21/rails-best-practices.html) guide. + +We work in a company with lots of different disciplines all commingling on a regular basis. PHP, .NET, Java, Rails and Python... we all get along pretty well. We're also quite adaptable and end up going where the work is - which might not necessarily be in our favorite discipline. The most common frustrations I see developers thrown into the Rails world is that of not having started from a good base. + +You see, Ruby is pretty popular. You might not know it, but a metric ton of the critical tools you use daily are built upon it. For the most part, unless you're running Windows, Ruby is already installed. ***gasp*** it was that easy? + +Not quite. That version that's installed is probably pretty old. Not only that, but Ruby's ecosystem is actually pretty complex and diverse. Over the years we've figured out ways to all work together - but most operating systems don't install Ruby that way. + +If you use your system Ruby, you are probably going to have a bad time. Follow below for steps to obviate that. + +## Linux + +Linux setup is pretty straight forward. If you've tried other guides, make sure to examine and clear any remnants from your `~/.bash_profile` and `~/.profile`. + +```sh +# Install basic developer tooling +sudo apt-get install build-essential libssl-dev git subversion imagemagick \ + libmagick-dev curl automake libpcre3-dev bison libmysqlclient-dev \ + libxslt-dev libpq-dev libreadline-dev libyaml-dev libcurl4-openssl-dev \ + postgresql postgresql-server-dev-9.1 git nodejs + +# Install RVM to properly select Ruby versions +gpg --keyserver hkp://keys.gnupg.net \ + --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +\curl -sSL https://get.rvm.io | bash -s stable + +# Install Ruby and Rails (you may have to restart your terminal) +rvm install ruby 2.3.1 +rvm use ruby 2.3.1 +gem install bundler rails +``` + +## OSX + +OSX setup is also pretty straight forward. If you've tried other guides, make sure to examine and clear any remnants from your `~/.bash profile` and `~/.profile`. + +```sh +# Install Homebrew so you can install other things +/usr/bin/ruby -e \ + "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +# Install a database and the most common image library +brew install imagemagick postgresql + +# Install RVM to properly select Ruby versions +gpg --keyserver hkp://keys.gnupg.net \ + --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +\curl -sSL https://get.rvm.io | bash -s stable + +# Install Ruby and Rails (you may have to restart your terminal) +rvm install ruby 2.3.1 +rvm use ruby 2.3.1 +gem install bundler rails +``` diff --git a/standards/rails-mvc.md b/standards/rails-mvc.md new file mode 100644 index 0000000..7d03e29 --- /dev/null +++ b/standards/rails-mvc.md @@ -0,0 +1,24 @@ +[Back to Rails Best Practices](/standards/rails.md#rails) + +## An MVC Primer + +Ruby on Rails is one of many frameworks that follows the MVC design pattern. This pattern dictates a distinct separation of concerns between the 3 major components: Model, View and Controller. Each component represents a layer which a request works its way through as it is serviced. + +Rails' concept of MVC dictates that a request is first serviced by a Controller which coordinates various components. This generally means that a Controller will speak to various Models to gather information and feed it up into a View. + +The Model Layer, as described by Rails, is responsible for handling the majority of business logic found within the application. For the vast majority of CRUD applications, this can be the files found within app/models. We'll talk about methods for obviating Model Bloat later. + +Once a Controller has gathered enough information from the Model layer - this information is fed up to a View layer by way of instance variables (`@cats = Cat.all`). This view layer is typically a `.erb` file which leverages standard Ruby syntax intermingled with HTML code. + +This separation gives us clear choices as to the locations of most items and helps to prevent spaghetti code by having different components talking which have no business knowing about each-other. + +### Stepping Outside of MVC + +MVC is not a silver bullet for every single problem. It *is* a damned good way to solve common web application architectures but it is often necessary to step outside of these boundaries. It is a subject of much debate and has no generally agreed upon solution within the Rails community. Since there is no clear winner, we have simply selected a pattern for you to follow: + +1. All domain-specific non-mvc code goes into `app/` - **eg: app/services/cakes_service.rb, app/factories/car_factory.rb, app/whatever** +1. All non-domain-specific non-mvc code goes into `lib/` - **eg: lib/thumbnail_generator.rb, lib/hmac_authenticator.rb, lib/ci_bootstrapper.rb** + +The predominant way that you will step out of the MVC pattern is through the usage and implementation of **service classes**. These classes are typically developed to split out particular *concerns* of a given domain object. You may find this at odds with Rails Concerns and rightfully so. Rails Concerns are a hotly debated topic in the Rails community, and as a whole we simply eschew towards using the more agnostic Service Class approach. + +You can find an in depth discussion about implementing service classes over on [Stitch Fix's blog](http://multithreaded.stitchfix.com/blog/2015/06/02/anatomy-of-service-objects-in-rails/). \ No newline at end of file diff --git a/standards/rails.md b/standards/rails.md new file mode 100644 index 0000000..b759da9 --- /dev/null +++ b/standards/rails.md @@ -0,0 +1,163 @@ +# Rails Best Practices + +## Overview + +Ruby on Rails is a framework that follows an MVC design pattern. If you are not familiar with MVC design patterns, check out our [MVC Primer](/standards/rails-mvc.md) for more information. + +## Non-MVC Code + +Not all code fits perfectly into the MVC pattern. Use the following as a guide when implementing non-MVC code: + +1. All domain-specific non-MVC code goes into `app/`. e.g.: `app/services/cakes_service.rb`, `app/factories/car_factory.rb`, `app/whatever` +1. All non-domain-specific non-MVC code goes into `lib/`. e.g.: `lib/thumbnail_generator.rb`, `lib/hmac_authenticator.rb`, `lib/ci_bootstrapper.rb` + +For code that falls outside of MVC, prefer to use **service classes** unless there is a compelling reason not to. + +### Service Classes + +Use the guidelines outlined by [Stitch Fix's blog](http://multithreaded.stitchfix.com/blog/2015/06/02/anatomy-of-service-objects-in-rails/) for implementing service objects. Their recommendations are as follows: + +* Do not store state +* Use instance methods, not class methods +* There should be very few public methods +* Method parameters should be value objects, either to be operated on or needed as input +* Methods should return rich result objects and not booleans +* Dependent service objects should be accessible via private methods, and created either in the constructor or lazily + +#### Service Class Example + +```ruby +# app/services/product_import_service.rb + +class ProductImportService + + # Initialize the service with any necessary (or optional) information + def initialize(connection: nil) + @connection = connection || Connection.new + end + + # Use a main public method + def process + # Do stuff + end + + private + # Additional supporting methods belong here + +end +``` + +## Namespacing + +For larger projects it's often beneficial to namespace related models, controllers, and views into sub-folders to help with organization. There are no hard and fast rules but it's helpful to be familiar with how to do it. + +For an in-depth discussion on why namespacing is valuable and strategies on how to organize projects, check out [Makandra's blog](https://blog.makandra.com/2014/12/organizing-large-rails-projects-with-namespaces/). + +#### Namespacing Example +``` +# app/models + +/activity +/api +/contact +/invoice +/planner +/report +/project +activity.rb +contact.rb +planner.rb +invoice.rb +project.rb +user.rb +``` + +## Models + +* Keep your models small +* Logic that can be cleanly collected into a specific **business concern** should be split out into a **service class** + * e.g. `Product.import_products` should be refactored into `ProductImportService` +* Use models for `has_and_belongs_to_many:` relationships, e.g. `has_many: :a_things, through: :a_b_things` +* Namespace related models where it makes sense to do so + +## Controllers + +* Keep your controllers small - they control things, they don't **do** things +* Use restful routing as much as possible. Avoid non-CRUD actions unless you have a compelling reason + +## Front End + +The below guidelines are for work done in a team of Rails developers, designed with maintainability and ease of project ramp-up for new Rails people in mind. + +When working with a front end developer, talk with them to see what standards and tooling they like to use. + +### CSS + +* Use SCSS for all your files, including `application.scss` +* Don't use controller-generated asset files +* Keep your CSS modular and component-based +* Use SCSS variables for things like colors, generic padding, and spacing, and keep them in a `_vars.scss` file + +A typical folder setup will look something like this: + +``` +base/ + _elements.scss + _fonts.scss + _reset.scss +helpers/ + _utils.scss + _vars.scss +landmarks/ + _header.scss + ... +modules/ + _btn.scss + ... +_screen.scss # loads everything in subfolders +application.scss # loads _screen.scss, and any other applicable stylesheets +``` + +### Javascript + +* Use Javascript, not Coffeescript +* Use Yarn to load Javascript libraries in Rails 5 +* Avoid using frameworks with a large learning curve such as React, Angular, etc. unless there is a compelling reason to use it for the project +* Prefer using jQuery where possible +* Like with CSS, keep your Javascript in modular files that make sense for the project structure + +A typical folder setup will look something like this: + +``` +views/ + carouselView.js + productFormView.js + ... +application.js # loads main.js, and any other applicable javascript +main.js # loads everything in subfolders, may contain initialization code +``` + +### Generators + +To prevent generating stylesheets and Javascript files for new controllers, add the following to `application.rb`: + +```ruby +config.generators do |g| + g.assets false +end +``` + +### Views + +* Keep business logic and database queries out of views +* Use regular `.erb` in HTML files, not Haml or another templating language +* Use partials responsibly - it's easy to use too many partials, or add too many details and checks into one partial when it should be split into multiple partials. + +### Helpers + +* Use helpers for display logic, especially if it needs to be used in multiple parts of the site +* Don't use helpers for business logic + +## Code Quality + +See [Ruby Best Practices](/standards/ruby.md#quality) for recommended tooling and code quality expectations. diff --git a/standards/ruby.md b/standards/ruby.md new file mode 100644 index 0000000..8713a52 --- /dev/null +++ b/standards/ruby.md @@ -0,0 +1,46 @@ +# Ruby Best Practices + +## Formatting + +For general Ruby formatting, refer to the excellent community-driven [Ruby Style Guide](https://github.com/bbatsov/ruby-style-guide). + +## Code Quality + +Use [Rubycritic](https://github.com/whitesmith/rubycritic) to lint projects and check for general code smells. This gem is a wrapper for several other code quality gems including Reek and Rubocop. + +Other useful code quality gems include: +* [Brakeman](https://github.com/presidentbeef/brakeman) +* [Bullet](https://github.com/flyerhzm/bullet) +* [SimpleCov](https://github.com/colszowka/simplecov) + +```ruby +group :development do + gem 'brakeman', require: false + gem 'bullet', require: false + gem 'rubycritic', require: false +end + +group :test do + gem 'simplecov', require: false +end +``` + + + + + +## Debugging & Development Errors + +Use [Better Errors](https://github.com/charliesome/better_errors) for quick access to a console on development runtime errors, and [Byebug](https://github.com/deivid-rodriguez/byebug) for line-by-line debugging. + +```ruby +group :development do + # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. + gem 'better_errors' + gem 'binding_of_caller' +end + +group :development, :test do + gem 'byebug' +end +``` \ No newline at end of file diff --git a/standards/source-control.md b/standards/source-control.md new file mode 100644 index 0000000..09c0be3 --- /dev/null +++ b/standards/source-control.md @@ -0,0 +1,28 @@ +# Source Control Practices + +## Hosting + +There are 2 primary means for hosting source control on Nerdery Rails projects: + +1. GitHub +1. Self-hosted Nerdery BitBucket + +GitHub is our usual go-to for source control hosting as it provides the highest level of 3rd party service integration. This level of service allows for easy integration with 3rd party tools like CircleCI, CodeClimate and Heroku. + +Our internally self-hosted Nerdery BitBucket service provides a bare-bones code hosting solution that is useful when a client does not wish to pay any additional fees. It lacks 3rd party support for our typical tools (such as CircleCI, Code Climate and Gemnasium), so you will need to budget in additional time (40-80hours) for integration with our internal CI server Bamboo. + +## Branching Strategies + +Use [git flow](http://nvie.com/posts/a-successful-git-branching-model/), unless there's a good project-specific reason not to. + +Projects should include a **contributing** section within `README.md` that specifies what strategy is being used, and the basic expectations of contributing to that project. + +An example from a recent project (2016/09/16): + +> **Contributing** +> +> This project is leveraging *Pull Requests* for handling code management. For each **feature** that you are looking to build, create a branch off of `develop` with the format of `feature/my-feature`. Once complete, make a Pull Request and a lead should review your request and merge it into develop once complete. +> +> Before making a PR, ensure that you have merged develop back into your branch and that all tests & rubocops are passing. Your PR will not be merged in if these conditions are not met. +> +> For **emergency fixes**, branch off of `master` to make your fix. Once tested and complete, merge this branch back into master and then develop. diff --git a/standards/testing.md b/standards/testing.md new file mode 100644 index 0000000..a6a917a --- /dev/null +++ b/standards/testing.md @@ -0,0 +1,11 @@ +# Testing Best Practices + +Coming soon! + + + + + + + + \ No newline at end of file diff --git a/standards/third-party.md b/standards/third-party.md new file mode 100644 index 0000000..0542f1d --- /dev/null +++ b/standards/third-party.md @@ -0,0 +1,67 @@ +# 3rd Party Gems + +## Admin Interfaces + +This is a highly subjective choice that should be deeply considered for the given project. There are roughly 2 modern choices on this subject: + +1. [Administrate](https://github.com/thoughtbot/administrate) +1. Custom + +Administrate is a useful gem for non-customizable, easy and quick administrative interfaces. The type of project that this would be useful on is probably the same one that uses Twitter Bootstrap and needs to be done tomorrow. It falls down heavily when we need to start customizing the administrative back-end to support client demands. + +Honestly, writing custom CRUD operations for basic forms is a trivial and relatively fast task. It is boring and thankless work, but in the end it provides a solid foundation upon which we can make the customizations that most of our clients are looking for in a Rails based project. + +*Please note*, ActiveAdmin purposefully does not show up in this list because they have been slow to keep up with major versions of Rails. Even as of this writing, Rails 5 support is present only in master and is listed as "preliminary". + +## Authentication + +Our usual choice for Authentication needs is [Devise](https://github.com/plataformatec/devise). It is the de-facto standard for the Rails community and carries with it strong community support and high quality documentation. It is also very easy to customize and skin to our exact needs as defined on a project by project basis. + + +Our typical setup procedure for devise looks something like: + +```sh +$ rails generate devise:install +$ rails generate devise User +$ rails generate devise:views +``` + +For the most part, any deviations from Devise's standard functionality is a result of custom needs on a project. Devise has excellent documentation on their GitHub page and can easily be extended to support most of our needs. + +If you find yourself repeatedly doing something, please don't hesitate to open an issue so that we can document it here. + +## Background Jobs + +Background Job runners are a fairly cut-and-dry bunch without too many differentiators. Our developer have the most experience with [Delayed::Job](https://github.com/collectiveidea/delayed_job), so that is what we'll usually expect to find on a given project. + +If you find one that you *really* like and feel is way superior, please open an issue or a PR so that we can have a discussion about it. + +## File Uploads and Storage + +[Carrierwave](https://github.com/carrierwaveuploader/carrierwave) is another choice we often use. It provides all the same support for storage (thanks to Fog). One main difference, between it and Paperclip, is its ability to [cache a file after upload so it does not require uploading again after an invalid form submission](https://github.com/carrierwaveuploader/carrierwave#making-uploads-work-across-form-redisplays). Our primary recommendation is to use CarrierWave. + +[Paperclip](https://github.com/thoughtbot/paperclip) is a good choice for handling file uploads and storage. It provides excellent support for local storage as well as storage to S3 via Fog. Its usage and support is well understood by most Rails developers and carries a high amount of hive-knowledge. + +## Pagination + +[Kaminari](https://github.com/amatsuda/kaminari) - just use it. + +# 3rd Party Services + +Our standard package of 3rd party services includes the following: + +1. AWS for Application Hosting +1. GitHub for Code Hosting +1. CircleCI for Continuous Integration / Deployment + +Since GitHub and CircleCI are discussed above, the rest of this section will deal specifically with AWS. + +There are many hosting providers that provide a variety of costs, but AWS provides the simplest and cleanest growth path of any provider. It easily and cost-effectively allows us to scale from a small single-server application to a load balanced multi-tiered SoA style app while still maintaining a continuity of service. + +Our typical usages of AWS include: + +1. EC2 instances for hosting applications +1. RDS instances for hosting databases +1. S3 for hosting uploaded files +1. ElastiCache instances for hosting in-memory data stores +1. OpsWorks for provisioning each if the size or complexity is large \ No newline at end of file