Class: Cyrun::SpecCollector
- Inherits:
-
Object
- Object
- Cyrun::SpecCollector
- Defined in:
- lib/cyrun/spec_collector.rb
Instance Attribute Summary collapse
-
#base_directory ⇒ Object
readonly
Returns the value of attribute base_directory.
-
#npm_task_name ⇒ Object
readonly
Returns the value of attribute npm_task_name.
-
#patterns ⇒ Object
readonly
Returns the value of attribute patterns.
Instance Method Summary collapse
- #create_task(filename) ⇒ Object
- #files ⇒ Object
-
#initialize(base_directory, npm_task_name, patterns) ⇒ SpecCollector
constructor
A new instance of SpecCollector.
Constructor Details
#initialize(base_directory, npm_task_name, patterns) ⇒ SpecCollector
Returns a new instance of SpecCollector.
7 8 9 10 11 |
# File 'lib/cyrun/spec_collector.rb', line 7 def initialize(base_directory, npm_task_name, patterns) @patterns = patterns @npm_task_name = npm_task_name @base_directory = base_directory end |
Instance Attribute Details
#base_directory ⇒ Object (readonly)
Returns the value of attribute base_directory.
5 6 7 |
# File 'lib/cyrun/spec_collector.rb', line 5 def base_directory @base_directory end |
#npm_task_name ⇒ Object (readonly)
Returns the value of attribute npm_task_name.
5 6 7 |
# File 'lib/cyrun/spec_collector.rb', line 5 def npm_task_name @npm_task_name end |
#patterns ⇒ Object (readonly)
Returns the value of attribute patterns.
5 6 7 |
# File 'lib/cyrun/spec_collector.rb', line 5 def patterns @patterns end |
Instance Method Details
#create_task(filename) ⇒ Object
20 21 22 |
# File 'lib/cyrun/spec_collector.rb', line 20 def create_task(filename) SpecTask.new(filename, @npm_task_name) end |
#files ⇒ Object
13 14 15 16 17 18 |
# File 'lib/cyrun/spec_collector.rb', line 13 def files @files ||= patterns .map { |pattern| Dir.glob(pattern, base: base_directory) } .flatten .map { |filename| File.(filename, base_directory) } end |