Exemplo n.º 1
0
 /**
  * Deletes files defined in bower.json in section "ignore".
  *
  * @param PackageInterface $package
  */
 protected function deleteIgnoredFiles(PackageInterface $package)
 {
     $manager = IgnoreFactory::create($this->composer, $package, $this->getInstallPath($package));
     if ($manager->isEnabled() && !$manager->hasPattern()) {
         $this->addIgnorePatterns($manager, $package);
     }
     $manager->cleanup();
 }
Exemplo n.º 2
0
 /**
  * Remove ignored files of the installed package defined in the root
  * package extra section.
  *
  * @param PackageEvent $event
  */
 public static function deleteIgnoredFiles(PackageEvent $event)
 {
     if (null === ($package = static::getLibraryPackage($event->getOperation()))) {
         return;
     }
     $section = static::getIgnoreExtraSection();
     $manager = IgnoreFactory::create($event->getComposer(), $package, null, $section);
     $manager->cleanup();
 }
Exemplo n.º 3
0
    public function testCreateWithCustomIgnoreSection()
    {
        $extra = array(
            'custom-ignore-files' => array(
                'foo-asset/foo' => array(
                    'PATTERN',
                ),
                'foo-asset/bar' => array(),
            ),
        );

        $this->rootPackage->expects($this->any())
            ->method('getExtra')
            ->will($this->returnValue($extra));

        $manager = IgnoreFactory::create($this->composer, $this->package, null, 'custom-ignore-files');

        $this->assertTrue($manager->isEnabled());
        $this->assertTrue($manager->hasPattern());
        $this->validateInstallDir($manager, $this->config->get('vendor-dir').'/'.$this->package->getName());
    }