mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-22 00:10:15 +00:00
style: clean up comments in jrs-theme.coffee
This commit is contained in:
parent
54d056c4b7
commit
e6e0b135ed
8
dist/core/jrs-theme.js
vendored
8
dist/core/jrs-theme.js
vendored
@ -6,7 +6,7 @@ Definition of the JRSTheme class.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var JRSTheme, PATH, _, parsePath, pathExists;
|
var JRSTheme, PATH, _, errors, parsePath, pathExists;
|
||||||
|
|
||||||
_ = require('underscore');
|
_ = require('underscore');
|
||||||
|
|
||||||
@ -16,6 +16,8 @@ Definition of the JRSTheme class.
|
|||||||
|
|
||||||
pathExists = require('path-exists').sync;
|
pathExists = require('path-exists').sync;
|
||||||
|
|
||||||
|
errors = require('./status-codes');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The JRSTheme class is a representation of a JSON Resume theme asset.
|
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
|
@method open
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -70,7 +72,7 @@ Definition of the JRSTheme class.
|
|||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
throw {
|
throw {
|
||||||
fluenterror: HACKMYSTATUS.missingPackageJSON
|
fluenterror: errors.missingPackageJSON
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
@ -10,6 +10,7 @@ _ = require 'underscore'
|
|||||||
PATH = require 'path'
|
PATH = require 'path'
|
||||||
parsePath = require 'parse-filepath'
|
parsePath = require 'parse-filepath'
|
||||||
pathExists = require('path-exists').sync
|
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
|
@method open
|
||||||
###
|
###
|
||||||
open: ( thFolder ) ->
|
open: ( thFolder ) ->
|
||||||
|
|
||||||
@folder = thFolder
|
@folder = thFolder
|
||||||
|
|
||||||
# Open the [theme-name].json file; should have the same
|
|
||||||
# name as folder
|
|
||||||
pathInfo = parsePath thFolder
|
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'
|
pkgJsonPath = PATH.join thFolder, 'package.json'
|
||||||
if pathExists pkgJsonPath
|
if pathExists pkgJsonPath
|
||||||
thApi = require thFolder
|
thApi = require thFolder # Requiring the folder yields whatever the package.json's "main" is set to
|
||||||
thPkg = require pkgJsonPath
|
thPkg = require pkgJsonPath # Get the package.json as JSON
|
||||||
this.name = thPkg.name
|
this.name = thPkg.name
|
||||||
this.render = (thApi && thApi.render) || undefined
|
this.render = (thApi && thApi.render) || undefined
|
||||||
this.engine = 'jrs'
|
this.engine = 'jrs'
|
||||||
@ -65,7 +63,7 @@ class JRSTheme
|
|||||||
css: null
|
css: null
|
||||||
}]
|
}]
|
||||||
else
|
else
|
||||||
throw { fluenterror: HACKMYSTATUS.missingPackageJSON };
|
throw fluenterror: errors.missingPackageJSON
|
||||||
@
|
@
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user