diff --git a/dist/core/jrs-theme.js b/dist/core/jrs-theme.js index 8b08be9..79ff58a 100644 --- a/dist/core/jrs-theme.js +++ b/dist/core/jrs-theme.js @@ -6,7 +6,7 @@ Definition of the JRSTheme class. */ (function() { - var JRSTheme, PATH, _, parsePath, pathExists; + var JRSTheme, PATH, _, errors, parsePath, pathExists; _ = require('underscore'); @@ -16,6 +16,8 @@ Definition of the JRSTheme class. pathExists = require('path-exists').sync; + errors = require('./status-codes'); + /** The JRSTheme class is a representation of a JSON Resume theme asset. @@ -27,7 +29,7 @@ Definition of the JRSTheme class. /** - Open and parse the specified theme. + Open and parse the specified JRS theme. @method open */ @@ -70,7 +72,7 @@ Definition of the JRSTheme class. }; } else { throw { - fluenterror: HACKMYSTATUS.missingPackageJSON + fluenterror: errors.missingPackageJSON }; } return this; diff --git a/src/core/jrs-theme.coffee b/src/core/jrs-theme.coffee index e8e60c9..0d4d26d 100644 --- a/src/core/jrs-theme.coffee +++ b/src/core/jrs-theme.coffee @@ -10,6 +10,7 @@ _ = require 'underscore' PATH = require 'path' parsePath = require 'parse-filepath' pathExists = require('path-exists').sync +errors = require './status-codes' @@ -22,22 +23,19 @@ class JRSTheme ###* - Open and parse the specified theme. + Open and parse the specified JRS theme. @method open ### open: ( thFolder ) -> @folder = thFolder - - # Open the [theme-name].json file; should have the same - # name as folder pathInfo = parsePath thFolder - # Open and parse the theme's package.json file. + # Open and parse the theme's package.json file pkgJsonPath = PATH.join thFolder, 'package.json' if pathExists pkgJsonPath - thApi = require thFolder - thPkg = require pkgJsonPath + thApi = require thFolder # Requiring the folder yields whatever the package.json's "main" is set to + thPkg = require pkgJsonPath # Get the package.json as JSON this.name = thPkg.name this.render = (thApi && thApi.render) || undefined this.engine = 'jrs' @@ -65,7 +63,7 @@ class JRSTheme css: null }] else - throw { fluenterror: HACKMYSTATUS.missingPackageJSON }; + throw fluenterror: errors.missingPackageJSON @