lib/guard/cucumber/focuser.rb
# Checks to see if the file at path contains the focus tag
# It will return an empty array if the path is a directory.
#
# @param [String] path the file path to search
# @param [String] focus_tag the focus tag to look for in each path
# @return [Array<Integer>] the line numbers that include the focus tag
# in path
#
Checks to see if the file at path contains the focus tag
It will return an empty array if the path is a directory.
Checks to see if the file at path contains the focus tag It will return an empty array if the path is a directory .
def scan_path_for_focus_tag(path, focus_tag)
          return [] if File.directory?(path) || path.include?(":")
          line_numbers = []
          File.open(path, "r") do |file|
            while (line = file.gets)
              if line.include?(focus_tag)
                line_numbers << file.lineno
              end
            end
          end
          line_numbers
        end
def scan_path_for_focus_tag ( path , focus_tag ) return [ ] if File . directory? ( path ) || path . include? ( ":" ) line_numbers = [ ] File . open ( path , "r" ) do | file | while ( line = file . gets ) if line . include? ( focus_tag ) line_numbers << file . lineno end end end line_numbers end
Checks to see if the file at path contains the focus tag
It will return an empty array if the path is a directory.
Checks to see if the file at path contains the focus tag It will return an empty array if the path is a directory .
the line numbers that include the focus tag in path
the line numbers that include the focus tag in path
Array<Integer>
path
focus_tag
focus_tag the focus tag to look for in each path
focus_tag the focus tag to look for in each path