Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from Springworks/febreze
Browse files Browse the repository at this point in the history
Cleanup and scope name
  • Loading branch information
petrenkotino committed Sep 30, 2015
2 parents a874075 + ca4bf02 commit 35fa2ee
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 769 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ files-to-import/*
old-files/*
temp/*
zip-files/*

.idea
3 changes: 0 additions & 3 deletions .gjslintrc

This file was deleted.

12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
sudo: false
language: node_js
before_install:
- mkdir -p "$HOME"/.local/lib/python2.7/site-packages
- 'export PATH="$HOME/.local/bin:$PATH"'
- 'export PYTHONPATH="$HOME"/.local/lib/python2.7/site-packages:"$PYTHONPATH"'
- 'npm install && easy_install --prefix="$HOME"/.local http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz'
node_js:
- "0.10"
- "4"
script:
- make lint
- npm test
after_success:
- NODE_ENV=test istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- --recursive -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
- npm run coveralls
notifications:
email: false
686 changes: 17 additions & 669 deletions LICENSE

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions Makefile

This file was deleted.

8 changes: 1 addition & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
/**
* Bootstrap for the Holidays module.
*/
'use strict';


// Module dependencies
var path = require('path');


/** @see bootStrap */
module.exports = exports = Holidays;


Expand Down Expand Up @@ -75,5 +70,4 @@ Holidays.prototype.setLocale = function(locale) {
Object.keys(holiday_functions).forEach(function(key) {
this[key] = holiday_functions[key];
}, this);

};
8 changes: 1 addition & 7 deletions lib/l10n/_template.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/**
* Template public holidays.
*/

// Module dependencies.
var moment = require('moment');

'use strict';

/**
* The current locale.
Expand Down
8 changes: 1 addition & 7 deletions lib/l10n/en-us.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/**
* US public holidays.
*/

// Module dependencies.
var moment = require('moment');

'use strict';

/**
* The current locale.
Expand Down
9 changes: 1 addition & 8 deletions lib/l10n/sv-se.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/**
* Swedish public holidays.
*/
'use strict';

// Module dependencies.
var moment = require('moment');


// Parse format
var DATE_FORMAT = 'YYYY-MM-DD';

// Static date holidays
var STATIC_HOLIDAYS = {
'Nyårsdagen': {'month': 1, 'day': 1},
'Trettondedag jul': {'month': 1, 'day': 6},
Expand All @@ -19,7 +13,6 @@ var STATIC_HOLIDAYS = {
'Annandag jul': {'month': 12, 'day': 26}
};

// Dynamic holiday filters
var DYNAMIC_HOLIDAYS = [
isGoodFriday, isEasterSunday, isEasterMonday,
isAscensionDay, isPentecost, isMidsummerDay,
Expand Down
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "node-holidays",
"name": "@springworks/holidays",
"version": "0.2.0",
"description": "Utils to manage public holidays.",
"main": "index.js",
"scripts": {
"test": "NODE_ENV=test istanbul cover --report teamcity --report lcov _mocha -- --ui bdd --check-leaks --slow 200 --recursive --reporter spec test",
"lint": "gjslint -r . --strict --max_line_length 100 -e \".idea, coverage, node_modules\""
"test": "NODE_ENV=test istanbul cover --report lcov _mocha -- --ui bdd --check-leaks --slow 20 --recursive --reporter spec test",
"coveralls": "cat ./coverage/lcov.info | coveralls"
},
"repository": {
"type": "git",
Expand All @@ -16,14 +16,13 @@
"url": "https://github.com/Springworks/node-holidays/issues"
},
"dependencies": {
"moment": "^2.8.1"
"moment": "2.10.6"
},
"devDependencies": {
"coveralls": "~2.10.0",
"istanbul": "~0.2.11",
"mocha": "~1.20.1",
"mocha-lcov-reporter": "0.0.1",
"should": "~4.0.4"
"coveralls": "2.11.4",
"istanbul": "0.3.21",
"mocha": "2.3.3",
"should": "7.1.0"
},
"license": "MIT"
}
8 changes: 2 additions & 6 deletions test/l10n/en-US.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/**
* Tests for the US localized version.
*/
'use strict';


// Module dependencies
var should = require('should');
var holidays = require('../../index.js')('en-US');

Expand All @@ -14,7 +10,7 @@ describe('node-holidays/en-US.js', function() {
});

it('Should be possible to check static date holidays', function() {
holidays.isHoliday('10/01/2014').should.be.false;
holidays.isHoliday('10/01/2014').should.be.false();
});

});
68 changes: 32 additions & 36 deletions test/l10n/sv-SE.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
/**
* Tests for the swedish localized version.
*/
'use strict';


// Module dependencies
var should = require('should');
var moment = require('moment');
var holidays = require('../../index.js')('sv-SE');
Expand All @@ -15,14 +11,14 @@ describe('node-holidays/sv-SE.js', function() {
momentNonHolidayDate = moment('2014-12-24', 'YYYY-MM-DD');

// isHoliday
holidays.isHoliday(momentHolidayDate).should.be.true;
holidays.isHoliday(momentNonHolidayDate).should.be.false;
holidays.isHoliday('2014-12-26').should.be.true;
holidays.isHoliday('2014-12-24').should.be.false;
holidays.isHoliday(momentHolidayDate).should.be.true();
holidays.isHoliday(momentNonHolidayDate).should.be.false();
holidays.isHoliday('2014-12-26').should.be.true();
holidays.isHoliday('2014-12-24').should.be.false();

// getHolidays
holidays.getHolidays(momentHolidayDate).should.be.an.Array;
holidays.getHolidays(2014).should.be.an.Array;
holidays.getHolidays(momentHolidayDate).should.be.an.Array();
holidays.getHolidays(2014).should.be.an.Array();
});

it('Should return an array with all the holidays for a given year.', function() {
Expand All @@ -47,34 +43,34 @@ describe('node-holidays/sv-SE.js', function() {

it('Should be possible to check static date holidays', function() {
// Nyårsdagen
holidays.isHoliday('2013-01-01').should.be.true;
holidays.isHoliday('2014-01-01').should.be.true;
holidays.isHoliday('2015-01-01').should.be.true;
holidays.isHoliday('2013-01-01').should.be.true();
holidays.isHoliday('2014-01-01').should.be.true();
holidays.isHoliday('2015-01-01').should.be.true();

// Trettondedag jul
holidays.isHoliday('2013-01-06').should.be.true;
holidays.isHoliday('2014-01-06').should.be.true;
holidays.isHoliday('2015-01-06').should.be.true;
holidays.isHoliday('2013-01-06').should.be.true();
holidays.isHoliday('2014-01-06').should.be.true();
holidays.isHoliday('2015-01-06').should.be.true();

// Första maj
holidays.isHoliday('2013-05-01').should.be.true;
holidays.isHoliday('2014-05-01').should.be.true;
holidays.isHoliday('2015-05-01').should.be.true;
holidays.isHoliday('2013-05-01').should.be.true();
holidays.isHoliday('2014-05-01').should.be.true();
holidays.isHoliday('2015-05-01').should.be.true();

// Nationaldagen
holidays.isHoliday('2013-06-06').should.be.true;
holidays.isHoliday('2014-06-06').should.be.true;
holidays.isHoliday('2015-06-06').should.be.true;
holidays.isHoliday('2013-06-06').should.be.true();
holidays.isHoliday('2014-06-06').should.be.true();
holidays.isHoliday('2015-06-06').should.be.true();

// Juldagen
holidays.isHoliday('2013-12-25').should.be.true;
holidays.isHoliday('2014-12-25').should.be.true;
holidays.isHoliday('2015-12-25').should.be.true;
holidays.isHoliday('2013-12-25').should.be.true();
holidays.isHoliday('2014-12-25').should.be.true();
holidays.isHoliday('2015-12-25').should.be.true();

// Annandag jul
holidays.isHoliday('2013-12-26').should.be.true;
holidays.isHoliday('2014-12-26').should.be.true;
holidays.isHoliday('2015-12-26').should.be.true;
holidays.isHoliday('2013-12-26').should.be.true();
holidays.isHoliday('2014-12-26').should.be.true();
holidays.isHoliday('2015-12-26').should.be.true();
});

it('Should be possible to check if given date is good friday', function() {
Expand All @@ -87,7 +83,7 @@ describe('node-holidays/sv-SE.js', function() {

// Check each date in the array.
fixture.map(function(el, idx, arr) {
holidays.isHoliday(el).should.be.true;
holidays.isHoliday(el).should.be.true();
});
});

Expand All @@ -101,7 +97,7 @@ describe('node-holidays/sv-SE.js', function() {

// Check each date in the array.
fixture.map(function(el, idx, arr) {
holidays.isHoliday(el).should.be.true;
holidays.isHoliday(el).should.be.true();
});
});

Expand All @@ -116,7 +112,7 @@ describe('node-holidays/sv-SE.js', function() {

// Check each date in the array.
fixture.map(function(el, idx, arr) {
holidays.isHoliday(el).should.be.true;
holidays.isHoliday(el).should.be.true();
});
});

Expand All @@ -131,7 +127,7 @@ describe('node-holidays/sv-SE.js', function() {

// Check each date in the array.
fixture.map(function(el, idx, arr) {
holidays.isHoliday(el).should.be.true;
holidays.isHoliday(el).should.be.true();
});
});

Expand All @@ -146,7 +142,7 @@ describe('node-holidays/sv-SE.js', function() {

// Check each date in the array.
fixture.map(function(el, idx, arr) {
holidays.isHoliday(el).should.be.true;
holidays.isHoliday(el).should.be.true();
});
});

Expand All @@ -160,7 +156,7 @@ describe('node-holidays/sv-SE.js', function() {

// Check each date in the array.
fixture.map(function(el, idx, arr) {
holidays.isHoliday(el).should.be.true;
holidays.isHoliday(el).should.be.true();
});
});

Expand All @@ -174,7 +170,7 @@ describe('node-holidays/sv-SE.js', function() {

// Check each date in the array.
fixture.map(function(el, idx, arr) {
holidays.isHoliday(el).should.be.true;
holidays.isHoliday(el).should.be.true();
});
});

Expand Down
10 changes: 5 additions & 5 deletions test/setLocale.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';


var should = require('should'),
Holidays = require('../index.js');
var should = require('should');
var Holidays = require('../index.js');

describe('Holidays/locale', function() {
var holidays;
Expand Down Expand Up @@ -31,13 +31,13 @@ describe('Holidays/locale', function() {
holidays = Holidays('sv-SE');
holidays_2014 = holidays.getHolidays(2014);

holidays_2014.should.be.an.Array;
holidays_2014.should.be.an.Array();
holidays_2014.should.have.length(13);

holidays.setLocale('en-US');
holidays_2014 = holidays.getHolidays(2014);

holidays_2014.should.be.an.Array;
holidays_2014.should.be.an.Array();
holidays_2014.should.have.length(0);
});

Expand Down

0 comments on commit 35fa2ee

Please sign in to comment.