Class: UnusedView::TargetFiles
- Inherits:
-
Object
- Object
- UnusedView::TargetFiles
- Defined in:
- lib/unused_view/target_files.rb
Instance Method Summary collapse
- #all ⇒ Object
-
#initialize(path) ⇒ TargetFiles
constructor
A new instance of TargetFiles.
- #partial_views ⇒ Object
- #views ⇒ Object
Constructor Details
#initialize(path) ⇒ TargetFiles
Returns a new instance of TargetFiles.
5 6 7 |
# File 'lib/unused_view/target_files.rb', line 5 def initialize(path) @path = path end |
Instance Method Details
#all ⇒ Object
9 10 11 |
# File 'lib/unused_view/target_files.rb', line 9 def all views + partial_views end |
#partial_views ⇒ Object
19 20 21 22 23 |
# File 'lib/unused_view/target_files.rb', line 19 def partial_views ApplicationController.view_paths.reduce([]) do |sum, view_path| sum + Dir[File.join(view_path, '**/_*')].select { |f| File.file?(f) && f[%r{^#{@path}}] } end end |
#views ⇒ Object
13 14 15 16 17 |
# File 'lib/unused_view/target_files.rb', line 13 def views ApplicationController.view_paths.reduce([]) do |sum, view_path| sum + Dir[File.join(view_path, '**/[a-zA-Z]*')].select { |f| File.file?(f) && f[%r{^#{@path}}] } end end |