Class: ProtoCov::TestFile
- Inherits:
-
GenericFile
- Object
- GenericFile
- ProtoCov::TestFile
- Defined in:
- lib/protocov/test_file.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#path_prefix ⇒ Object
readonly
Returns the value of attribute path_prefix.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(filename, path_prefix) ⇒ TestFile
constructor
A new instance of TestFile.
Methods inherited from GenericFile
#annotate!, #body, #classes, #defined_methods, #invoked_methods, #lines, #modules, #path
Constructor Details
#initialize(filename, path_prefix) ⇒ TestFile
Returns a new instance of TestFile.
17 18 19 20 |
# File 'lib/protocov/test_file.rb', line 17 def initialize(filename, path_prefix) @path_prefix = path_prefix @filename = filename end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
3 4 5 |
# File 'lib/protocov/test_file.rb', line 3 def filename @filename end |
#path_prefix ⇒ Object (readonly)
Returns the value of attribute path_prefix.
3 4 5 |
# File 'lib/protocov/test_file.rb', line 3 def path_prefix @path_prefix end |
Class Method Details
.find_files_in(dir) ⇒ Object
6 7 8 9 10 |
# File 'lib/protocov/test_file.rb', line 6 def find_files_in(dir) dir.entries \ .select { |file| valid?(file) } \ .collect { |file| new(file, File.(dir.path)) } end |
.valid?(file) ⇒ Boolean
12 13 14 |
# File 'lib/protocov/test_file.rb', line 12 def valid?(file) file.match(/\.(html|js)/i) end |