-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: User Agent to function Stylus Change: split test case files Add: common lib
- Loading branch information
Showing
16 changed files
with
594 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* @name common.js | ||
* @author Kei Funagayama <[email protected]> | ||
* copyright (c) Cyberagent Inc. | ||
* @overview common library | ||
*/ | ||
|
||
var _ = require('underscore'); | ||
var ua = require('beez-ua'); | ||
|
||
var common = module.exports = { | ||
/** | ||
* Override judgment of UserAgent. | ||
* | ||
* @param {Object} config | ||
* @param {Object} headers | ||
* @return {boolean} | ||
* @name isUAOverride | ||
* @memberof common | ||
*/ | ||
isUAOverride: function (config, headers) { | ||
if (!config.extend.hasOwnProperty('condition') || | ||
!config.extend.condition.hasOwnProperty('ua')) { | ||
return false; | ||
} | ||
|
||
// Get OS information from UserAgent | ||
ua.setup(headers['user-agent'] || '-'); | ||
|
||
return _.some(config.extend.condition.ua, function(os) { | ||
return !!ua.os[os]; | ||
}); | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
body | ||
padding body-padding(3) | ||
font 14px "Lucida Grande", Helvetica, Arial, sans-serif | ||
font 14px "Lucida Grande", Helvetica, Arial, sans-serif | ||
color color() |
Oops, something went wrong.