Class: FeaturesReport::Reader
- Inherits:
-
Object
- Object
- FeaturesReport::Reader
- Defined in:
- lib/features_report/reader.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
Class Method Summary collapse
Instance Method Summary collapse
- #features ⇒ Object
-
#initialize(files) ⇒ Reader
constructor
A new instance of Reader.
- #parser ⇒ Object
Constructor Details
#initialize(files) ⇒ Reader
Returns a new instance of Reader.
6 7 8 |
# File 'lib/features_report/reader.rb', line 6 def initialize(files) @files = files end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
4 5 6 |
# File 'lib/features_report/reader.rb', line 4 def files @files end |
Class Method Details
.load_cucumber ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/features_report/reader.rb', line 10 def self.load_cucumber require "cucumber" require "cucumber/treetop_parser/feature_en" Cucumber.load_language("en") Cucumber::Tree::Feature.class_eval do attr_reader :scenarios end end |
Instance Method Details
#features ⇒ Object
20 21 22 23 24 25 |
# File 'lib/features_report/reader.rb', line 20 def features return @features if @features @features = files.map do |file| parser.parse_feature(file) end end |
#parser ⇒ Object
27 28 29 |
# File 'lib/features_report/reader.rb', line 27 def parser @parser ||= Cucumber::TreetopParser::FeatureParser.new end |