wackamole 0.0.8 → 0.0.9

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.
Files changed (52) hide show
  1. data/History.txt +5 -1
  2. data/README.rdoc +12 -3
  3. data/bin/wackamole +2 -2
  4. data/data/fixtures.rb +132 -0
  5. data/features/env.rb +29 -0
  6. data/features/mission.feature +10 -0
  7. data/features/step_definitions/mission_steps.rb +5 -0
  8. data/lib/app.rb +23 -7
  9. data/lib/controllers/features.rb +3 -2
  10. data/lib/controllers/logs.rb +1 -0
  11. data/lib/controllers/mission.rb +14 -4
  12. data/lib/controllers/session.rb +32 -0
  13. data/lib/controllers/users.rb +3 -2
  14. data/lib/helpers/flash_helper.rb +4 -1
  15. data/lib/helpers/logs_helper.rb +2 -1
  16. data/lib/helpers/session_helper.rb +29 -0
  17. data/lib/wackamole.rb +1 -1
  18. data/lib/wackamole/models/control.rb +15 -1
  19. data/lib/wackamole/models/feature.rb +11 -2
  20. data/lib/wackamole/models/log.rb +1 -0
  21. data/lib/wackamole/models/mission.rb +9 -7
  22. data/lib/wackamole/models/mole_info.rb +8 -4
  23. data/lib/wackamole/models/search_filter.rb +48 -15
  24. data/lib/wackamole/models/user.rb +12 -1
  25. data/public/stylesheets/wackamole.css +60 -3
  26. data/spec/config/bogus_test.yml +1 -1
  27. data/spec/config/test.yml +1 -1
  28. data/spec/spec_helper.rb +3 -0
  29. data/spec/ui/log_spec.rb +68 -0
  30. data/spec/ui/mission_spec.rb +64 -0
  31. data/spec/ui/session_spec.rb +39 -0
  32. data/spec/ui_utils/mission_util.rb +41 -0
  33. data/spec/{models → wackamole/models}/control_spec.rb +21 -21
  34. data/spec/{models → wackamole/models}/feature_spec.rb +7 -7
  35. data/spec/{models → wackamole/models}/log_spec.rb +5 -5
  36. data/spec/{models → wackamole/models}/mission_spec.rb +11 -7
  37. data/spec/wackamole/models/moled_info_spec.rb +36 -0
  38. data/spec/{models → wackamole/models}/search_filter_spec.rb +12 -16
  39. data/spec/{models → wackamole/models}/user_spec.rb +5 -5
  40. data/spec/{wackamole_spec.rb → wackamole/wackamole_spec.rb} +2 -2
  41. data/tasks/fixtures.rake +3 -1
  42. data/tasks/setup.rb +2 -1
  43. data/tasks/spec.rake +17 -3
  44. data/views/dashboard/_report.erb +3 -3
  45. data/views/layout.erb +44 -11
  46. data/views/logs/show.erb +3 -0
  47. data/views/mission/_report.erb +2 -2
  48. data/views/session/login.erb +28 -0
  49. data/views/shared/_search.erb +1 -1
  50. data/views/users/index.js.erb +1 -1
  51. metadata +22 -10
  52. data/spec/models/moled_info_spec.rb +0 -30
@@ -1,9 +1,9 @@
1
1
  if HAVE_SPEC_RAKE_SPECTASK and not PROJ.spec.files.to_a.empty?
2
2
  require 'spec/rake/verify_rcov'
3
- require 'spec/data/fixtures'
3
+ require 'data/fixtures'
4
4
 
5
5
  namespace :spec do
6
-
6
+
7
7
  desc 'Run all specs with basic output'
8
8
  Spec::Rake::SpecTask.new(:run) do |t|
9
9
  t.ruby_opts = PROJ.ruby_opts
@@ -12,6 +12,13 @@ namespace :spec do
12
12
  t.libs += PROJ.libs
13
13
  end
14
14
 
15
+ Spec::Rake::SpecTask.new(:run_ui) do |t|
16
+ t.ruby_opts = PROJ.ruby_opts
17
+ t.spec_opts = PROJ.spec.opts
18
+ t.spec_files = PROJ.spec.ui_files
19
+ t.libs += PROJ.libs
20
+ end
21
+
15
22
  desc 'Run all specs with text output'
16
23
  Spec::Rake::SpecTask.new(:specdoc) do |t|
17
24
  t.ruby_opts = PROJ.ruby_opts
@@ -30,6 +37,7 @@ namespace :spec do
30
37
  t.rcov = true
31
38
  t.rcov_dir = PROJ.rcov.dir
32
39
  t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
40
+ # t.rcov_opts = t.rcov_opts + ['--include', 'lib/helpers/*.rb']
33
41
  end
34
42
 
35
43
  RCov::VerifyTask.new(:verify) do |t|
@@ -45,7 +53,13 @@ namespace :spec do
45
53
  end # namespace :spec
46
54
 
47
55
  desc 'Alias to spec:run'
48
- task :spec => 'spec:run'
56
+ task :spec => 'spec:run'
57
+
58
+ desc 'Alias to ui run'
59
+ task :ui => 'spec:run_ui'
60
+
61
+ # desc 'Alias to fixtures'
62
+ # task :fixtures => 'spec:fixtures'
49
63
 
50
64
  task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
51
65
 
@@ -12,7 +12,7 @@
12
12
  <p class="status">Performance</p>
13
13
  <p class="result">
14
14
  <% if @info[:perf_load] > 0 %>
15
- <%= link_to pluralize( @info[:perf_load], 'issue' ), "/dashboard/logs/#{Rackamole.perf}/", :class => "site_link" %>
15
+ <%= link_to pluralize( @info[:perf_load], 'issue' ), "/dashboard/logs/#{Rackamole.perf}/#{@updated_on.hour}/", :class => "site_link" %>
16
16
  <% else %>
17
17
  <%=pluralize( @info[:perf_load], 'issue' )%>
18
18
  <% end %>
@@ -22,7 +22,7 @@
22
22
  <p class="status">Uncaught Exceptions</p>
23
23
  <p class="result">
24
24
  <% if @info[:fault_load] > 0 %>
25
- <%= link_to pluralize( @info[:fault_load], 'issue' ), "/dashboard/logs/#{Rackamole.fault}/", :class => "site_link" %>
25
+ <%= link_to pluralize( @info[:fault_load], 'issue' ), "/dashboard/logs/#{Rackamole.fault}/#{@updated_on.hour}/", :class => "site_link" %>
26
26
  <% else %>
27
27
  <%=pluralize( @info[:fault_load], 'issue' )%>
28
28
  <% end %>
@@ -59,7 +59,7 @@
59
59
  <% end %>
60
60
  </li>
61
61
  <li>
62
- <p id="features">Logs</p>
62
+ <p id="features">Features</p>
63
63
  <% unless zeroed_series?( @info[:feature_series] ) %>
64
64
  <div class="heat" id="svg_features"></div>
65
65
  <% else %>
@@ -9,25 +9,47 @@
9
9
  <%= javascripts %w[jquery_min jquery_ui_min] %>
10
10
  </head>
11
11
 
12
+ <style>
13
+ span#version {
14
+ position: relative;
15
+ top: -12px;
16
+ left: 32px;
17
+ font-weight: bold;
18
+ color: #316071;
19
+ }
20
+ a.logout {
21
+ font-size: 0.8em;
22
+ }
23
+ </style>
12
24
  <body id="body">
13
25
  <div id="overall">
14
- <div id="logo" style="margin-bottom:5px">
15
- <%= link_to image_tag( 'wackamole_logo.png', :border => 0 ), '/' %>
26
+ <div id="logo">
27
+ <span id="version"><%=Wackamole.version%></span>
28
+ <%= link_to image_tag( 'wackamole_logo.png', :border => 0 ), '/mission' %>
16
29
  </div>
17
- <div id="app_info">
30
+ <div id="app_info">
31
+ <% if console_auth? and !root_path? %>
32
+ <%= link_to "log out", "/session/delete", :class => "site_link logout" %>
33
+ <% end %>
34
+
18
35
  <% if @app_info %>
19
36
  <ul>
20
37
  <li>&laquo;<span><%=@app_info[:app_name]%></span>&raquo;</li>
21
38
  <li id="env"><%=@app_info[:stage]%></li>
22
39
  <ul>
23
40
  <% end %>
24
- <p><span id="timestamp"><%=partial :'shared/timestamp'%></span></p>
41
+ <% unless root_path? %>
42
+ <p><span id="timestamp"><%=partial :'shared/timestamp'%></span></p>
43
+ <% end %>
25
44
  </div>
26
- <div id="main">
45
+ <div id="main">
27
46
  <div class="flash"></div>
28
- <% if @app_info %>
47
+
48
+ <% if @app_info %>
29
49
  <div id='navigation' class='corners'>
30
- <%=link_to "mission control", "/" , :class => "site_link land" %>&nbsp;&bull;&nbsp;
50
+ <% unless Wackamole::Control.single_app? %>
51
+ <%=link_to "mission control", "/mission", :class => "site_link land" %>&nbsp;&bull;&nbsp;
52
+ <% end %>
31
53
  <%=link_to "dashboard" , "/dashboard/#{@app_info[:app_name]}/#{@app_info[:stage]}", :class => "site_link dash" %>&nbsp;&bull;&nbsp;
32
54
  <%=link_to "logs" , "/logs/1" , :class => "site_link logs" %>&nbsp;&bull;&nbsp;
33
55
  <%=link_to "features" , "/features/1" , :class => "site_link features" %>&nbsp;&bull;&nbsp;
@@ -38,10 +60,21 @@
38
60
  <%= yield %>
39
61
  </div>
40
62
 
41
- <div id="footer" style="text-align:right">
42
- <%= link_to image_tag( 'powered_by.png', :border => 0 ), "http://www.rackamole.com", :target => "#" %>
43
- </div>
63
+ <% unless root_path? %>
64
+ <div id="footer" style="text-align:right">
65
+ <%= link_to image_tag( 'powered_by.png', :border => 0 ), "http://www.rackamole.com", :target => "#" %>
66
+ </div>
67
+ <% end %>
44
68
 
45
69
  </div>
46
70
  </body>
47
- </html>
71
+ </html>
72
+
73
+ <script>
74
+ $( function() {
75
+ // console.log( "Flash " + $('div.flash').html().length + " == " + $('div.flash').html() + '==' );
76
+
77
+ if ( $('div.flash') && $('div.flash').html() && $('div.flash').html().length > 1 )
78
+ $('div.flash').fadeOut( 2000 );
79
+ });
80
+ </script>
@@ -17,6 +17,9 @@
17
17
  <td class="label">User</td>
18
18
  <td><%=user_name_for( {}, @log['uid'] ) %></td>
19
19
  </tr>
20
+ <tr>
21
+ <td class="label">Timestamp</td>
22
+ <td><%=timestamp_for @log%></td>
20
23
  <tr>
21
24
  <td class="label">Method</td>
22
25
  <td><%=@log['met']%></td>
@@ -19,7 +19,7 @@
19
19
  <tbody>
20
20
  <% applications.each_pair do |app_name, envs| %>
21
21
  <% envs.each do |env| %>
22
- <tr class="div">
22
+ <tr class="app_info" id="<%=app_name%>_<%=env%>">
23
23
  <td valign="top"><%= link_to app_name, "/dashboard/#{app_name}/#{env}", :class => 'site_link' %></td>
24
24
  <td valign="top"><%= env %></td>
25
25
  <% %w(to_date today last_tick).each do |period| %>
@@ -32,7 +32,7 @@
32
32
  <% clazz = ( (count > 0 and %w(last_tick today).include?(period)) ? assign_class( type, count ) : nil) %>
33
33
  <td width="25px">
34
34
  <% if( %w(last_tick today).include?( period ) and count > 0 ) %>
35
- <%= link_to Wackamole::Mission.to_type_name(type), "/mission/logs/#{app_name}/#{env}/#{type}", :class => "site_link" %>:
35
+ <%= link_to Wackamole::Mission.to_type_name(type), "/mission/logs/#{app_name}/#{env}/#{type}", :class => "site_link", :id => "#{app_name}_#{env}_#{type}" %>:
36
36
  <% else %>
37
37
  <%=Wackamole::Mission.to_type_name(type)%>:
38
38
  <% end %>
@@ -0,0 +1,28 @@
1
+ <center>
2
+ <div id="dialog">
3
+ <div id="inner_box" style="clear:both">
4
+ <form id="login" action="/session/create" method="post">
5
+ <div>
6
+ <label for="username">Login</label>
7
+ <input id="username" type="text" name="login[username]"-%>
8
+ </div>
9
+ <div>
10
+ <label for="password">Password</label>
11
+ <input id="password" type="password" name="login[password]"-%>
12
+ </div>
13
+ <div>
14
+ <input type="submit" name="commit" value="Log In"/>
15
+ </div>
16
+ </form>
17
+ <% if session[:flash] and session[:flash][:error] %>
18
+ <div class="flash_error corners">
19
+ <%= session[:flash][:error] %>
20
+ </div>
21
+ <% end %>
22
+ </div>
23
+ </div>
24
+ <div id="copyright">
25
+ &copy; 2010 liquidrail, llc.
26
+ </div>
27
+ </div>
28
+ </center>
@@ -1,6 +1,6 @@
1
1
  <div id="search">
2
2
  <form id="search_form">
3
- <input id="search_term" class="search" type="text" size="50" name="search_filter[search_terms]"/>
3
+ <input id="search_term" class="search" type="text" size="50" name="search_filter[search_terms]" value="<%=@filter.search_terms%>"/>
4
4
  <%= image_tag 'loading.gif', :border => 0, :size => "20x20", :id => "search_loader" %>
5
5
  <input type="submit" value="Search" style="display: none;" name="commit"/>
6
6
  </form>
@@ -1,2 +1,2 @@
1
- $('#users').html( '<%= escape_javascript( partial( :'users/_rows' ) ) %>')
1
+ $('#users').html( '<%= escape_javascript( partial( :'users/rows' ) ) %>')
2
2
  $('p#timestamp').html( "<%=escape_javascript(partial(:'shared/timestamp'))%>" );
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wackamole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernand Galiana
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-22 00:00:00 -07:00
12
+ date: 2010-02-28 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -138,6 +138,7 @@ extra_rdoc_files:
138
138
  - views/mission/_report.erb
139
139
  - views/mission/index.erb
140
140
  - views/mission/refresh_js.erb
141
+ - views/session/login.erb
141
142
  - views/shared/_filter.erb
142
143
  - views/shared/_flash.erb
143
144
  - views/shared/_search.erb
@@ -157,11 +158,16 @@ files:
157
158
  - bin/setup_indexes
158
159
  - bin/wackamole
159
160
  - config.ru
161
+ - data/fixtures.rb
162
+ - features/env.rb
163
+ - features/mission.feature
164
+ - features/step_definitions/mission_steps.rb
160
165
  - lib/app.rb
161
166
  - lib/controllers/dashboard.rb
162
167
  - lib/controllers/features.rb
163
168
  - lib/controllers/logs.rb
164
169
  - lib/controllers/mission.rb
170
+ - lib/controllers/session.rb
165
171
  - lib/controllers/users.rb
166
172
  - lib/helpers/dashboard_helper.rb
167
173
  - lib/helpers/features_helper.rb
@@ -170,6 +176,7 @@ files:
170
176
  - lib/helpers/main_helper.rb
171
177
  - lib/helpers/mission_helper.rb
172
178
  - lib/helpers/rails_helper.rb
179
+ - lib/helpers/session_helper.rb
173
180
  - lib/wackamole.rb
174
181
  - lib/wackamole/core_ext/date_time.rb
175
182
  - lib/wackamole/core_ext/time.rb
@@ -275,15 +282,19 @@ files:
275
282
  - spec/core_ext/date_time_spec.rb
276
283
  - spec/core_ext/time_spec.rb
277
284
  - spec/data/fixtures.rb
278
- - spec/models/control_spec.rb
279
- - spec/models/feature_spec.rb
280
- - spec/models/log_spec.rb
281
- - spec/models/mission_spec.rb
282
- - spec/models/moled_info_spec.rb
283
- - spec/models/search_filter_spec.rb
284
- - spec/models/user_spec.rb
285
285
  - spec/spec_helper.rb
286
- - spec/wackamole_spec.rb
286
+ - spec/ui/log_spec.rb
287
+ - spec/ui/mission_spec.rb
288
+ - spec/ui/session_spec.rb
289
+ - spec/ui_utils/mission_util.rb
290
+ - spec/wackamole/models/control_spec.rb
291
+ - spec/wackamole/models/feature_spec.rb
292
+ - spec/wackamole/models/log_spec.rb
293
+ - spec/wackamole/models/mission_spec.rb
294
+ - spec/wackamole/models/moled_info_spec.rb
295
+ - spec/wackamole/models/search_filter_spec.rb
296
+ - spec/wackamole/models/user_spec.rb
297
+ - spec/wackamole/wackamole_spec.rb
287
298
  - tasks/bones.rake
288
299
  - tasks/fixtures.rake
289
300
  - tasks/gem.rake
@@ -314,6 +325,7 @@ files:
314
325
  - views/mission/index.erb
315
326
  - views/mission/refresh_js.erb
316
327
  - views/mission/trash.txt
328
+ - views/session/login.erb
317
329
  - views/shared/_filter.erb
318
330
  - views/shared/_flash.erb
319
331
  - views/shared/_search.erb
@@ -1,30 +0,0 @@
1
- require File.join(File.dirname(__FILE__), %w[.. spec_helper])
2
- require 'chronic'
3
-
4
- describe Wackamole::MoledInfo do
5
- before( :all ) do
6
- Wackamole::Control.init_config( File.join(File.dirname(__FILE__), %w[.. config test.yml]), 'test' )
7
- Wackamole::Control.connection.should_not be_nil
8
- Wackamole::Control.db( "mole_fred_test_mdb" )
9
- @test_time = Chronic.parse( "2010/01/01 01:00:00" )
10
- end
11
-
12
- it "should gather dashboard info correctly" do
13
- info = Wackamole::MoledInfo.collect_dashboard_info( @test_time )
14
-
15
- info[:total_users].should == 10
16
- info[:user_load].should == 2
17
- info[:total_features].should == 10
18
- info[:feature_load].should == 2
19
- info[:fault_load].should == 2
20
- info[:perf_load].should == 2
21
-
22
- series = 24.times.collect { |i| 0 }
23
- series[0] = 5
24
- series[1] = 2
25
- info[:user_series].should == series
26
- info[:feature_series].should == series
27
- info[:fault_series].should == series
28
- info[:perf_series].should == series
29
- end
30
- end