peephole 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/peephole/logfile.rb +1 -5
- data/app/models/peephole/logline.rb +21 -5
- data/app/views/peephole/welcome/index.html.erb +1 -3
- data/lib/peephole/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f090c1d2889e5d2ae0125b4a6fef59cd1cac05e1
|
4
|
+
data.tar.gz: 9c6d83692b3463e8dfeb4ed44c3d3b334e823b28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b0b3e79a68ccb3e3eabedc258cf9807aebb782db3d9bee4ac488f87d0f62d93cd898c08882bb7aae9b735b171a3f5b285d01be5a54da9addd4a94772cec404
|
7
|
+
data.tar.gz: ded4ef21d79c9247afd81ca2ea2db4985eaeefca5f3c6817db4c20c4a54b6dd70705214dda1ee397c8f5349d64069b9d3633a8495bfabf55b3e211b4432f684d
|
@@ -44,13 +44,29 @@ module Peephole
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def bytes(path, page)
|
47
|
-
eof =
|
47
|
+
eof = true
|
48
48
|
raw = ''
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
49
|
+
|
50
|
+
case path.to_s
|
51
|
+
when /\.gz\z/
|
52
|
+
Zlib::GzipReader.open(path) do |f|
|
53
|
+
f.each do |line|
|
54
|
+
next if f.pos < first_byte(page)
|
55
|
+
if f.pos >= last_byte(page)
|
56
|
+
eof = false
|
57
|
+
break
|
58
|
+
end
|
59
|
+
raw << line
|
60
|
+
end
|
61
|
+
end
|
62
|
+
else
|
63
|
+
open(path) do |f|
|
64
|
+
f.seek(first_byte(page))
|
65
|
+
raw = f.read(Peephole.config.bytes_per)
|
66
|
+
eof = f.eof?
|
67
|
+
end
|
53
68
|
end
|
69
|
+
|
54
70
|
[raw, eof]
|
55
71
|
end
|
56
72
|
|
@@ -11,9 +11,7 @@
|
|
11
11
|
<td><%= logfile.updated_at %></td>
|
12
12
|
<td class="text-right">
|
13
13
|
<div class="btn-group btn-group-sm">
|
14
|
-
|
15
|
-
<%= link_to 'Raw', raw_logfile_path(logfile), class: 'btn btn-default' %>
|
16
|
-
<% end %>
|
14
|
+
<%= link_to 'Raw', raw_logfile_path(logfile), class: 'btn btn-default' %>
|
17
15
|
<%= link_to 'Download', download_logfile_path(logfile), class: 'btn btn-default' %>
|
18
16
|
</div>
|
19
17
|
</td>
|
data/lib/peephole/version.rb
CHANGED