mole 1.0.12 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. metadata +24 -146
  2. data/History.txt +0 -17
  3. data/Manifest.txt +0 -132
  4. data/README.txt +0 -216
  5. data/Rakefile +0 -46
  6. data/config/database.yml +0 -21
  7. data/config/test_database.yml +0 -69
  8. data/lib/mole.rb +0 -260
  9. data/lib/mole/db/migrate.rb +0 -90
  10. data/lib/mole/e_mole.rb +0 -75
  11. data/lib/mole/logger.rb +0 -134
  12. data/lib/mole/models/mole_feature.rb +0 -58
  13. data/lib/mole/models/mole_log.rb +0 -31
  14. data/lib/mole/module.rb +0 -292
  15. data/lib/mole/moler.rb +0 -71
  16. data/lib/mole/utils/frameworks.rb +0 -53
  17. data/lib/mole/version.rb +0 -15
  18. data/samples/merbapp/README +0 -14
  19. data/samples/merbapp/Rakefile +0 -124
  20. data/samples/merbapp/app/controllers/application.rb +0 -3
  21. data/samples/merbapp/app/controllers/exceptions.rb +0 -13
  22. data/samples/merbapp/app/controllers/moled.rb +0 -25
  23. data/samples/merbapp/app/helpers/global_helper.rb +0 -5
  24. data/samples/merbapp/app/mailers/views/layout/application.html.erb +0 -1
  25. data/samples/merbapp/app/mailers/views/layout/application.text.erb +0 -1
  26. data/samples/merbapp/app/parts/views/layout/application.html.erb +0 -1
  27. data/samples/merbapp/app/views/exceptions/internal_server_error.html.erb +0 -216
  28. data/samples/merbapp/app/views/exceptions/not_acceptable.html.erb +0 -38
  29. data/samples/merbapp/app/views/exceptions/not_found.html.erb +0 -40
  30. data/samples/merbapp/app/views/layout/application.html.erb +0 -11
  31. data/samples/merbapp/app/views/moled/index.html.erb +0 -5
  32. data/samples/merbapp/app/views/moled/result.html.erb +0 -5
  33. data/samples/merbapp/config/boot.rb +0 -11
  34. data/samples/merbapp/config/dependencies.rb +0 -41
  35. data/samples/merbapp/config/environments/development.rb +0 -1
  36. data/samples/merbapp/config/environments/production.rb +0 -1
  37. data/samples/merbapp/config/environments/test.rb +0 -1
  38. data/samples/merbapp/config/merb.yml +0 -82
  39. data/samples/merbapp/config/merb_init.rb +0 -26
  40. data/samples/merbapp/config/mole_config.rb +0 -33
  41. data/samples/merbapp/config/router.rb +0 -38
  42. data/samples/merbapp/config/upload.conf +0 -0
  43. data/samples/merbapp/public/images/merb.jpg +0 -0
  44. data/samples/merbapp/public/merb.fcgi +0 -6
  45. data/samples/merbapp/public/stylesheets/master.css +0 -119
  46. data/samples/merbapp/script/destroy +0 -32
  47. data/samples/merbapp/script/generate +0 -32
  48. data/samples/merbapp/script/stop_merb +0 -13
  49. data/samples/merbapp/spec/spec_helper.rb +0 -15
  50. data/samples/merbapp/test/test_helper.rb +0 -14
  51. data/samples/railsapp/README +0 -14
  52. data/samples/railsapp/Rakefile +0 -10
  53. data/samples/railsapp/app/controllers/application.rb +0 -13
  54. data/samples/railsapp/app/controllers/moled_controller.rb +0 -23
  55. data/samples/railsapp/app/helpers/application_helper.rb +0 -3
  56. data/samples/railsapp/app/views/moled/index.html.erb +0 -5
  57. data/samples/railsapp/app/views/moled/result.html.erb +0 -5
  58. data/samples/railsapp/config/boot.rb +0 -109
  59. data/samples/railsapp/config/database.yml +0 -13
  60. data/samples/railsapp/config/environment.rb +0 -59
  61. data/samples/railsapp/config/environments/development.rb +0 -18
  62. data/samples/railsapp/config/environments/production.rb +0 -20
  63. data/samples/railsapp/config/environments/test.rb +0 -22
  64. data/samples/railsapp/config/initializers/inflections.rb +0 -10
  65. data/samples/railsapp/config/initializers/mime_types.rb +0 -5
  66. data/samples/railsapp/config/initializers/mole.rb +0 -10
  67. data/samples/railsapp/config/moles/mole_config.rb +0 -44
  68. data/samples/railsapp/config/routes.rb +0 -35
  69. data/samples/railsapp/doc/README_FOR_APP +0 -2
  70. data/samples/railsapp/public/.htaccess +0 -40
  71. data/samples/railsapp/public/404.html +0 -30
  72. data/samples/railsapp/public/422.html +0 -30
  73. data/samples/railsapp/public/500.html +0 -30
  74. data/samples/railsapp/public/dispatch.cgi +0 -10
  75. data/samples/railsapp/public/dispatch.fcgi +0 -24
  76. data/samples/railsapp/public/dispatch.rb +0 -10
  77. data/samples/railsapp/public/favicon.ico +0 -0
  78. data/samples/railsapp/public/images/rails.png +0 -0
  79. data/samples/railsapp/public/javascripts/application.js +0 -2
  80. data/samples/railsapp/public/javascripts/controls.js +0 -963
  81. data/samples/railsapp/public/javascripts/dragdrop.js +0 -972
  82. data/samples/railsapp/public/javascripts/effects.js +0 -1120
  83. data/samples/railsapp/public/javascripts/prototype.js +0 -4225
  84. data/samples/railsapp/public/robots.txt +0 -5
  85. data/samples/railsapp/script/about +0 -3
  86. data/samples/railsapp/script/console +0 -3
  87. data/samples/railsapp/script/destroy +0 -3
  88. data/samples/railsapp/script/generate +0 -3
  89. data/samples/railsapp/script/performance/benchmarker +0 -3
  90. data/samples/railsapp/script/performance/profiler +0 -3
  91. data/samples/railsapp/script/performance/request +0 -3
  92. data/samples/railsapp/script/plugin +0 -3
  93. data/samples/railsapp/script/process/inspector +0 -3
  94. data/samples/railsapp/script/process/reaper +0 -3
  95. data/samples/railsapp/script/process/spawner +0 -3
  96. data/samples/railsapp/script/runner +0 -3
  97. data/samples/railsapp/script/server +0 -3
  98. data/samples/railsapp/test/test_helper.rb +0 -38
  99. data/samples/rubyapp/README +0 -22
  100. data/samples/rubyapp/bin/ruby_app +0 -35
  101. data/samples/rubyapp/config/mole_conf.rb +0 -31
  102. data/samples/rubyapp/lib/fred.rb +0 -22
  103. data/spec/config/auto_mole_config.rb +0 -26
  104. data/spec/config/mole_config.rb +0 -0
  105. data/spec/config/moles/fred_config.rb +0 -0
  106. data/spec/data/blee.rb +0 -64
  107. data/spec/db/migrate_spec.rb +0 -19
  108. data/spec/emole_spec.rb +0 -43
  109. data/spec/logger_spec.rb +0 -56
  110. data/spec/models/mole_feature_spec.rb +0 -48
  111. data/spec/models/mole_log_spec.rb +0 -62
  112. data/spec/module_spec.rb +0 -229
  113. data/spec/mole_spec.rb +0 -135
  114. data/spec/moler_spec.rb +0 -77
  115. data/spec/spec_helper.rb +0 -76
  116. data/spec/utils/framework_spec.rb +0 -99
  117. data/tasks/ann.rake +0 -76
  118. data/tasks/annotations.rake +0 -22
  119. data/tasks/doc.rake +0 -48
  120. data/tasks/gem.rake +0 -110
  121. data/tasks/manifest.rake +0 -49
  122. data/tasks/mole.rake +0 -115
  123. data/tasks/post_load.rake +0 -26
  124. data/tasks/rubyforge.rake +0 -57
  125. data/tasks/setup.rb +0 -227
  126. data/tasks/spec.rake +0 -54
  127. data/tasks/svn.rake +0 -44
  128. data/tasks/test.rake +0 -38
  129. data/templates/mole/e_mole/exception_alerts.rhtml +0 -14
  130. data/templates/mole/e_mole/feature_alerts.rhtml +0 -11
  131. data/templates/mole/e_mole/perf_alerts.rhtml +0 -12
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
-
4
- # required to overcome a callback in rspec
5
- def at_exit
6
- end
7
-
8
- begin
9
- require 'rubigen'
10
- rescue LoadError
11
- require 'rubygems'
12
- require 'rubigen'
13
- end
14
-
15
- require File.join(File.dirname(__FILE__), "..", 'config', 'boot')
16
- require (APP_ROOT / "config" / "merb_init" )
17
- module Kernel
18
- undef dependency if defined?(Kernel.dependency)
19
- end
20
-
21
- # Make the App's local gems available
22
- Gem.clear_paths
23
- Gem.path.unshift(APP_ROOT / "gems")
24
-
25
- require 'rubigen/scripts/destroy'
26
-
27
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
28
-
29
- # Default is to use rspec generators in gems. To change this to
30
- # Test::Unit use [:merb, :test_unit]
31
- RubiGen::Base.use_component_sources! Merb::GENERATOR_SCOPE
32
- RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_ROOT = File.join(File.dirname(__FILE__), '..')
3
-
4
- # required to overcome a callback in rspec
5
- def at_exit
6
- end
7
-
8
- begin
9
- require 'rubigen'
10
- rescue LoadError
11
- require 'rubygems'
12
- require 'rubigen'
13
- end
14
-
15
- require File.join(File.dirname(__FILE__), "..", 'config', 'boot')
16
- require File.join(Merb.root, 'config', 'dependencies')
17
- module Kernel
18
- undef dependency if defined?(Kernel.dependency)
19
- end
20
-
21
- # Make the App's local gems available
22
- Gem.clear_paths
23
- Gem.path.unshift(APP_ROOT / "gems")
24
-
25
- require 'rubigen/scripts/generate'
26
-
27
- ARGV.shift if ['--help', '-h'].include?(ARGV[0])
28
-
29
- # Default is to use rspec generators in gems. To change this to
30
- # Test::Unit use [:merb, :test_unit]
31
- RubiGen::Base.use_component_sources! Merb::GENERATOR_SCOPE
32
- RubiGen::Scripts::Generate.new.run(ARGV)
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'fileutils'
3
-
4
- pids=[]
5
-
6
- port_or_star = ARGV[0] || '*'
7
-
8
- Dir[File.dirname(__FILE__)+"/../log/merb.#{port_or_star}.pid"].each do |f|
9
- pid = IO.read(f).chomp.to_i
10
- puts "killing PID: #{pid}"
11
- Process.kill(9, pid)
12
- FileUtils.rm f
13
- end
@@ -1,15 +0,0 @@
1
- $TESTING=true
2
- require File.join(File.dirname(__FILE__), "..", 'config', 'boot')
3
- Merb.environment="test"
4
- require File.join(Merb.root, 'config', 'merb_init')
5
-
6
- require 'merb/test/helper'
7
- require 'merb/test/rspec'
8
-
9
- Spec::Runner.configure do |config|
10
- config.include(Merb::Test::Helper)
11
- config.include(Merb::Test::RspecMatchers)
12
- end
13
-
14
-
15
- ### METHODS BELOW THIS LINE SHOULD BE EXTRACTED TO MERB ITSELF
@@ -1,14 +0,0 @@
1
- require File.join(File.dirname(__FILE__), "..", 'config', 'boot')
2
-
3
- $TESTING=true
4
-
5
- require 'rubygems'
6
- require 'test/unit'
7
- require File.join(Merb.root, 'config', 'merb_init')
8
-
9
- require 'merb/test/helper'
10
-
11
- class Test::Unit::TestCase
12
- include Merb::Test::Helper
13
- # Add more helper methods to be used by all tests here...
14
- end
@@ -1,14 +0,0 @@
1
- Sample MOled Rails App
2
-
3
- NOTE: You must have rails installed
4
-
5
-
6
- > cd samples/railsapp
7
-
8
- Now launch rails
9
-
10
- > script/server
11
-
12
- View the app by using the following url
13
-
14
- http://localhost:3000
@@ -1,10 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5
-
6
- require 'rake'
7
- require 'rake/testtask'
8
- require 'rake/rdoctask'
9
-
10
- require 'tasks/rails'
@@ -1,13 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- helper :all # include all helpers, all the time
3
-
4
- # See ActionController::RequestForgeryProtection for details
5
- # Uncomment the :secret if you're not using the cookie session store
6
- protect_from_forgery # :secret => '59d52cb64b5c2ba2a4810a865fecf933'
7
-
8
- # Load the MOle configuration. Don't crap out if the MOle has not
9
- # been initialized for the given environment. In dev env this
10
- # file will be reloaded, allowing you to tweak the MOle configuration
11
- # to your liking.
12
- Mole.load_mole_configuration
13
- end
@@ -1,23 +0,0 @@
1
- # A plain old application controller that has been MOled...
2
- class MoledController < ApplicationController
3
- def index
4
- end
5
-
6
- # A plain ol' feature
7
- def my_action
8
- session[:user] = "Fernand"
9
- @state = "Fred"
10
- render :template => "moled/result"
11
- end
12
-
13
- # A slow action
14
- def my_slow_action
15
- sleep( 2 )
16
- render :template => "moled/result"
17
- end
18
-
19
- # Hosed action
20
- def my_hosed_action
21
- raise "This will hose your app"
22
- end
23
- end
@@ -1,3 +0,0 @@
1
- # Methods added to this helper will be available to all templates in the application.
2
- module ApplicationHelper
3
- end
@@ -1,5 +0,0 @@
1
- <%= link_to "Mole an action", "/moled/my_action/10"%>
2
- <br/>
3
- <%= link_to "Mole a slow action", "/moled/my_slow_action"%>
4
- <br/>
5
- <%= link_to "Mole a hosed action", "/moled/my_hosed_action"%>
@@ -1,5 +0,0 @@
1
- <h1>You've been RailsMOled !</h1>
2
- <br/>
3
- <h3>Suspicious ? Check your console output...</h3>
4
- <br>
5
- <%= link_to "Go Back", "/moled"%>
@@ -1,109 +0,0 @@
1
- # Don't change this file!
2
- # Configure your app in config/environment.rb and config/environments/*.rb
3
-
4
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5
-
6
- module Rails
7
- class << self
8
- def boot!
9
- unless booted?
10
- preinitialize
11
- pick_boot.run
12
- end
13
- end
14
-
15
- def booted?
16
- defined? Rails::Initializer
17
- end
18
-
19
- def pick_boot
20
- (vendor_rails? ? VendorBoot : GemBoot).new
21
- end
22
-
23
- def vendor_rails?
24
- File.exist?("#{RAILS_ROOT}/vendor/rails")
25
- end
26
-
27
- # FIXME : Ruby 1.9
28
- def preinitialize
29
- load(preinitializer_path) if File.exists?(preinitializer_path)
30
- end
31
-
32
- def preinitializer_path
33
- "#{RAILS_ROOT}/config/preinitializer.rb"
34
- end
35
- end
36
-
37
- class Boot
38
- def run
39
- load_initializer
40
- Rails::Initializer.run(:set_load_path)
41
- end
42
- end
43
-
44
- class VendorBoot < Boot
45
- def load_initializer
46
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
47
- end
48
- end
49
-
50
- class GemBoot < Boot
51
- def load_initializer
52
- self.class.load_rubygems
53
- load_rails_gem
54
- require 'initializer'
55
- end
56
-
57
- def load_rails_gem
58
- if version = self.class.gem_version
59
- gem 'rails', version
60
- else
61
- gem 'rails'
62
- end
63
- rescue Gem::LoadError => load_error
64
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
65
- exit 1
66
- end
67
-
68
- class << self
69
- def rubygems_version
70
- Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
71
- end
72
-
73
- def gem_version
74
- if defined? RAILS_GEM_VERSION
75
- RAILS_GEM_VERSION
76
- elsif ENV.include?('RAILS_GEM_VERSION')
77
- ENV['RAILS_GEM_VERSION']
78
- else
79
- parse_gem_version(read_environment_rb)
80
- end
81
- end
82
-
83
- def load_rubygems
84
- require 'rubygems'
85
-
86
- unless rubygems_version >= '0.9.4'
87
- $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
88
- exit 1
89
- end
90
-
91
- rescue LoadError
92
- $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
93
- exit 1
94
- end
95
-
96
- def parse_gem_version(text)
97
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
98
- end
99
-
100
- private
101
- def read_environment_rb
102
- File.read("#{RAILS_ROOT}/config/environment.rb")
103
- end
104
- end
105
- end
106
- end
107
-
108
- # All that for this:
109
- Rails.boot!
@@ -1,13 +0,0 @@
1
- development:
2
- adapter: mysql
3
- database: mole_test
4
- username: root
5
- password:
6
- host: localhost
7
-
8
- production:
9
- adapter: mysql
10
- database: mole_test
11
- username: root
12
- password:
13
- host: localhost
@@ -1,59 +0,0 @@
1
- # Be sure to restart your server when you modify this file
2
-
3
- # Uncomment below to force Rails into production mode when
4
- # you don't control web/app server and can't set it the proper way
5
- # ENV['RAILS_ENV'] ||= 'production'
6
-
7
- # Specifies gem version of Rails to use when vendor/rails is not present
8
- RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION
9
-
10
- # Bootstrap the Rails environment, frameworks, and default configuration
11
- require File.join(File.dirname(__FILE__), 'boot')
12
-
13
- Rails::Initializer.run do |config|
14
- # Settings in config/environments/* take precedence over those specified here.
15
- # Application configuration should go into files in config/initializers
16
- # -- all .rb files in that directory are automatically loaded.
17
- # See Rails::Configuration for more options.
18
-
19
- # Skip frameworks you're not going to use (only works if using vendor/rails).
20
- # To use Rails without a database, you must remove the Active Record framework
21
- # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
22
-
23
- # Only load the plugins named here, in the order given. By default, all plugins
24
- # in vendor/plugins are loaded in alphabetical order.
25
- # :all can be used as a placeholder for all plugins not explicitly named
26
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
27
-
28
- # Add additional load paths for your own custom dirs
29
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
30
-
31
- # Force all environments to use the same logger level
32
- # (by default production uses :info, the others :debug)
33
- # config.log_level = :debug
34
-
35
- # Your secret key for verifying cookie session data integrity.
36
- # If you change this key, all old sessions will become invalid!
37
- # Make sure the secret is at least 30 characters and all random,
38
- # no regular words or you'll be exposed to dictionary attacks.
39
- config.action_controller.session = {
40
- :session_key => '_railsapp_session',
41
- :secret => '94c8d8149e3d0e0c3c437c40312f95310e5408cc39e1acceaf01659f2013a5da4b2961a044a1b08248d1fcaf4d7baa294fdc2aac1bec42e351fe905642cfc62c'
42
- }
43
-
44
- # Use the database for sessions instead of the cookie-based default,
45
- # which shouldn't be used to store highly confidential information
46
- # (create the session table with 'rake db:sessions:create')
47
- # config.action_controller.session_store = :active_record_store
48
-
49
- # Use SQL instead of Active Record's schema dumper when creating the test database.
50
- # This is necessary if your schema can't be completely dumped by the schema dumper,
51
- # like if you have constraints or database-specific column types
52
- # config.active_record.schema_format = :sql
53
-
54
- # Activate observers that should always be running
55
- # config.active_record.observers = :cacher, :garbage_collector
56
-
57
- # Make Active Record use UTC-base instead of local time
58
- # config.active_record.default_timezone = :utc
59
- end
@@ -1,18 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # In the development environment your application's code is reloaded on
4
- # every request. This slows down response time but is perfect for development
5
- # since you don't have to restart the webserver when you make code changes.
6
- config.cache_classes = false
7
-
8
- # Log error messages when you accidentally call methods on nil.
9
- config.whiny_nils = true
10
-
11
- # Show full error reports and disable caching
12
- config.action_controller.consider_all_requests_local = true
13
- config.action_view.debug_rjs = true
14
- config.action_controller.perform_caching = false
15
- config.action_view.cache_template_extensions = false
16
-
17
- # Don't care if the mailer can't send
18
- config.action_mailer.raise_delivery_errors = false
@@ -1,20 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The production environment is meant for finished, "live" apps.
4
- # Code is not reloaded between requests
5
- config.cache_classes = true
6
-
7
- # Use a different logger for distributed setups
8
- # config.logger = SyslogLogger.new
9
-
10
- # Full error reports are disabled and caching is turned on
11
- config.action_controller.consider_all_requests_local = false
12
- config.action_controller.perform_caching = true
13
- config.action_view.cache_template_loading = true
14
-
15
- # Enable serving of images, stylesheets, and javascripts from an asset server
16
- # config.action_controller.asset_host = "http://assets.example.com"
17
-
18
- # Disable delivery errors, bad email addresses will be ignored
19
- # config.action_mailer.raise_delivery_errors = false
20
-
@@ -1,22 +0,0 @@
1
- # Settings specified here will take precedence over those in config/environment.rb
2
-
3
- # The test environment is used exclusively to run your application's
4
- # test suite. You never need to work with it otherwise. Remember that
5
- # your test database is "scratch space" for the test suite and is wiped
6
- # and recreated between test runs. Don't rely on the data there!
7
- config.cache_classes = true
8
-
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
11
-
12
- # Show full error reports and disable caching
13
- config.action_controller.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Disable request forgery protection in test environment
17
- config.action_controller.allow_forgery_protection = false
18
-
19
- # Tell ActionMailer not to deliver emails to the real world.
20
- # The :test delivery method accumulates sent emails in the
21
- # ActionMailer::Base.deliveries array.
22
- config.action_mailer.delivery_method = :test