Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Grunt-Task, fetches the latest browscap.ini file and deploys it to a local directory

License

Notifications You must be signed in to change notification settings

skalio/grunt-fetch-browscap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-fetch-browscap

Grunt-Task, fetches the latest browscap.ini file from browscap.org and deploys it to a local directory.

Install

This plugin requires Grunt >=0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install --save-dev grunt-fetch-browscap

Once the plugin has been installed, it may be enabled inside your Gruntfile:

grunt.loadNpmTasks('grunt-fetch-browscap');

Fetch Browscap Task

Run this task with the grunt fetch-browscap command.

Task targets, files and options may be specified according to the grunt Configuring tasks guide.

In your project's Grundfile, add a section named fetch-browscap to the data object passed into grunt.initConfig().

grunt.initConfig({
	"fetch-browscap": {
		your_target : {
			options: {
				destination: "target/browscap.ini",
				version: "Lite_PHP_BrowsCapINI",
				versionNumberDestination: "build/browscap.version"
			}
		}
	}
});

Options

options.destination

Type: String Default value: target/browscap.ini

The destination where the file will be downloaded to.

options.version

Type: String Default value: Lite_PHP_BrowsCapINI

The type of browscap.ini-file you are interested in. Supported values are:

  • BrowsCapINI: This is the standard version of browscap.ini file for IIS 5.x and greater.
  • Full_BrowsCapINI: This is a larger version of browscap.ini with all the new properties.
  • Lite_BrowsCapINI: This is a smaller version of browscap.ini file containing major browsers & search engines. This file is adequate for most websites.
  • PHP_BrowsCapINI: This is a special version of browscap.ini for PHP users only!
  • Full_PHP_BrowsCapINI: This is a larger version of php_browscap.ini with all the new properties.
  • Lite_PHP_BrowsCapINI: This is a smaller version of php_browscap.ini file containing major browsers & search engines. This file is adequate for most websites.
  • BrowsCapXML: This is the standard version of browscap.ini file in XML format.
  • BrowsCapCSV: This is an industry-standard comma-separated-values version of browscap.ini. Easily imported into Access, Excel, MySQL & others.
  • BrowsCapJSON: This is a JSON (JavaScript Object Notation) version of browscap.ini. This is usually used with JavaScript.
  • BrowsCapZIP: This archive combines all the above files into one download that is smaller than all eight files put together.

options.versionNumberDestination

Type: String Default value: target/browscap.version

Refers to a filename that caches the downloaded version. Its contents are compared against browscap.org/version-number to determine if a file is to be downloaded.

Rate Limiting

Be aware that downloading the INI files from browscap.org implies agreeing to their fair usage policy. Repeat downloads may lead to temporary or permanent bans.

Changelog

  • 2015-12-17 v0.2.0: caches the version-number
  • 2015-12-17 v0.1.1: documentation fix
  • 2015-12-17 v0.1.0: initial version, not intended for public release

About

Grunt-Task, fetches the latest browscap.ini file and deploys it to a local directory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published