Skip to content

Commit

Permalink
allow tailing of files that don't match /\.log$/
Browse files Browse the repository at this point in the history
  • Loading branch information
pc committed Dec 21, 2009
1 parent ae6f5bf commit 444a191
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/clarity/commands/tail_command_builder.rb
Expand Up @@ -4,7 +4,7 @@
class TailCommandBuilder < GrepCommandBuilder

def valid?
raise InvalidParameterError, "Log file parameter not supplied or invalid log file" unless filename && !filename.empty? && File.extname(filename) == ".log"
raise InvalidParameterError, "Log file parameter not supplied or invalid log file" unless filename && !filename.empty?
true
end

Expand All @@ -24,4 +24,4 @@ def command
def default_tools
terms.empty? ? ['tail -n 250 -f filename'] : ['tail -n 250 -f filename'] + ['grep options -e term'] * (terms.size)
end
end
end
4 changes: 2 additions & 2 deletions views/_toolbar.html.erb
Expand Up @@ -57,8 +57,8 @@
<script>
Search.url = "<%= relative_root %>" + Search.url;
Search.init({ 'grep': <%= logfiles.map {|f| f }.to_json %>,
'tail': <%= logfiles.map {|f| f if f =~ /log$/ }.compact.to_json %> },
'tail': <%= logfiles.map {|f| f }.to_json %> },
<%= params.empty? ? 'null' : params.to_json %> );


</script>
</script>

0 comments on commit 444a191

Please sign in to comment.