function testGlob() { SimpleAsset::config(array('asset_dir' => dirname(__FILE__) . '/public')); $files = new SimpleAssetFiles(); $paths = $files->glob(); sort($paths); $this->assertEquals(array('/images/icon.png', '/images/main.jpg', '/javascripts/application.js', '/stylesheets/application.css'), $paths); }
/** * @param array $config */ public static function precompile($config = null) { if (is_array($config) && sizeof($config) > 0) { SimpleAsset::config($config); } $store = SimpleAssetStore::factory(); $files = new SimpleAssetFiles(); foreach ($files->glob() as $path) { $store->setDigest($path); } }
/** * @param string $path * @return string */ public static function assetFullpath($path) { return self::joinpath(SimpleAsset::config('asset_dir'), $path); }
/** * @param array $args * @return object */ public static function factory() { return new SimpleAssetStoreFile(SimpleAsset::config()); }
/** * @param array $opts */ function __construct($opts = null) { if (is_array($opts) and sizeof($opts) > 0) { $this->config = SimpleAsset::config($opts); } }
function testPrecompile() { $store_dir = dirname(__FILE__) . '/_digests/'; SimpleAsset::precompile(array('store' => 'file', 'store_dir' => $store_dir, 'asset_dir' => dirname(__FILE__) . '/public/')); }
/** * @param string $path * @return string */ function _strip_asset_dir($path) { return str_replace(SimpleAsset::config('asset_dir'), '', $path); }