C# Class B4BCore.CheckBundles

This is a class that contains various tests to ensure that your bundles are correctly formed and they are up to date.
Mostra file Open project: JonPSmith/MvcUsingBower Class Usage Examples

Public Methods

Method Description
CheckAllBundlesAreValid ( ) : ReadOnlyCollection

This checks all the bundles in the bundle file are valid

CheckBundleFileIsNotNewerThanMinifiedFiles ( ) : string

This checks that the minified files for each bundle is older than the BowerBundles.json file that defines what is in a bundle.

CheckBundles ( Type classToFindProjectDirOf, string appDataDir = null, bool checkForConcatFile = true ) : System

This will setup checks the BundlesForBower in the assembly that the given type is in. It uses the data directory to find the BowerBundles.json and the bundlerForBower.json user config file

CheckBundles ( string mvcAppPath, string appDataDir = null, bool checkForConcatFile = true ) : System

This requires the path to the directory of the project where all the files are stored It uses the data directory to find the BowerBundles.json and the bundlerForBower.json user config file

CheckSingleBundleIsValid ( string bundleName ) : ReadOnlyCollection

Thic checks a specific bundle by name

Private Methods

Method Description
AddErrorIfAnyFilesInBadFiles ( string bundleName, IList badFiles, string errorMessage, ICollection errors ) : void
CheckCdnBundle ( string bundleName, ICollection allCdns ) : List
CheckNonCdnBundle ( string bundleName, IEnumerable allBundleDebugLines ) : List
GetProjectDirectoryFromType ( Type classToFindProjectDirOf ) : string

Method Details

CheckAllBundlesAreValid() public method

This checks all the bundles in the bundle file are valid
public CheckAllBundlesAreValid ( ) : ReadOnlyCollection
return ReadOnlyCollection

CheckBundleFileIsNotNewerThanMinifiedFiles() public method

This checks that the minified files for each bundle is older than the BowerBundles.json file that defines what is in a bundle.
public CheckBundleFileIsNotNewerThanMinifiedFiles ( ) : string
return string

CheckBundles() public method

This will setup checks the BundlesForBower in the assembly that the given type is in. It uses the data directory to find the BowerBundles.json and the bundlerForBower.json user config file
public CheckBundles ( Type classToFindProjectDirOf, string appDataDir = null, bool checkForConcatFile = true ) : System
classToFindProjectDirOf System.Type
appDataDir string optional: if App_Data directory is not at the top level then you need to supply /// AppDomain.CurrentDomain.GetData("DataDirectory").ToString() or an equivalent absolute directory path
checkForConcatFile bool optional: by default it checks the concat file, /// but if you go straight to the minified file then set this to false
return System

CheckBundles() public method

This requires the path to the directory of the project where all the files are stored It uses the data directory to find the BowerBundles.json and the bundlerForBower.json user config file
public CheckBundles ( string mvcAppPath, string appDataDir = null, bool checkForConcatFile = true ) : System
mvcAppPath string The absolute path to the project you want to test.
appDataDir string optional: if App_Data directory is not at the top level then you need to supply /// AppDomain.CurrentDomain.GetData("DataDirectory").ToString() or an equivalent absolute directory path
checkForConcatFile bool optional: by default it checks the concat file, /// but if you go straight to the minified file then set this to false
return System

CheckSingleBundleIsValid() public method

Thic checks a specific bundle by name
public CheckSingleBundleIsValid ( string bundleName ) : ReadOnlyCollection
bundleName string
return ReadOnlyCollection