all_seeing_eye 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ gem 'sinatra'
7
7
  gem 'vegas'
8
8
  gem 'activesupport', '>=2.3.12'
9
9
  gem 'i18n'
10
+ gem 'thin'
10
11
 
11
12
  group :development do
12
13
  gem "bundler", "~> 1.0.0"
data/Gemfile.lock CHANGED
@@ -3,6 +3,8 @@ GEM
3
3
  specs:
4
4
  activesupport (3.0.9)
5
5
  chronic (0.6.2)
6
+ daemons (1.1.4)
7
+ eventmachine (0.12.10)
6
8
  git (1.2.5)
7
9
  i18n (0.6.0)
8
10
  jeweler (1.6.4)
@@ -17,6 +19,10 @@ GEM
17
19
  sinatra (1.2.6)
18
20
  rack (~> 1.1)
19
21
  tilt (< 2.0, >= 1.2.2)
22
+ thin (1.2.11)
23
+ daemons (>= 1.0.9)
24
+ eventmachine (>= 0.12.6)
25
+ rack (>= 1.0.0)
20
26
  tilt (1.3.2)
21
27
  vegas (0.1.8)
22
28
  rack (>= 1.0.0)
@@ -34,4 +40,5 @@ DEPENDENCIES
34
40
  rcov
35
41
  redis
36
42
  sinatra
43
+ thin
37
44
  vegas
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.15
1
+ 0.0.16
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{all_seeing_eye}
8
- s.version = "0.0.15"
8
+ s.version = "0.0.16"
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"]
12
- s.date = %q{2011-08-12}
12
+ s.date = %q{2011-08-15}
13
13
  s.default_executable = %q{all-seeing-eye}
14
14
  s.description = %q{AllSeeingEye observes all requests, with parameters that you specify, to Redis. Then it composes them into graphs for you to see.}
15
15
  s.email = %q{veraticus@gmail.com}
@@ -68,6 +68,7 @@ Gem::Specification.new do |s|
68
68
  s.add_runtime_dependency(%q<vegas>, [">= 0"])
69
69
  s.add_runtime_dependency(%q<activesupport>, [">= 2.3.12"])
70
70
  s.add_runtime_dependency(%q<i18n>, [">= 0"])
71
+ s.add_runtime_dependency(%q<thin>, [">= 0"])
71
72
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
72
73
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
73
74
  s.add_development_dependency(%q<rcov>, [">= 0"])
@@ -79,6 +80,7 @@ Gem::Specification.new do |s|
79
80
  s.add_dependency(%q<vegas>, [">= 0"])
80
81
  s.add_dependency(%q<activesupport>, [">= 2.3.12"])
81
82
  s.add_dependency(%q<i18n>, [">= 0"])
83
+ s.add_dependency(%q<thin>, [">= 0"])
82
84
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
83
85
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
84
86
  s.add_dependency(%q<rcov>, [">= 0"])
@@ -91,6 +93,7 @@ Gem::Specification.new do |s|
91
93
  s.add_dependency(%q<vegas>, [">= 0"])
92
94
  s.add_dependency(%q<activesupport>, [">= 2.3.12"])
93
95
  s.add_dependency(%q<i18n>, [">= 0"])
96
+ s.add_dependency(%q<thin>, [">= 0"])
94
97
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
95
98
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
96
99
  s.add_dependency(%q<rcov>, [">= 0"])
@@ -24,8 +24,9 @@ class AllSeeingEye
24
24
  end
25
25
 
26
26
  def url_path(*path_parts)
27
+ path_parts = path_parts.collect{|p| p.gsub(path_prefix, '')}
27
28
  path = [ path_prefix, path_parts ].compact.join("/")
28
- ('/' + path).squeeze('/')
29
+ ('/' + path).squeeze('/').squeeze(path_prefix + '/')
29
30
  end
30
31
  alias_method :u, :url_path
31
32
 
@@ -75,18 +76,18 @@ class AllSeeingEye
75
76
  end
76
77
 
77
78
  get '/total' do
78
- @counts = AllSeeingEye::Request.count_by_field('created_at', :start => (DateTime.now - 1.month).to_i, :stop => DateTime.now.to_i)
79
+ @counts = AllSeeingEye::Request.count_by_field('created_at', :start => (DateTime.now - 2.days).to_i, :stop => DateTime.now.to_i)
79
80
  show :total
80
81
  end
81
82
 
82
83
  get '/search' do
83
- redirect url_path("/search/#{params[:query]}")
84
+ redirect url_path("/search/#{CGI::escape(params[:query])}")
84
85
  end
85
86
 
86
- get '/search/:id' do
87
+ get %r{/search/(.*?)$} do
87
88
  @field = 'total'
88
- @query = params[:id]
89
- @requests = AllSeeingEye::Request.search(@query, :count => true)
89
+ @query = params[:captures].first
90
+ @counts = AllSeeingEye::Request.search(@query, :count => true)
90
91
  show :total
91
92
  end
92
93
 
@@ -101,9 +102,9 @@ class AllSeeingEye
101
102
  show :field
102
103
  end
103
104
 
104
- get "/search/:id/#{field}" do
105
+ get %r{/search/(.*?)/#{field}$} do
105
106
  @field = field
106
- @query = params[:id]
107
+ @query = params[:captures].first
107
108
  @requests = AllSeeingEye::Request.search(@query)
108
109
  counts = Hash.new(0)
109
110
  @requests.each {|r| next if r.send(@field.to_sym).nil?; counts[r.send(@field.to_sym)] += 1}
@@ -6,7 +6,7 @@
6
6
  <% if @query %>
7
7
  <h1>Search &raquo; <%= humanize @query %> &raquo; <%= humanize @field %></h1>
8
8
  <% elsif @view %>
9
- <h1><a href='/fields/<%= @field %>'><%= humanize @field %></a> &raquo; <%= humanize @id %> &raquo; <%= humanize @view %></h1>
9
+ <h1><a href='<%=u "/fields/<%= @field %>" %>'><%= humanize @field %></a> &raquo; <%= humanize @id %> &raquo; <%= humanize @view %></h1>
10
10
  <% else %>
11
11
  <h1><%= humanize @field %></h1>
12
12
  <% end %>
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: 1
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 15
10
- version: 0.0.15
9
+ - 16
10
+ version: 0.0.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Josh Symonds
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-12 00:00:00 -05:00
18
+ date: 2011-08-15 00:00:00 -05:00
19
19
  default_executable: all-seeing-eye
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -119,8 +119,22 @@ dependencies:
119
119
  version_requirements: *id007
120
120
  prerelease: false
121
121
  - !ruby/object:Gem::Dependency
122
- type: :development
122
+ type: :runtime
123
123
  requirement: &id008 !ruby/object:Gem::Requirement
124
+ none: false
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ hash: 3
129
+ segments:
130
+ - 0
131
+ version: "0"
132
+ name: thin
133
+ version_requirements: *id008
134
+ prerelease: false
135
+ - !ruby/object:Gem::Dependency
136
+ type: :development
137
+ requirement: &id009 !ruby/object:Gem::Requirement
124
138
  none: false
125
139
  requirements:
126
140
  - - ~>
@@ -132,11 +146,11 @@ dependencies:
132
146
  - 0
133
147
  version: 1.0.0
134
148
  name: bundler
135
- version_requirements: *id008
149
+ version_requirements: *id009
136
150
  prerelease: false
137
151
  - !ruby/object:Gem::Dependency
138
152
  type: :development
139
- requirement: &id009 !ruby/object:Gem::Requirement
153
+ requirement: &id010 !ruby/object:Gem::Requirement
140
154
  none: false
141
155
  requirements:
142
156
  - - ~>
@@ -148,11 +162,11 @@ dependencies:
148
162
  - 4
149
163
  version: 1.6.4
150
164
  name: jeweler
151
- version_requirements: *id009
165
+ version_requirements: *id010
152
166
  prerelease: false
153
167
  - !ruby/object:Gem::Dependency
154
168
  type: :development
155
- requirement: &id010 !ruby/object:Gem::Requirement
169
+ requirement: &id011 !ruby/object:Gem::Requirement
156
170
  none: false
157
171
  requirements:
158
172
  - - ">="
@@ -162,7 +176,7 @@ dependencies:
162
176
  - 0
163
177
  version: "0"
164
178
  name: rcov
165
- version_requirements: *id010
179
+ version_requirements: *id011
166
180
  prerelease: false
167
181
  description: AllSeeingEye observes all requests, with parameters that you specify, to Redis. Then it composes them into graphs for you to see.
168
182
  email: veraticus@gmail.com