all_seeing_eye 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/all_seeing_eye.gemspec +1 -1
- data/lib/all_seeing_eye/model.rb +1 -1
- data/lib/all_seeing_eye/server/views/left.erb +1 -1
- data/lib/all_seeing_eye/server.rb +5 -1
- data/lib/all_seeing_eye.rb +21 -19
- data/test/model_test.rb +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/all_seeing_eye.gemspec
CHANGED
data/lib/all_seeing_eye/model.rb
CHANGED
@@ -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="/fields
|
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 %>
|
@@ -23,9 +23,13 @@ class AllSeeingEye
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def url_path(*path_parts)
|
26
|
-
[ path_parts ].join("/").squeeze('/')
|
26
|
+
[ path_prefix, path_parts ].join("/").squeeze('/')
|
27
27
|
end
|
28
28
|
alias_method :u, :url_path
|
29
|
+
|
30
|
+
def path_prefix
|
31
|
+
ENV['PATH_PREFIX']
|
32
|
+
end
|
29
33
|
|
30
34
|
def class_if_current(path = '')
|
31
35
|
'class="current"' if current_page.split('/').any?{|p| p == path}
|
data/lib/all_seeing_eye.rb
CHANGED
@@ -9,29 +9,31 @@ class AllSeeingEye
|
|
9
9
|
@@configuration
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.redis
|
13
|
-
@host, @port =
|
12
|
+
def self.redis(options = {})
|
13
|
+
@host, @port = options[:host], options[:port]
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
unless @host && @port
|
16
|
+
begin
|
17
|
+
resque_config = if defined?(Rails)
|
18
|
+
YAML::load_file("#{Rails.root}/#{location}/resque.yml")
|
19
|
+
else
|
20
|
+
YAML::load_file("./#{location}/resque.yml")
|
21
|
+
end
|
22
|
+
@host = resque_config[ENV['RAILS_ENV']].split(':').first
|
23
|
+
@port = resque_config[ENV['RAILS_ENV']].split(':').first
|
24
|
+
rescue
|
20
25
|
end
|
21
|
-
rescue
|
22
|
-
@host = resque_config[ENV['RAILS_ENV']].split(':').first
|
23
|
-
@port = resque_config[ENV['RAILS_ENV']].split(':').first
|
24
|
-
end
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
begin
|
28
|
+
redis_config = if defined?(Rails)
|
29
|
+
YAML::load_file("#{Rails.root}/#{location}/resque.yml")
|
30
|
+
else
|
31
|
+
YAML::load_file("./#{location}/resque.yml")
|
32
|
+
end
|
33
|
+
@host = resque_config[ENV['RAILS_ENV']].split(':').first
|
34
|
+
@port = resque_config[ENV['RAILS_ENV']].split(':').first
|
35
|
+
rescue
|
31
36
|
end
|
32
|
-
rescue
|
33
|
-
@host = resque_config[ENV['RAILS_ENV']].split(':').first
|
34
|
-
@port = resque_config[ENV['RAILS_ENV']].split(':').first
|
35
37
|
end
|
36
38
|
|
37
39
|
@host, @port = 'localhost', 6379 unless @host && @port
|
data/test/model_test.rb
CHANGED
@@ -20,7 +20,7 @@ context 'class methods without setup' do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
test 'models should get field names' do
|
23
|
-
assert_equal ["uri", "action", "ip", "controller", "browser", "status", "
|
23
|
+
assert_equal ["uri", "action", "ip", "controller", "browser", "status", "time_spent", "created_at"],
|
24
24
|
AllSeeingEye::Model.field_names
|
25
25
|
end
|
26
26
|
|
@@ -229,7 +229,7 @@ context 'many objects' do
|
|
229
229
|
@time = Time.now
|
230
230
|
|
231
231
|
2000.times do |n|
|
232
|
-
instance_variable_set("@obj#{n}".to_sym, AllSeeingEye::Model.create(:uri => '/', :ip => '127.0.0.1', :created_at => @time - (n * (1999 - n))
|
232
|
+
instance_variable_set("@obj#{n}".to_sym, AllSeeingEye::Model.create(:uri => '/', :ip => '127.0.0.1', :created_at => @time - (n * (1999 - n)) * 60))
|
233
233
|
end
|
234
234
|
end
|
235
235
|
|
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: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Josh Symonds
|