Search in sources :

Example 1 with GemspecParseDetectable

use of com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectable in project synopsys-detect by blackducksoftware.

the class DetectableFactory method createGemspecParseDetectable.

public GemspecParseDetectable createGemspecParseDetectable(DetectableEnvironment environment, GemspecParseDetectableOptions gemspecOptions) {
    GemspecLineParser gemspecLineParser = new GemspecLineParser();
    GemspecParser gemspecParser = new GemspecParser(gemspecLineParser, gemspecOptions.getDependencyTypeFilter());
    GemspecParseExtractor gemspecParseExtractor = new GemspecParseExtractor(gemspecParser);
    return new GemspecParseDetectable(environment, fileFinder, gemspecParseExtractor);
}
Also used : GemspecParser(com.synopsys.integration.detectable.detectables.rubygems.gemspec.parse.GemspecParser) GemspecLineParser(com.synopsys.integration.detectable.detectables.rubygems.gemspec.parse.GemspecLineParser) GemspecParseDetectable(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectable) GemspecParseExtractor(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseExtractor)

Example 2 with GemspecParseDetectable

use of com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectable in project synopsys-detect by blackducksoftware.

the class GemspecParseDetectableTest method testApplicable.

@Test
public void testApplicable() {
    GemspecParseExtractor gemspecParseExtractor = null;
    GemspecParseDetectableOptions gemspecParseDetectableOptions = null;
    DetectableEnvironment environment = MockDetectableEnvironment.empty();
    FileFinder fileFinder = MockFileFinder.withFileNamed("test.gemspec");
    GemspecParseDetectable detectable = new GemspecParseDetectable(environment, fileFinder, gemspecParseExtractor);
    assertTrue(detectable.applicable().getPassed());
}
Also used : GemspecParseDetectable(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectable) MockFileFinder(com.synopsys.integration.detectable.util.MockFileFinder) FileFinder(com.synopsys.integration.common.util.finder.FileFinder) GemspecParseExtractor(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseExtractor) DetectableEnvironment(com.synopsys.integration.detectable.DetectableEnvironment) MockDetectableEnvironment(com.synopsys.integration.detectable.util.MockDetectableEnvironment) GemspecParseDetectableOptions(com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectableOptions) Test(org.junit.jupiter.api.Test)

Aggregations

GemspecParseDetectable (com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectable)2 GemspecParseExtractor (com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseExtractor)2 FileFinder (com.synopsys.integration.common.util.finder.FileFinder)1 DetectableEnvironment (com.synopsys.integration.detectable.DetectableEnvironment)1 GemspecParseDetectableOptions (com.synopsys.integration.detectable.detectables.rubygems.gemspec.GemspecParseDetectableOptions)1 GemspecLineParser (com.synopsys.integration.detectable.detectables.rubygems.gemspec.parse.GemspecLineParser)1 GemspecParser (com.synopsys.integration.detectable.detectables.rubygems.gemspec.parse.GemspecParser)1 MockDetectableEnvironment (com.synopsys.integration.detectable.util.MockDetectableEnvironment)1 MockFileFinder (com.synopsys.integration.detectable.util.MockFileFinder)1 Test (org.junit.jupiter.api.Test)1