statemachine 1.2.0 → 2.0.0

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 (141) hide show
  1. data/.gitignore +12 -0
  2. data/Gemfile +6 -0
  3. data/Gemfile.lock +12 -0
  4. data/Rakefile +21 -20
  5. data/doc/website/README +6 -0
  6. data/doc/website/config.yaml +2 -0
  7. data/doc/website/index.html +39 -0
  8. data/doc/website/src/default.css +110 -0
  9. data/doc/website/src/default.template +41 -0
  10. data/doc/website/src/documentation.page +45 -0
  11. data/doc/website/src/example.page +13 -0
  12. data/doc/website/src/example1.page +59 -0
  13. data/doc/website/src/example2.page +96 -0
  14. data/doc/website/src/example3.page +76 -0
  15. data/doc/website/src/example4.page +65 -0
  16. data/doc/website/src/images/8l_star.png +0 -0
  17. data/doc/website/src/images/bg.png +0 -0
  18. data/doc/website/src/images/bottom_border.png +0 -0
  19. data/doc/website/src/images/bottom_edge.png +0 -0
  20. data/doc/website/src/images/examples/vending_machine.png +0 -0
  21. data/doc/website/src/images/examples/vending_machine2.png +0 -0
  22. data/doc/website/src/images/examples/vending_machine3.png +0 -0
  23. data/doc/website/src/images/examples/vending_machine4a.png +0 -0
  24. data/doc/website/src/images/examples/vending_machine4b.png +0 -0
  25. data/doc/website/src/images/left_edge.png +0 -0
  26. data/doc/website/src/images/logo.png +0 -0
  27. data/doc/website/src/images/right_edge.png +0 -0
  28. data/doc/website/src/images/side_borders.png +0 -0
  29. data/doc/website/src/index.page +20 -0
  30. data/generate_tests/dot_graph/turnstile.rb +29 -0
  31. data/generate_tests/dot_graph/turnstile2.rb +48 -0
  32. data/generate_tests/java/turnstile.rb +54 -0
  33. data/generate_tests/java/turnstile2.rb +72 -0
  34. data/lib/statemachine/action_invokation.rb +0 -19
  35. data/lib/statemachine/version.rb +2 -2
  36. data/rails_plugin/README +183 -0
  37. data/rails_plugin/Rakefile +11 -0
  38. data/rails_plugin/app/controllers/admin_controller.rb +43 -0
  39. data/rails_plugin/app/controllers/application.rb +7 -0
  40. data/rails_plugin/app/controllers/main_controller.rb +34 -0
  41. data/rails_plugin/app/helpers/admin_helper.rb +2 -0
  42. data/rails_plugin/app/helpers/application_helper.rb +3 -0
  43. data/rails_plugin/app/helpers/main_helper.rb +7 -0
  44. data/rails_plugin/app/models/product.rb +21 -0
  45. data/rails_plugin/app/models/vending_machine.rb +36 -0
  46. data/rails_plugin/app/models/vending_machine_interface.rb +101 -0
  47. data/rails_plugin/app/models/vending_statemachine.rb +41 -0
  48. data/rails_plugin/app/views/admin/index.rhtml +45 -0
  49. data/rails_plugin/app/views/layouts/main.rhtml +12 -0
  50. data/rails_plugin/app/views/main/_info.rhtml +13 -0
  51. data/rails_plugin/app/views/main/event.rjs +27 -0
  52. data/rails_plugin/app/views/main/index.rhtml +38 -0
  53. data/rails_plugin/config/boot.rb +45 -0
  54. data/rails_plugin/config/database.yml +21 -0
  55. data/rails_plugin/config/environment.rb +60 -0
  56. data/rails_plugin/config/environments/development.rb +21 -0
  57. data/rails_plugin/config/environments/production.rb +18 -0
  58. data/rails_plugin/config/environments/test.rb +19 -0
  59. data/rails_plugin/config/routes.rb +23 -0
  60. data/rails_plugin/db/migrate/001_create_vending_machines.rb +12 -0
  61. data/rails_plugin/db/migrate/002_create_products.rb +14 -0
  62. data/rails_plugin/db/migrate/003_add_position_to_products.rb +9 -0
  63. data/rails_plugin/db/schema.rb +20 -0
  64. data/rails_plugin/doc/README_FOR_APP +2 -0
  65. data/rails_plugin/lib/tasks/base.rake +5 -0
  66. data/rails_plugin/public/.htaccess +40 -0
  67. data/rails_plugin/public/404.html +30 -0
  68. data/rails_plugin/public/500.html +30 -0
  69. data/rails_plugin/public/dispatch.cgi +10 -0
  70. data/rails_plugin/public/dispatch.fcgi +24 -0
  71. data/rails_plugin/public/dispatch.rb +10 -0
  72. data/rails_plugin/public/favicon.ico +0 -0
  73. data/rails_plugin/public/images/bricks.jpg +0 -0
  74. data/rails_plugin/public/images/cash_release_button.png +0 -0
  75. data/rails_plugin/public/images/change.png +0 -0
  76. data/rails_plugin/public/images/dime.png +0 -0
  77. data/rails_plugin/public/images/dollar.png +0 -0
  78. data/rails_plugin/public/images/money_panel.png +0 -0
  79. data/rails_plugin/public/images/nickel.png +0 -0
  80. data/rails_plugin/public/images/quarter.png +0 -0
  81. data/rails_plugin/public/images/rails.png +0 -0
  82. data/rails_plugin/public/images/vending_machine_body.png +0 -0
  83. data/rails_plugin/public/index.html +277 -0
  84. data/rails_plugin/public/javascripts/application.js +2 -0
  85. data/rails_plugin/public/javascripts/controls.js +833 -0
  86. data/rails_plugin/public/javascripts/dragdrop.js +942 -0
  87. data/rails_plugin/public/javascripts/effects.js +1088 -0
  88. data/rails_plugin/public/javascripts/prototype.js +2515 -0
  89. data/rails_plugin/public/robots.txt +1 -0
  90. data/rails_plugin/public/stylesheets/layout.css +163 -0
  91. data/rails_plugin/script/about +3 -0
  92. data/rails_plugin/script/breakpointer +3 -0
  93. data/rails_plugin/script/console +3 -0
  94. data/rails_plugin/script/destroy +3 -0
  95. data/rails_plugin/script/generate +3 -0
  96. data/rails_plugin/script/performance/benchmarker +3 -0
  97. data/rails_plugin/script/performance/profiler +3 -0
  98. data/rails_plugin/script/plugin +3 -0
  99. data/rails_plugin/script/process/inspector +3 -0
  100. data/rails_plugin/script/process/reaper +3 -0
  101. data/rails_plugin/script/process/spawner +3 -0
  102. data/rails_plugin/script/rails_spec +11 -0
  103. data/rails_plugin/script/rails_spec_server +43 -0
  104. data/rails_plugin/script/runner +3 -0
  105. data/rails_plugin/script/server +3 -0
  106. data/rails_plugin/spec/controllers/admin_controller_spec.rb +7 -0
  107. data/rails_plugin/spec/controllers/main_controller_spec.rb +38 -0
  108. data/rails_plugin/spec/fixtures/products.yml +2 -0
  109. data/rails_plugin/spec/fixtures/vending_machines.yml +2 -0
  110. data/rails_plugin/spec/helpers/admin_helper_spec.rb +5 -0
  111. data/rails_plugin/spec/helpers/main_helper_spec.rb +5 -0
  112. data/rails_plugin/spec/models/product_spec.rb +16 -0
  113. data/rails_plugin/spec/models/vending_machine_interface_spec.rb +168 -0
  114. data/rails_plugin/spec/models/vending_machine_spec.rb +30 -0
  115. data/rails_plugin/spec/models/vending_statemachine_spec.rb +130 -0
  116. data/rails_plugin/spec/plugins/context_support_spec.rb +28 -0
  117. data/rails_plugin/spec/plugins/controller_support_spec.rb +98 -0
  118. data/rails_plugin/spec/spec.opts +1 -0
  119. data/rails_plugin/spec/spec_helper.rb +28 -0
  120. data/rails_plugin/spec/views/main/event_spec.rb +61 -0
  121. data/rails_plugin/vendor/plugins/statemachine/README +4 -0
  122. data/rails_plugin/vendor/plugins/statemachine/Rakefile +22 -0
  123. data/rails_plugin/vendor/plugins/statemachine/init.rb +2 -0
  124. data/rails_plugin/vendor/plugins/statemachine/install.rb +1 -0
  125. data/rails_plugin/vendor/plugins/statemachine/lib/context_support.rb +22 -0
  126. data/rails_plugin/vendor/plugins/statemachine/lib/controller_support.rb +85 -0
  127. data/rails_plugin/vendor/plugins/statemachine/lib/statemachine_on_rails.rb +11 -0
  128. data/rails_plugin/vendor/plugins/statemachine/tasks/statemachine_tasks.rake +4 -0
  129. data/spec/action_invokation_spec.rb +1 -1
  130. data/spec/builder_spec.rb +1 -1
  131. data/spec/default_transition_spec.rb +1 -1
  132. data/spec/generate/dot_graph/dot_graph_stagemachine_spec.rb +1 -1
  133. data/spec/history_spec.rb +1 -1
  134. data/spec/sm_action_parameterization_spec.rb +1 -1
  135. data/spec/sm_entry_exit_actions_spec.rb +1 -1
  136. data/spec/sm_odds_n_ends_spec.rb +1 -1
  137. data/spec/sm_simple_spec.rb +1 -1
  138. data/spec/sm_super_state_spec.rb +1 -1
  139. data/spec/sm_turnstile_spec.rb +1 -1
  140. data/spec/transition_spec.rb +1 -1
  141. metadata +162 -46
@@ -0,0 +1,45 @@
1
+ # Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
2
+
3
+ unless defined?(RAILS_ROOT)
4
+ root_path = File.join(File.dirname(__FILE__), '..')
5
+
6
+ unless RUBY_PLATFORM =~ /mswin32/
7
+ require 'pathname'
8
+ root_path = Pathname.new(root_path).cleanpath(true).to_s
9
+ end
10
+
11
+ RAILS_ROOT = root_path
12
+ end
13
+
14
+ unless defined?(Rails::Initializer)
15
+ if File.directory?("#{RAILS_ROOT}/vendor/rails")
16
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
17
+ else
18
+ require 'rubygems'
19
+
20
+ environment_without_comments = IO.readlines(File.dirname(__FILE__) + '/environment.rb').reject { |l| l =~ /^#/ }.join
21
+ environment_without_comments =~ /[^#]RAILS_GEM_VERSION = '([\d.]+)'/
22
+ rails_gem_version = $1
23
+
24
+ if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION : rails_gem_version
25
+ # Asking for 1.1.6 will give you 1.1.6.5206, if available -- makes it easier to use beta gems
26
+ rails_gem = Gem.cache.search('rails', "~>#{version}.0").sort_by { |g| g.version.version }.last
27
+
28
+ if rails_gem
29
+ gem "rails", "=#{rails_gem.version.version}"
30
+ require rails_gem.full_gem_path + '/lib/initializer'
31
+ else
32
+ STDERR.puts %(Cannot find gem for Rails ~>#{version}.0:
33
+ Install the missing gem with 'gem install -v=#{version} rails', or
34
+ change environment.rb to define RAILS_GEM_VERSION with your desired version.
35
+ )
36
+ exit 1
37
+ end
38
+ else
39
+ gem "rails"
40
+ require 'initializer'
41
+ end
42
+ end
43
+
44
+ Rails::Initializer.run(:set_load_path)
45
+ end
@@ -0,0 +1,21 @@
1
+
2
+ development:
3
+ adapter: postgresql
4
+ database: Vending_dev
5
+ username: rails
6
+ password:
7
+ host: localhost
8
+
9
+ test:
10
+ adapter: postgresql
11
+ database: Vending_test
12
+ username: rails
13
+ password:
14
+ host: localhost
15
+
16
+ production:
17
+ adapter: postgresql
18
+ database: Vending
19
+ username: rails
20
+ password:
21
+ host: localhost
@@ -0,0 +1,60 @@
1
+ # Be sure to restart your web 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 = '1.2.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
+
16
+ # Skip frameworks you're not going to use (only works if using vendor/rails)
17
+ # config.frameworks -= [ :action_web_service, :action_mailer ]
18
+
19
+ # Only load the plugins named here, by default all plugins in vendor/plugins are loaded
20
+ # config.plugins = %W( exception_notification ssl_requirement )
21
+
22
+ # Add additional load paths for your own custom dirs
23
+ # config.load_paths += %W( #{RAILS_ROOT}/extras )
24
+
25
+ # Force all environments to use the same logger level
26
+ # (by default production uses :info, the others :debug)
27
+ # config.log_level = :debug
28
+
29
+ # Use the database for sessions instead of the file system
30
+ # (create the session table with 'rake db:sessions:create')
31
+ # config.action_controller.session_store = :active_record_store
32
+
33
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
34
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
35
+ # like if you have constraints or database-specific column types
36
+ # config.active_record.schema_format = :sql
37
+
38
+ # Activate observers that should always be running
39
+ # config.active_record.observers = :cacher, :garbage_collector
40
+
41
+ # Make Active Record use UTC-base instead of local time
42
+ # config.active_record.default_timezone = :utc
43
+
44
+ # See Rails::Configuration for more options
45
+ end
46
+
47
+ # Add new inflection rules using the following format
48
+ # (all these examples are active by default):
49
+ # Inflector.inflections do |inflect|
50
+ # inflect.plural /^(ox)$/i, '\1en'
51
+ # inflect.singular /^(ox)en/i, '\1'
52
+ # inflect.irregular 'person', 'people'
53
+ # inflect.uncountable %w( fish sheep )
54
+ # end
55
+
56
+ # Add new mime types for use in respond_to blocks:
57
+ # Mime::Type.register "text/richtext", :rtf
58
+ # Mime::Type.register "application/x-mobile", :mobile
59
+
60
+ # Include your application configuration below
@@ -0,0 +1,21 @@
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
+ # Enable the breakpoint server that script/breakpointer connects to
12
+ config.breakpoint_server = true
13
+
14
+ # Show full error reports and disable caching
15
+ config.action_controller.consider_all_requests_local = true
16
+ config.action_controller.perform_caching = false
17
+ config.action_view.cache_template_extensions = false
18
+ config.action_view.debug_rjs = true
19
+
20
+ # Don't care if the mailer can't send
21
+ config.action_mailer.raise_delivery_errors = false
@@ -0,0 +1,18 @@
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
+
14
+ # Enable serving of images, stylesheets, and javascripts from an asset server
15
+ # config.action_controller.asset_host = "http://assets.example.com"
16
+
17
+ # Disable delivery errors, bad email addresses will be ignored
18
+ # config.action_mailer.raise_delivery_errors = false
@@ -0,0 +1,19 @@
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
+ # Tell ActionMailer not to deliver emails to the real world.
17
+ # The :test delivery method accumulates sent emails in the
18
+ # ActionMailer::Base.deliveries array.
19
+ config.action_mailer.delivery_method = :test
@@ -0,0 +1,23 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+
4
+ # Sample of regular route:
5
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6
+ # Keep in mind you can assign values other than :controller and :action
7
+
8
+ # Sample of named route:
9
+ # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
10
+ # This route can be invoked with purchase_url(:id => product.id)
11
+
12
+ # You can have the root of your site routed by hooking up ''
13
+ # -- just remember to delete public/index.html.
14
+ # map.connect '', :controller => "welcome"
15
+
16
+ # Allow downloading Web Service WSDL as a file with an extension
17
+ # instead of a file named 'wsdl'
18
+ map.connect ':controller/service.wsdl', :action => 'wsdl'
19
+
20
+ # Install the default route as the lowest priority.
21
+ map.connect ':controller/:action/:id.:format'
22
+ map.connect ':controller/:action/:id'
23
+ end
@@ -0,0 +1,12 @@
1
+ class CreateVendingMachines < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :vending_machines do |t|
4
+ t.column :location, :string
5
+ t.column :cash, :integer
6
+ end
7
+ end
8
+
9
+ def self.down
10
+ drop_table :vending_machines
11
+ end
12
+ end
@@ -0,0 +1,14 @@
1
+ class CreateProducts < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :products do |t|
4
+ t.column :vending_machine_id, :integer
5
+ t.column :name, :string
6
+ t.column :price, :integer
7
+ t.column :inventory, :integer
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :products
13
+ end
14
+ end
@@ -0,0 +1,9 @@
1
+ class AddPositionToProducts < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :products, :position, :integer
4
+ end
5
+
6
+ def self.down
7
+ remove_column :products, :position
8
+ end
9
+ end
@@ -0,0 +1,20 @@
1
+ # This file is autogenerated. Instead of editing this file, please use the
2
+ # migrations feature of ActiveRecord to incrementally modify your database, and
3
+ # then regenerate this schema definition.
4
+
5
+ ActiveRecord::Schema.define(:version => 3) do
6
+
7
+ create_table "products", :force => true do |t|
8
+ t.column "vending_machine_id", :integer
9
+ t.column "name", :string
10
+ t.column "price", :integer
11
+ t.column "inventory", :integer
12
+ t.column "position", :integer
13
+ end
14
+
15
+ create_table "vending_machines", :force => true do |t|
16
+ t.column "location", :string
17
+ t.column "cash", :integer
18
+ end
19
+
20
+ end
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake appdoc" to generate API documentation for your models and controllers.
@@ -0,0 +1,5 @@
1
+
2
+ task :plugins do
3
+ `rm -rf vendor/plugins/rspec`
4
+ `ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_0_8_2/rspec_on_rails/vendor/plugins/rspec_on_rails`
5
+ end
@@ -0,0 +1,40 @@
1
+ # General Apache options
2
+ AddHandler fastcgi-script .fcgi
3
+ AddHandler cgi-script .cgi
4
+ Options +FollowSymLinks +ExecCGI
5
+
6
+ # If you don't want Rails to look in certain directories,
7
+ # use the following rewrite rules so that Apache won't rewrite certain requests
8
+ #
9
+ # Example:
10
+ # RewriteCond %{REQUEST_URI} ^/notrails.*
11
+ # RewriteRule .* - [L]
12
+
13
+ # Redirect all requests not available on the filesystem to Rails
14
+ # By default the cgi dispatcher is used which is very slow
15
+ #
16
+ # For better performance replace the dispatcher with the fastcgi one
17
+ #
18
+ # Example:
19
+ # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
20
+ RewriteEngine On
21
+
22
+ # If your Rails application is accessed via an Alias directive,
23
+ # then you MUST also set the RewriteBase in this htaccess file.
24
+ #
25
+ # Example:
26
+ # Alias /myrailsapp /path/to/myrailsapp/public
27
+ # RewriteBase /myrailsapp
28
+
29
+ RewriteRule ^$ index.html [QSA]
30
+ RewriteRule ^([^.]+)$ $1.html [QSA]
31
+ RewriteCond %{REQUEST_FILENAME} !-f
32
+ RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
33
+
34
+ # In case Rails experiences terminal errors
35
+ # Instead of displaying this message you can supply a file here which will be rendered instead
36
+ #
37
+ # Example:
38
+ # ErrorDocument 500 /500.html
39
+
40
+ ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>The page you were looking for doesn't exist (404)</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/404.html -->
25
+ <div class="dialog">
26
+ <h1>The page you were looking for doesn't exist.</h1>
27
+ <p>You may have mistyped the address or the page may have moved.</p>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,30 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+
6
+ <head>
7
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
8
+ <title>We're sorry, but something went wrong</title>
9
+ <style type="text/css">
10
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
11
+ div.dialog {
12
+ width: 25em;
13
+ padding: 0 4em;
14
+ margin: 4em auto 0 auto;
15
+ border: 1px solid #ccc;
16
+ border-right-color: #999;
17
+ border-bottom-color: #999;
18
+ }
19
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
20
+ </style>
21
+ </head>
22
+
23
+ <body>
24
+ <!-- This file lives in public/500.html -->
25
+ <div class="dialog">
26
+ <h1>We're sorry, but something went wrong.</h1>
27
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
28
+ </div>
29
+ </body>
30
+ </html>
@@ -0,0 +1,10 @@
1
+ #!/opt/local/bin/ruby
2
+
3
+ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
4
+
5
+ # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
6
+ # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
7
+ require "dispatcher"
8
+
9
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10
+ Dispatcher.dispatch
@@ -0,0 +1,24 @@
1
+ #!/opt/local/bin/ruby
2
+ #
3
+ # You may specify the path to the FastCGI crash log (a log of unhandled
4
+ # exceptions which forced the FastCGI instance to exit, great for debugging)
5
+ # and the number of requests to process before running garbage collection.
6
+ #
7
+ # By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
8
+ # and the GC period is nil (turned off). A reasonable number of requests
9
+ # could range from 10-100 depending on the memory footprint of your app.
10
+ #
11
+ # Example:
12
+ # # Default log path, normal GC behavior.
13
+ # RailsFCGIHandler.process!
14
+ #
15
+ # # Default log path, 50 requests between GC.
16
+ # RailsFCGIHandler.process! nil, 50
17
+ #
18
+ # # Custom log path, normal GC behavior.
19
+ # RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
20
+ #
21
+ require File.dirname(__FILE__) + "/../config/environment"
22
+ require 'fcgi_handler'
23
+
24
+ RailsFCGIHandler.process!
@@ -0,0 +1,10 @@
1
+ #!/opt/local/bin/ruby
2
+
3
+ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
4
+
5
+ # If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
6
+ # "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
7
+ require "dispatcher"
8
+
9
+ ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10
+ Dispatcher.dispatch
File without changes