Class: CucumberSlice::ListsFeatures

Inherits:
Object
  • Object
show all
Includes:
ListCore
Defined in:
lib/cucumber_slice/lists_features.rb

Instance Method Summary collapse

Methods included from ListCore

#any_dependencies_in_changeset?, #changed_files, #dependencies_declared_in, #diff_files, #expand_globs, #expand_paths, #files_changed_since, #find_up, #format_feature_list, #git_repo_path, #is_dir?, #is_root?, #list_features_under

Constructor Details

#initialize(path, rev, disabled) ⇒ ListsFeatures

Returns a new instance of ListsFeatures.



91
92
93
94
95
# File 'lib/cucumber_slice/lists_features.rb', line 91

def initialize(path, rev, disabled)
  @path = path
  @rev = rev
  @disabled = disabled
end

Instance Method Details

#listObject



97
98
99
100
101
102
103
104
105
106
107
# File 'lib/cucumber_slice/lists_features.rb', line 97

def list
  all_features = list_features_under(@path)
  return format_feature_list(all_features) if @disabled
  changeset = files_changed_since(@rev)

  format_feature_list(all_features.select do |feature_path|
    dependency_patterns = dependencies_declared_in(feature_path)
    dependency_paths = expand_globs(dependency_patterns) + [feature_path]
    any_dependencies_in_changeset?(dependency_paths, changeset)
  end)
end