all_seeing_eye 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
data/all_seeing_eye.gemspec
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
<%= tab 'Total' %>
|
22
22
|
<%= tab 'Fields' %>
|
23
23
|
<li class='right'>
|
24
|
-
<form action='/search' method='post'>
|
24
|
+
<form action='<%=u '/search' %>' method='post'>
|
25
25
|
<label>Search</label>
|
26
26
|
<input name='query' type='text'>
|
27
27
|
<input type="submit" name="submit" value="Go" >
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<% if @id %>
|
3
3
|
<div id='left'>
|
4
4
|
<ul>
|
5
|
-
<li class=<%= current_page.split(CGI.escape(@id))[1] ? '' : 'current' %>><a href="<%= u "
|
5
|
+
<li class=<%= current_page.split(CGI.escape(@id))[1] ? '' : 'current' %>><a href="<%= u "fields/#{@field}/#{CGI.escape(@id)} " %>">Total</a></li>
|
6
6
|
<% (tabs - [@field]).each do |t| %>
|
7
7
|
<%= tab t, "fields/#{@field}/#{CGI.escape(@id)}" %>
|
8
8
|
<% end %>
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% elsif @query%>
|
12
12
|
<div id='left'>
|
13
13
|
<ul>
|
14
|
-
<li class=<%= current_page.split(CGI.escape(@query))[1] ? '' : 'current' %>><a href="
|
14
|
+
<li class=<%= current_page.split(CGI.escape(@query))[1] ? '' : 'current' %>><a href="<%= u "search/#{CGI.escape(@query) }" %>"}>Total</a></li>
|
15
15
|
<% tabs.each do |t| %>
|
16
16
|
<%= tab t, "search/#{CGI.escape(@query)}" %>
|
17
17
|
<% end %>
|
@@ -1,31 +1,5 @@
|
|
1
1
|
<% if @field %>
|
2
2
|
<%= partial(:left )%>
|
3
|
-
<% elsif !@requests.empty? %>
|
4
|
-
<table cellspacing="0">
|
5
|
-
<tr>
|
6
|
-
<th></th>
|
7
|
-
<th>Today</th><th>Yesterday</th><th>This Week</th><th>All Time</th>
|
8
|
-
</tr>
|
9
|
-
|
10
|
-
<tr>
|
11
|
-
<th>Requests</th>
|
12
|
-
<td><%= AllSeeingEye::Request.count(:start => DateTime.now.beginning_of_day, :stop => DateTime.now.end_of_day) %></td>
|
13
|
-
<td><%= AllSeeingEye::Request.count(:start => DateTime.yesterday.beginning_of_day, :stop => DateTime.yesterday.end_of_day) %></td>
|
14
|
-
<td><%= AllSeeingEye::Request.count(:start => DateTime.now.beginning_of_week, :stop => DateTime.now.end_of_week) %></td>
|
15
|
-
<td><%= AllSeeingEye::Request.count %></td>
|
16
|
-
</tr>
|
17
|
-
|
18
|
-
<tr>
|
19
|
-
<th>Requests/Sec</th>
|
20
|
-
<td><%= round AllSeeingEye::Request.count(:start => DateTime.now.beginning_of_day, :stop => DateTime.now.end_of_day).to_f / (DateTime.now.to_f - DateTime.now.beginning_of_day.to_f) %></td>
|
21
|
-
<td><%= round AllSeeingEye::Request.count(:start => DateTime.yesterday.beginning_of_day, :stop => DateTime.yesterday.end_of_day).to_f / ((DateTime.now - 1.day).end_of_day.to_f - (DateTime.now - 1.day).beginning_of_day.to_f) %></td>
|
22
|
-
<td><%= round AllSeeingEye::Request.count(:start => DateTime.now.beginning_of_week, :stop => DateTime.now.end_of_week).to_f / (DateTime.now.to_f - DateTime.now.beginning_of_week.to_f) %></td>
|
23
|
-
<td><%= round AllSeeingEye::Request.count.to_f / (AllSeeingEye::Request.last.created_at.to_f - AllSeeingEye::Request.first.created_at.to_f) %></td>
|
24
|
-
</tr>
|
25
|
-
</table>
|
26
|
-
<% end %>
|
27
|
-
|
28
|
-
<% if @field %>
|
29
3
|
<div id='right'>
|
30
4
|
<% if @id %>
|
31
5
|
<h1><a href='/fields/<%= @field %>'><%= humanize @field %></a> » <%= humanize @id %></h1>
|
@@ -23,7 +23,8 @@ class AllSeeingEye
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def url_path(*path_parts)
|
26
|
-
[ path_prefix, path_parts ].compact.join("/")
|
26
|
+
path = [ path_prefix, path_parts ].compact.join("/")
|
27
|
+
('/' + path).squeeze('/')
|
27
28
|
end
|
28
29
|
alias_method :u, :url_path
|
29
30
|
|
@@ -38,7 +39,7 @@ class AllSeeingEye
|
|
38
39
|
def tab(name, prefix = nil)
|
39
40
|
dname = name.to_s.downcase
|
40
41
|
path = url_path(dname)
|
41
|
-
"<li #{class_if_current(path)}><a href='
|
42
|
+
"<li #{class_if_current(path)}><a href='#{prefix.nil? ? '' : "#{prefix}/"}#{path}'>#{humanize name}</a></li>"
|
42
43
|
end
|
43
44
|
|
44
45
|
def round(float, n = 2)
|
@@ -78,7 +79,7 @@ class AllSeeingEye
|
|
78
79
|
end
|
79
80
|
|
80
81
|
post '/search' do
|
81
|
-
redirect "/search/#{params[:query]}"
|
82
|
+
redirect url_path("/search/#{params[:query]}")
|
82
83
|
end
|
83
84
|
|
84
85
|
get '/search/:id' do
|
@@ -90,7 +91,7 @@ class AllSeeingEye
|
|
90
91
|
end
|
91
92
|
|
92
93
|
get "/fields" do
|
93
|
-
redirect "/fields/#{AllSeeingEye::Request.field_keys.first}"
|
94
|
+
redirect url_path("/fields/#{AllSeeingEye::Request.field_keys.first}")
|
94
95
|
end
|
95
96
|
|
96
97
|
AllSeeingEye::Request.field_keys.each do |field|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: all_seeing_eye
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 9
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Josh Symonds
|