Skip to content

Commit 9540f3f

Browse files
committed
Move docs to /docs/ and blacklist plugin names. Fixes jquery-archive#41.
1 parent 6962cd8 commit 9540f3f

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

lib/blacklist.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
"docs"
3+
]

lib/service.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
var semver = require( "semver" ),
22
Step = require( "step" ),
33
config = require( "./config" ),
4-
suites = require( "./suites" );
4+
suites = require( "./suites" ),
5+
blacklist = require( "./blacklist" );
56

67
function extend( a, b ) {
78
for ( var prop in b ) {
@@ -62,6 +63,8 @@ extend( Repo.prototype, {
6263
errors.push( "Invalid data type for name; must be a string." );
6364
} else if ( !(/^[a-zA-Z0-9_\.\-]+$/).test( manifest.name ) ) {
6465
errors.push( "Name contains invalid characters." );
66+
} else if ( blacklist.indexOf( manifest.name ) !== -1 ) {
67+
errors.push( "Name must not be '" + manifest.name + "'." );
6568
} else {
6669
if ( prefix ) {
6770
if ( manifest.name.indexOf( prefix ) !== 0 ) {

site-content/page/docs.html

Whitespace-only changes.
File renamed without changes.

test/service.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ var tests = {
9191
]);
9292
},
9393

94+
"name - blacklisted": function( manifest, fn ) {
95+
manifest.name = "docs";
96+
fn( manifest, manifest.version, [
97+
"Name must not be 'docs'."
98+
]);
99+
},
100+
94101
"version - invalid type": function( manifest, fn ) {
95102
manifest.version = 1;
96103
fn( manifest, manifest.version, [

0 commit comments

Comments
 (0)