Skip to content

Instantly share code, notes, and snippets.

View pinyin's full-sized avatar
🎯
Focusing

Bao Bo pinyin

🎯
Focusing
View GitHub Profile

Ember.Console

This is a set of helpers for finding the application's currently active models/routes/controllers/etc. This isn't a straightforward process because of how Ember (rightly) encapsulates application objects, but it's useful in debugging environments to be able to quickly access them. And with the beta release of Ember Data, the store is not easily accessible without helpers either.

Usage

All helpers can be called directly if you provide them an application instance:

require "gimli"
require "yaml"
ROOT_PATH = "~/Documents/ember_guides/"
TABLE_OF_CONTENT_PATH = ROOT_PATH+"website/data/guides.yml"
GUIDE_FILES_PATH = ROOT_PATH+"website/source/guides/"
def concatenated_path
yaml_table_of_content = YAML.load_file TABLE_OF_CONTENT_PATH
concatenated_paths = []