Class: CucumberAnalytics::ParsedDirectory
- Inherits:
-
Object
- Object
- CucumberAnalytics::ParsedDirectory
- Defined in:
- lib/cucumber_analytics/parsed_directory.rb
Instance Attribute Summary collapse
-
#feature_directories ⇒ Object
readonly
Returns the value of attribute feature_directories.
-
#feature_files ⇒ Object
readonly
Returns the value of attribute feature_files.
-
#parent_element ⇒ Object
Returns the value of attribute parent_element.
Instance Method Summary collapse
-
#contains ⇒ Object
Returns the immediate child elements of the directory (i.e. its .feature files and .feature file containing sub-directories).
-
#feature_file_count ⇒ Object
Returns the number of features files contained in the directory.
-
#initialize(directory_parsed = nil) ⇒ ParsedDirectory
constructor
Creates a new ParsedDirectory object and, if directory_parsed is provided, populates the object.
-
#name ⇒ Object
Returns the name of the directory.
-
#path ⇒ Object
Returns the path of the directory.
Constructor Details
#initialize(directory_parsed = nil) ⇒ ParsedDirectory
Creates a new ParsedDirectory object and, if directory_parsed is provided, populates the object.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 12 def initialize(directory_parsed = nil) CucumberAnalytics::Logging.logger.info('ParsedDirectory#initialize') @directory = directory_parsed @feature_files = [] @feature_directories = [] scan_directory if directory_parsed end |
Instance Attribute Details
#feature_directories ⇒ Object (readonly)
Returns the value of attribute feature_directories.
6 7 8 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 6 def feature_directories @feature_directories end |
#feature_files ⇒ Object (readonly)
Returns the value of attribute feature_files.
5 6 7 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 5 def feature_files @feature_files end |
#parent_element ⇒ Object
Returns the value of attribute parent_element.
7 8 9 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 7 def parent_element @parent_element end |
Instance Method Details
#contains ⇒ Object
Returns the immediate child elements of the directory (i.e. its .feature files and .feature file containing sub-directories).
40 41 42 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 40 def contains @feature_files + @feature_directories end |
#feature_file_count ⇒ Object
Returns the number of features files contained in the directory.
34 35 36 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 34 def feature_file_count @feature_files.count end |
#name ⇒ Object
Returns the name of the directory.
24 25 26 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 24 def name File.basename(@directory.gsub('\\', '/')) end |
#path ⇒ Object
Returns the path of the directory.
29 30 31 |
# File 'lib/cucumber_analytics/parsed_directory.rb', line 29 def path @directory end |