simeonwillbanks/mygists — pull request #26 by simeonwillbanks (2013-01-08 04:21:41+00:00)
Title: Refactor and reorganize

Follow GitHub Styleguide

* Reorganize SCSS files into appropriate directories
* Use ids for elements which exist a single time
* Move CoffeeScript files into appropriate directories
* Add MyGists::GithubSession.set_auth to extract logic from Warden initializer into a testable class
* In case the user has no gists, kindly encourage them to create and tag some gists
* Add Github model as a data container for GitHub urls
* Expose Github model to views via ApplicationHelper.github
* Refactor user tags AJAX loading by extracting logic into a namespaced JavaScript object
* Add konacha, sinon-rails and sinon-chai-rails gems for JavaScript specs
* Add sinon fake servers to mock AJAX responses
* Add spec helper for JavaScript specs
* Add specs for MyGists.Fetch.tags success and failure paths
* Use def self.method to define singleton methods. This makes the methods more resistant to refactoring changes.
* Leave one blank line above protected and private
* Use spaces around { and before }
* Break up a method into logical paragraphs
* Refactor ProfileDecorator#gists by replacing method chaining with the scope Gist.find_page_by_tag_name_and_profile
* Use spaces around the = operator when assigning default values to method parameters
* Prefer %w to the literal array syntax when you need an array of strings
* Use symbols instead of strings as hash keys
* Prefer double-quoted strings