all_seeing_eye 0.0.4 → 0.0.5

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.4
1
+ 0.0.5
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{all_seeing_eye}
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Josh Symonds"]
@@ -18,7 +18,7 @@ class AllSeeingEye::Model
18
18
  end
19
19
 
20
20
  def self.field_names
21
- (self.field_keys + ['created_at', 'time_spent']).flatten
21
+ (self.field_keys + ['created_at']).flatten
22
22
  end
23
23
 
24
24
  def self.new(fields = {})
@@ -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/<%= @field %>/<%= CGI.escape(@id) %>">Total</a></li>
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}
@@ -9,29 +9,31 @@ class AllSeeingEye
9
9
  @@configuration
10
10
  end
11
11
 
12
- def self.redis
13
- @host, @port = nil
12
+ def self.redis(options = {})
13
+ @host, @port = options[:host], options[:port]
14
14
 
15
- begin
16
- resque_config = if defined?(Rails)
17
- YAML::load_file("#{Rails.root}/#{location}/resque.yml")
18
- else
19
- YAML::load_file("./#{location}/resque.yml")
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
- begin
27
- redis_config = if defined?(Rails)
28
- YAML::load_file("#{Rails.root}/#{location}/resque.yml")
29
- else
30
- YAML::load_file("./#{location}/resque.yml")
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", "created_at", "time_spent"],
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)).minutes))
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Josh Symonds