Skip to content

Commit

Permalink
Change "other" to "guests".
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhobbs committed Nov 7, 2017
1 parent 15b7f6c commit ca836f2
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
deploy.sh
node_modules/
parrots.zip
other.zip
guests.zip
dist/

# Created by https://www.gitignore.io/api/vim,osx
Expand Down
File renamed without changes.
File renamed without changes
16 changes: 8 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ gulp.task('render', ['test', 'zip', 'css'], function () {
}
return {
parrots: JSON.parse(fs.readFileSync('parrots.json')).map(ParrotObjectAddSlackName),
other: JSON.parse(fs.readFileSync('other.json')).map(ParrotObjectAddSlackName),
guests: JSON.parse(fs.readFileSync('guests.json')).map(ParrotObjectAddSlackName),
assets: assets,
zip: JSON.parse(fs.readFileSync('dist/rev-manifest.json'))['parrots.zip'],
other_zip: JSON.parse(fs.readFileSync('dist/rev-manifest.json'))['other.zip']
guests_zip: JSON.parse(fs.readFileSync('dist/rev-manifest.json'))['guests.zip']
};
}))
.pipe(mustache())
.pipe(gulp.dest("dist/"));
});

gulp.task('zip', ['compress', 'other-compress'], function () {
gulp.task('zip', ['compress', 'guests-compress'], function () {
return gulp.src('*.zip')
.pipe(rev())
.pipe(gulp.dest('dist/'))
Expand All @@ -102,11 +102,11 @@ gulp.task('compress', ['test'], function (cb) {
});
});

gulp.task('other-compress', ['test'], function (cb) {
exec('rm -f ./other.zip', function (err, stdout, stderr) {
gulp.task('guests-compress', ['test'], function (cb) {
exec('rm -f ./guests.zip', function (err, stdout, stderr) {
console.log(stderr);
if(err != null) { cb(err); }
exec("echo \" ~= Party or Die =~\n~= cultofthepartyparrot.com =~\" | zip -o -r -z ./other.zip ./other/*", function(err, stdout, stderr) {
exec("echo \" ~= Party or Die =~\n~= cultofthepartyparrot.com =~\" | zip -o -r -z ./guests.zip ./guests/*", function(err, stdout, stderr) {
console.log(stderr);
cb(err);
});
Expand All @@ -118,8 +118,8 @@ gulp.task('images', function () {
.pipe(gulp.dest('dist/'));
gulp.src('parrots/**/*')
.pipe(gulp.dest('dist/parrots/'));
gulp.src('other/**/*')
.pipe(gulp.dest('dist/other/'));
gulp.src('guests/**/*')
.pipe(gulp.dest('dist/guests/'));
return gulp.src('src/*.{svg,png,jpg,gif}')
.pipe(imagemin())
.pipe(gulp.dest('dist/assets/'));
Expand Down
12 changes: 6 additions & 6 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ <h3>Keyboards!</h3>

<hr/>

<h3>Other Party Things</h3>
<h3>Party Guests</h3>

<ul>
{{#other}}
<li><img src="/other/{{#hd}}{{{hd}}}{{/hd}}{{^hd}}{{gif}}{{/hd}}" alt="{{name}}"/> {{name}}{{#hd}}<span class="hd">HD</span>{{/hd}}{{#tip}}<span tooltip="{{tip}}">*</span>{{/tip}}</li>
{{/other}}
{{#guests}}
<li><img src="/guests/{{#hd}}{{{hd}}}{{/hd}}{{^hd}}{{gif}}{{/hd}}" alt="{{name}}"/> {{name}}{{#hd}}<span class="hd">HD</span>{{/hd}}{{#tip}}<span tooltip="{{tip}}">*</span>{{/tip}}</li>
{{/guests}}
</ul>

<div id="other_download">
<a class="button-small" id="other_zip" href="/{{other_zip}}">Download</a>
<a class="button-small" id="guests_zip" href="/{{guests_zip}}">Download</a>
<p>(zip)</p>
</div>

Expand Down Expand Up @@ -210,7 +210,7 @@ <h3>Other Party Things</h3>
}
}
trackLinkClickEvent("parrots_zip", "parrots.zip");
trackLinkClickEvent("other_zip", "other.zip");
trackLinkClickEvent("guests_zip", "guests.zip");
trackLinkClickEvent("parrot_svg", "parrot.svg");

if(window.console && window.console.log) { console.log("PARTY PARROT WANTS YOUR SOUL: http://codepen.io/codevinsky/full/LWprYo/"); }
Expand Down
32 changes: 16 additions & 16 deletions test/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ describe("parrots.json", function () {
});
});

describe("other.json", function () {
describe("guests.json", function () {
it("should validate", function () {
var other_json = JSON.parse(fs.readFileSync(__dirname + '/../other.json', 'utf8')),
validation_result = validate(other_json, json_schema);
var guests_json = JSON.parse(fs.readFileSync(__dirname + '/../guests.json', 'utf8')),
validation_result = validate(guests_json, json_schema);

// Schema errors in mocha are pretty useless, so print some here.
validation_result.errors.forEach(function (e) {
Expand All @@ -85,27 +85,27 @@ describe("other.json", function () {
});

it("should not have extra gifs", function () {
var other_json = JSON.parse(fs.readFileSync(__dirname + '/../other.json', 'utf8'));
other_json.forEach(function(other) {
assert.ok(fs.existsSync(__dirname + '/../other/' + other.gif) || fs.existsSync(__dirname + '/../other/' + other.hd), other.name);
var guests_json = JSON.parse(fs.readFileSync(__dirname + '/../guests.json', 'utf8'));
guests_json.forEach(function(guests) {
assert.ok(fs.existsSync(__dirname + '/../guests/' + guests.gif) || fs.existsSync(__dirname + '/../guests/' + guests.hd), guests.name);
});
});

it("should contain all gifs", function () {
var other = JSON.parse(fs.readFileSync(__dirname + '/../other.json', 'utf8')).map(function(other) { return other.gif; }).filter(function(gif) { return gif != undefined; });
var other_gifs = fs.readdirSync(__dirname + '/../other');
other_gifs.forEach(function(gif) {
if(! fs.statSync(__dirname + '/../other/' + gif).isFile()) { return; }
assert.ok(-1 !== other.indexOf(gif), gif);
var guests = JSON.parse(fs.readFileSync(__dirname + '/../guests.json', 'utf8')).map(function(guests) { return guests.gif; }).filter(function(gif) { return gif != undefined; });
var guests_gifs = fs.readdirSync(__dirname + '/../guests');
guests_gifs.forEach(function(gif) {
if(! fs.statSync(__dirname + '/../guests/' + gif).isFile()) { return; }
assert.ok(-1 !== guests.indexOf(gif), gif);
});
});

it("should contain all HD gifs", function () {
var hd_other = JSON.parse(fs.readFileSync(__dirname + '/../other.json', 'utf8')).map(function(other) { return other.hd; }).filter(function(hd) { return hd != undefined; });
var other_hd_gifs = fs.readdirSync(__dirname + '/../other/hd');
other_hd_gifs.forEach(function(gif) {
if(! fs.statSync(__dirname + '/../other/hd/' + gif).isFile()) { return; }
assert.ok(-1 !== hd_other.indexOf('hd/' + gif), gif);
var hd_guests = JSON.parse(fs.readFileSync(__dirname + '/../guests.json', 'utf8')).map(function(guests) { return guests.hd; }).filter(function(hd) { return hd != undefined; });
var guests_hd_gifs = fs.readdirSync(__dirname + '/../guests/hd');
guests_hd_gifs.forEach(function(gif) {
if(! fs.statSync(__dirname + '/../guests/hd/' + gif).isFile()) { return; }
assert.ok(-1 !== hd_guests.indexOf('hd/' + gif), gif);
});
});
});
24 changes: 12 additions & 12 deletions test/size.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,39 @@ describe("gifs", function() {

it("in HD should weight less than 64KB", function() {
var parrot_hd_gifs = fs.readdirSync(__dirname + '/../parrots/hd'),
other_hd_gifs = fs.readdirSync(__dirname + '/../other/hd');
guests_hd_gifs = fs.readdirSync(__dirname + '/../guests/hd');

parrot_hd_gifs.forEach(function(gif) {
var size = fs.statSync(__dirname + '/../parrots/hd/' + gif).size;
assert(size <= convert(64).from('KB').to('B'), gif + " is too big(" + convert(size).from('B').to('KB') + " KB)");
});

other_hd_gifs.forEach(function(gif) {
var size = fs.statSync(__dirname + '/../other/hd/' + gif).size;
guests_hd_gifs.forEach(function(gif) {
var size = fs.statSync(__dirname + '/../guests/hd/' + gif).size;
assert(size <= convert(64).from('KB').to('B'), gif + " is too big(" + convert(size).from('B').to('KB') + " KB)");
});
});

it("in SD should weight less than 64KB", function() {
var parrot_gifs = fs.readdirSync(__dirname + '/../parrots'),
other_gifs = fs.readdirSync(__dirname + '/../other');
guests_gifs = fs.readdirSync(__dirname + '/../guests');

parrot_gifs.forEach(function(gif) {
var size = fs.statSync(__dirname + '/../parrots/' + gif).size;
assert(size <= convert(64).from('KB').to('B'), gif + " is too big(" + convert(size).from('B').to('KB') + " KB)");
});

other_gifs.forEach(function(gif) {
var size = fs.statSync(__dirname + '/../other/' + gif).size;
guests_gifs.forEach(function(gif) {
var size = fs.statSync(__dirname + '/../guests/' + gif).size;
assert(size <= convert(64).from('KB').to('B'), gif + " is too big(" + convert(size).from('B').to('KB') + " KB)");
});
});

it("should never be wider or taller than 128px", function () {
var parrot_hd_gifs = fs.readdirSync(__dirname + '/../parrots/hd'),
parrot_gifs = fs.readdirSync(__dirname + '/../parrots'),
other_hd_gifs = fs.readdirSync(__dirname + '/../other/hd'),
other_gifs = fs.readdirSync(__dirname + '/../other');
guests_hd_gifs = fs.readdirSync(__dirname + '/../guests/hd'),
guests_gifs = fs.readdirSync(__dirname + '/../guests');

parrot_gifs.forEach(function(gif) {
if(gif == "hd") { return; } // Skip the HD directory
Expand All @@ -55,15 +55,15 @@ describe("gifs", function() {
assert(dimensions.height <= 128, gif + " is taller than 128px");
});

other_gifs.forEach(function(gif) {
guests_gifs.forEach(function(gif) {
if(gif == "hd") { return; } // Skip the HD directory
var dimensions = imageSize(__dirname + '/../other/' + gif);
var dimensions = imageSize(__dirname + '/../guests/' + gif);
assert(dimensions.width <= 128, gif + " is wider than 128px");
assert(dimensions.height <= 128, gif + " is taller than 128px");
});

other_hd_gifs.forEach(function(gif) {
var dimensions = imageSize(__dirname + '/../other/hd/' + gif);
guests_hd_gifs.forEach(function(gif) {
var dimensions = imageSize(__dirname + '/../guests/hd/' + gif);
assert(dimensions.width <= 128, gif + " is wider than 128px");
assert(dimensions.height <= 128, gif + " is taller than 128px");
});
Expand Down

0 comments on commit ca836f2

Please sign in to comment.