public FileSystemRequirementsTagProvider(EnvironmentVariables environmentVariables) { this(environmentVariables, RootDirectory.definedIn(environmentVariables).featuresOrStoriesRootDirectory().orElse(Paths.get(DEFAULT_FEATURE_DIRECTORY)).toString()); }
private String removeFeatureOrStoryPrefixFrom(String path) { String stories = RootDirectory.definedIn(environmentVariables).storyDirectoryName(); String features = RootDirectory.definedIn(environmentVariables).featureDirectoryName(); if (path.startsWith(stories)) { path = path.substring(stories.length() + 1); } if (path.startsWith(features)) { path = path.substring(stories.length() + 1); } if (path.endsWith(".story")) { path = path.substring(0,path.length() - 6); } if (path.endsWith(".feature")) { path = path.substring(0,path.length() - 8); } return path; }
private Optional<SearchForFilesOfType> getJBehaveFileMatcher() { if (jbehaveFileMatcher != null) { return Optional.of(jbehaveFileMatcher); } try { Optional<Path> root = RootDirectory.definedIn(environmentVariables).featuresOrStoriesRootDirectory();// findResourcePath(rootRequirementsDirectory + "/stories"); if (root.isPresent()) { jbehaveFileMatcher = new SearchForFilesOfType(root.get(),".story"); Files.walkFileTree(root.get(), jbehaveFileMatcher); return Optional.of(jbehaveFileMatcher); } } catch (IOException e) { return Optional.empty(); } return Optional.empty(); }
private Optional<SearchForFilesOfType> getCucumberFileMatcher() { if (cucumberFileMatcher != null) { return Optional.of(cucumberFileMatcher); } try { Optional<Path> root = RootDirectory.definedIn(environmentVariables).featuresOrStoriesRootDirectory();// findResourcePath(rootRequirementsDirectory + "/stories"); if (root.isPresent()) { cucumberFileMatcher = new SearchForFilesOfType(root.get(),".feature"); Files.walkFileTree(root.get(), cucumberFileMatcher); return Optional.of(cucumberFileMatcher); } } catch (IOException e) { e.printStackTrace(); return Optional.empty(); } return Optional.empty(); }