title: assetic - unable to write assets
body: <p>Here's my directory structure (this is just a test project):</p>
  
  <pre><code>stan@mypc:/generate_assets$ sudo tree -L 3 -p
  .
  ├── [drwxr-xr-x]  assets
  │   └── [drwxr-xr-x]  css
  │       ├── [-rw-r--r--]  test1.css
  │       └── [-rw-r--r--]  test2.css
  ├── [-rw-r--r--]  composer.json
  ├── [-rw-r--r--]  composer.lock
  ├── [drwxrwxrwx]  public
  ├── [-rwxr-xr-x]  run
  └── [drwxr-xr-x]  vendor
       ....skipping...
  </code></pre>
  
  <p>Here's my simple script ('run' file) that supposed to generate assets:  </p>
  
  <pre><code>#!/usr/bin/env php
  
  &lt;?php
      //loading composer's autoload
      chdir(__DIR__);
      if (file_exists('vendor/autoload.php')) {
          include 'vendor/autoload.php';
      }
  
      use Assetic\Asset\AssetCollection;
      use Assetic\Factory\AssetFactory;
      use Assetic\Asset\FileAsset;
      use Assetic\Asset\GlobAsset;
      use Assetic\Filter\LessFilter;
      use Assetic\Filter\CssMinFilter;
      use Assetic\AssetWriter;
      use Assetic\AssetManager;
  
      //Asset manager
      $am = new AssetManager();
  
      //Add all css files
      $css = new GlobAsset('assets/css/*.css', array(new CssMinFilter()));
      $am-&gt;set('basecss', $css);
  
      // Dumping assets into public
      $writer = new AssetWriter('public');
      $writer-&gt;writeManagerAssets($am);
  </code></pre>
  
  <p>So - I expected that css files from assets/css would be combined, minified and dumped into public directory under name 'basecss.css'. Here 's the exception I get:  </p>
  
  <pre><code>PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'Unable to write file public/' in /generate_assets/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php:106
  Stack trace:
  #0 /generate_assets/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php(65): Assetic\AssetWriter::write('public/', '*{color:green}?...')
  #1 /generate_assets/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php(54): Assetic\AssetWriter-&gt;writeAsset(Object(Assetic\Asset\GlobAsset))
  #2 /generate_assets/run(31): Assetic\AssetWriter-&gt;writeManagerAssets(Object(Assetic\AssetManager))
  #3 {main}
    thrown in /generate_assets/vendor/kriswallsmith/assetic/src/Assetic/AssetWriter.php on line 106
  </code></pre>
  
  <p>So  - It seems like assetic tries to dump file named as 'public' instead of 'public/basecss.css'?   Any help?  </p>
  
  <p><strong>P.S. RESOLUTION:</strong>  </p>
  
  <p>Ok. soo. Apparently I must run </p>
  
  <pre><code>$css-&gt;setTargetPath('css_file_name.css');   
  </code></pre>
  
  <p>And then it worked...</p>