rackamole 0.2.5 → 0.2.6
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/HISTORY +12 -1
- data/README.rdoc +35 -35
- data/lib/rackamole.rb +1 -1
- data/lib/rackamole/alert/twitt.rb +5 -4
- data/lib/rackamole/mole.rb +40 -18
- data/lib/rackamole/store/mongo_db.rb +5 -3
- data/spec/rackamole/alert/twitt_spec.rb +3 -3
- data/spec/rackamole/mole_spec.rb +52 -5
- data/spec/rackamole/store/mongo_db_spec.rb +4 -4
- data/tasks/setup.rb +1 -1
- data/tasks/test.rake +1 -0
- metadata +3 -85
- data/a.rb +0 -18
- data/aaa.txt +0 -52
- data/images/mole_logo.png +0 -0
- data/images/mole_logo.psd +0 -0
- data/images/mole_logo_small.png +0 -0
- data/images/mole_logo_small.psd +0 -0
- data/samples/rails/moled/README +0 -243
- data/samples/rails/moled/Rakefile +0 -10
- data/samples/rails/moled/app/controllers/application_controller.rb +0 -21
- data/samples/rails/moled/app/controllers/fred_controller.rb +0 -14
- data/samples/rails/moled/app/helpers/application_helper.rb +0 -3
- data/samples/rails/moled/app/views/fred/index.html.erb +0 -1
- data/samples/rails/moled/app/views/fred/show.html.erb +0 -1
- data/samples/rails/moled/config/boot.rb +0 -110
- data/samples/rails/moled/config/database.yml +0 -22
- data/samples/rails/moled/config/environment.rb +0 -52
- data/samples/rails/moled/config/environments/development.rb +0 -17
- data/samples/rails/moled/config/environments/production.rb +0 -28
- data/samples/rails/moled/config/environments/test.rb +0 -28
- data/samples/rails/moled/config/initializers/backtrace_silencers.rb +0 -7
- data/samples/rails/moled/config/initializers/inflections.rb +0 -10
- data/samples/rails/moled/config/initializers/mime_types.rb +0 -5
- data/samples/rails/moled/config/initializers/new_rails_defaults.rb +0 -19
- data/samples/rails/moled/config/initializers/session_store.rb +0 -15
- data/samples/rails/moled/config/locales/en.yml +0 -5
- data/samples/rails/moled/config/routes.rb +0 -6
- data/samples/rails/moled/db/development.sqlite3 +0 -0
- data/samples/rails/moled/db/production.sqlite3 +0 -0
- data/samples/rails/moled/doc/README_FOR_APP +0 -2
- data/samples/rails/moled/log/development.log +0 -100
- data/samples/rails/moled/log/production.log +0 -46
- data/samples/rails/moled/log/server.log +0 -0
- data/samples/rails/moled/log/test.log +0 -0
- data/samples/rails/moled/public/404.html +0 -30
- data/samples/rails/moled/public/422.html +0 -30
- data/samples/rails/moled/public/500.html +0 -30
- data/samples/rails/moled/public/favicon.ico +0 -0
- data/samples/rails/moled/public/images/rails.png +0 -0
- data/samples/rails/moled/public/index.html +0 -275
- data/samples/rails/moled/public/javascripts/application.js +0 -2
- data/samples/rails/moled/public/javascripts/controls.js +0 -963
- data/samples/rails/moled/public/javascripts/dragdrop.js +0 -973
- data/samples/rails/moled/public/javascripts/effects.js +0 -1128
- data/samples/rails/moled/public/javascripts/prototype.js +0 -4320
- data/samples/rails/moled/public/robots.txt +0 -5
- data/samples/rails/moled/script/about +0 -4
- data/samples/rails/moled/script/console +0 -3
- data/samples/rails/moled/script/dbconsole +0 -3
- data/samples/rails/moled/script/destroy +0 -3
- data/samples/rails/moled/script/generate +0 -3
- data/samples/rails/moled/script/performance/benchmarker +0 -3
- data/samples/rails/moled/script/performance/profiler +0 -3
- data/samples/rails/moled/script/plugin +0 -3
- data/samples/rails/moled/script/runner +0 -3
- data/samples/rails/moled/script/server +0 -3
- data/samples/rails/moled/test/performance/browsing_test.rb +0 -9
- data/samples/rails/moled/test/test_helper.rb +0 -38
- data/samples/sinatra/moled.rb +0 -63
- data/samples/sinatra/public/.DS_Store +0 -0
- data/samples/sinatra/public/images/mole_logo.png +0 -0
- data/samples/sinatra/public/stylesheets/styles.css +0 -58
- data/samples/sinatra/views/index.erb +0 -14
- data/samples/sinatra/views/layout.erb +0 -23
- data/samples/sinatra/views/normal.erb +0 -1
- data/samples/sinatra/views/params.erb +0 -1
- data/samples/sinatra/views/post.erb +0 -1
- data/samples/sinatra/views/slow.erb +0 -1
- data/z_experiments/config.rb +0 -38
- data/z_experiments/config_sample.rb +0 -9
- data/z_experiments/configuration.rb +0 -5
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
ENV["RAILS_ENV"] = "test"
|
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
|
|
3
|
-
require 'test_help'
|
|
4
|
-
|
|
5
|
-
class ActiveSupport::TestCase
|
|
6
|
-
# Transactional fixtures accelerate your tests by wrapping each test method
|
|
7
|
-
# in a transaction that's rolled back on completion. This ensures that the
|
|
8
|
-
# test database remains unchanged so your fixtures don't have to be reloaded
|
|
9
|
-
# between every test method. Fewer database queries means faster tests.
|
|
10
|
-
#
|
|
11
|
-
# Read Mike Clark's excellent walkthrough at
|
|
12
|
-
# http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
|
|
13
|
-
#
|
|
14
|
-
# Every Active Record database supports transactions except MyISAM tables
|
|
15
|
-
# in MySQL. Turn off transactional fixtures in this case; however, if you
|
|
16
|
-
# don't care one way or the other, switching from MyISAM to InnoDB tables
|
|
17
|
-
# is recommended.
|
|
18
|
-
#
|
|
19
|
-
# The only drawback to using transactional fixtures is when you actually
|
|
20
|
-
# need to test transactions. Since your test is bracketed by a transaction,
|
|
21
|
-
# any transactions started in your code will be automatically rolled back.
|
|
22
|
-
self.use_transactional_fixtures = true
|
|
23
|
-
|
|
24
|
-
# Instantiated fixtures are slow, but give you @david where otherwise you
|
|
25
|
-
# would need people(:david). If you don't want to migrate your existing
|
|
26
|
-
# test cases which use the @david style and don't mind the speed hit (each
|
|
27
|
-
# instantiated fixtures translates to a database query per test method),
|
|
28
|
-
# then set this back to true.
|
|
29
|
-
self.use_instantiated_fixtures = false
|
|
30
|
-
|
|
31
|
-
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
|
32
|
-
#
|
|
33
|
-
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
|
34
|
-
# -- they do not yet inherit this setting
|
|
35
|
-
fixtures :all
|
|
36
|
-
|
|
37
|
-
# Add more helper methods to be used by all tests here...
|
|
38
|
-
end
|
data/samples/sinatra/moled.rb
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
require 'rubygems'
|
|
2
|
-
require 'sinatra'
|
|
3
|
-
require 'rackamole'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
configure do
|
|
7
|
-
set :sessions, true
|
|
8
|
-
|
|
9
|
-
puts "mole_sinatra_#{Sinatra::Application.environment}_mdb"
|
|
10
|
-
|
|
11
|
-
use Rack::Lint
|
|
12
|
-
use Rack::Session::Cookie
|
|
13
|
-
use Rack::Mole, {
|
|
14
|
-
:app_name => "Franky",
|
|
15
|
-
:environment => Sinatra::Application.environment,
|
|
16
|
-
:log_level => :debug,
|
|
17
|
-
:user_key => :user_name,
|
|
18
|
-
:store => Rackamole::Store::MongoDb.new(
|
|
19
|
-
:host => 'ec2-174-129-88-130.compute-1.amazonaws.com',
|
|
20
|
-
:database => "mole_franky_#{Sinatra::Application.environment}_mdb" ),
|
|
21
|
-
# :store => Rackamole::Store::MongoDb.new( :database => "mole_franky_#{Sinatra::Application.environment}_mdb" ),
|
|
22
|
-
:expiration => 10,
|
|
23
|
-
:perf_threshold => 0.2,
|
|
24
|
-
# :twitter => { :username => 'moled', :password => 'fernand~1', :alert_on => [Rackamole.perf, Rackamole.fault] },
|
|
25
|
-
:excluded_paths => [ /.+?\.css/, /.+?\.js/, /.+?\.png/, /.+?\.ico/ ]
|
|
26
|
-
}
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
before do
|
|
30
|
-
session[:user_name] = "Fernand"
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
get '/' do
|
|
34
|
-
erb :index
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
get '/normal' do
|
|
38
|
-
@blee = "Hello World!"
|
|
39
|
-
session[:normal] = "something normal"
|
|
40
|
-
erb :normal
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
post '/post' do
|
|
44
|
-
@post = params[:blee]
|
|
45
|
-
session[:post] = "something posted"
|
|
46
|
-
erb :post
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
get '/params/:id' do
|
|
50
|
-
@blee = params[:id]
|
|
51
|
-
session[:param] = "something param"
|
|
52
|
-
|
|
53
|
-
erb :params
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
get '/error' do
|
|
57
|
-
raise "Oh Snap!"
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
get '/slow' do
|
|
61
|
-
sleep 0.2
|
|
62
|
-
erb :slow
|
|
63
|
-
end
|
|
Binary file
|
|
Binary file
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
* {
|
|
2
|
-
outline-color: invert;
|
|
3
|
-
outline-style: none;
|
|
4
|
-
outline-width: medium;
|
|
5
|
-
margin: 0px;
|
|
6
|
-
padding: 0px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
body {
|
|
10
|
-
font-family: "Trebuchet","Lucida Grande","Lucida Sans Unicode","bitstream vera sans","trebuchet ms","verdana";
|
|
11
|
-
background: #f4f4f4 repeat-x top left;
|
|
12
|
-
color: #ffffff;
|
|
13
|
-
font-size: 2em;
|
|
14
|
-
font-size-adjust: none;
|
|
15
|
-
font-stretch: normal;
|
|
16
|
-
font-style: normal;
|
|
17
|
-
font-variant: normal;
|
|
18
|
-
font-weight: normal;
|
|
19
|
-
margin: 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#overall {
|
|
23
|
-
margin: 0px auto;
|
|
24
|
-
width: 1000px;
|
|
25
|
-
overflow: none;
|
|
26
|
-
margin-top: 30px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
#logo {
|
|
30
|
-
float:left;
|
|
31
|
-
width:45%;
|
|
32
|
-
margin-bottom:10px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
#main {
|
|
36
|
-
clear: left;
|
|
37
|
-
margin: 20px 10px 10px 20px;
|
|
38
|
-
overflow: none;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
h1 {
|
|
42
|
-
font-size: 2.2em;
|
|
43
|
-
color: #434343;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
a {
|
|
47
|
-
color: #cccccc;
|
|
48
|
-
text-decoration: none;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
a:hover {
|
|
52
|
-
text_decoration: underline;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
input {
|
|
56
|
-
font-size: 1em;
|
|
57
|
-
color: #cccccc;
|
|
58
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<h1>Mole sampler</h1>
|
|
2
|
-
|
|
3
|
-
<ul>
|
|
4
|
-
<li><a href="/normal">Plain ol' get</a></li>
|
|
5
|
-
<li><a href="/params/10">Get with params</a></li>
|
|
6
|
-
<li><a href="/error">Uncaught fault</a></li>
|
|
7
|
-
<li><a href="/slow">Slow request</a></li>
|
|
8
|
-
<li>
|
|
9
|
-
<form action="/post" method="post" >
|
|
10
|
-
<input type="text" name="blee"/>
|
|
11
|
-
<input type="submit" value="push me"/>
|
|
12
|
-
</form>
|
|
13
|
-
</li>
|
|
14
|
-
</ul>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<title>R A C K A M O L E - Sampler</title>
|
|
5
|
-
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
6
|
-
<link rel="icon" href="/favicon.ico" type="image/x-icon"/>
|
|
7
|
-
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
|
|
8
|
-
<link rel="stylesheet" href="/stylesheets/styles.css" type="text/css" media="screen" />
|
|
9
|
-
</head>
|
|
10
|
-
|
|
11
|
-
<body id="body">
|
|
12
|
-
<div id="overall">
|
|
13
|
-
<div id="logo">
|
|
14
|
-
<a href="/">
|
|
15
|
-
<img src='/images/mole_logo.png' style="border:none"/>
|
|
16
|
-
</a>
|
|
17
|
-
</div>
|
|
18
|
-
<div id="main">
|
|
19
|
-
<%= yield %>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h1>Normal -- <%=@blee%></h1>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h1>Params -- <%=@post%></h1>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h1>Posted - <%=@post%></h1>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<h1>I am the slow one</h1>
|
data/z_experiments/config.rb
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
require 'rubygems'
|
|
2
|
-
require 'yaml'
|
|
3
|
-
require 'pp'
|
|
4
|
-
|
|
5
|
-
class Fred
|
|
6
|
-
def method_missing( *args )
|
|
7
|
-
puts "Method missing -- #{args.inspect}"
|
|
8
|
-
self
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
Fred.new.blee( "a" ).duh( 10 )
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class Blee
|
|
16
|
-
def initialize
|
|
17
|
-
@list = []
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def method_missing( *args )
|
|
21
|
-
@list << args
|
|
22
|
-
self
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
blee = Blee.new
|
|
27
|
-
|
|
28
|
-
blee.instance_eval do
|
|
29
|
-
hello.world
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
puts blee.to_yaml
|
|
33
|
-
|
|
34
|
-
Fred do
|
|
35
|
-
fred "hello"
|
|
36
|
-
blee 10
|
|
37
|
-
end
|
|
38
|
-
|