1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-12-22 13:37:21 +00:00

style: clean up comments in jrs-theme.coffee

This commit is contained in:
hacksalot 2018-02-01 19:22:17 -05:00
parent 54d056c4b7
commit e6e0b135ed
No known key found for this signature in database
GPG Key ID: 2F343EC247CA4B06
2 changed files with 11 additions and 11 deletions

View File

@ -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;

View File

@ -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
@