Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial import.

  • Loading branch information...
commit 9c344923c524bc5617a80330e3f0cfc50c1c0bb4 1 parent d8d1bd6
zumkehr authored

Showing 65 changed files with 6,602 additions and 0 deletions. Show diff stats Hide diff stats

  1. +12 0 .loadpath
  2. +18 0 .project
  3. +3 0  Capfile
  4. +256 0 README
  5. +10 0 Rakefile
  6. +15 0 app/controllers/application.rb
  7. +2 0  app/controllers/rip_controller.rb
  8. +3 0  app/helpers/application_helper.rb
  9. +2 0  app/helpers/rip_helper.rb
  10. +10 0 app/models/bit.rb
  11. +2 0  app/models/form_field.rb
  12. +2 0  app/models/navi_action.rb
  13. +9 0 app/models/rip.rb
  14. +39 0 config/boot.rb
  15. +62 0 config/environment.rb
  16. +21 0 config/environments/development.rb
  17. +18 0 config/environments/production.rb
  18. +19 0 config/environments/test.rb
  19. +10 0 config/initializers/inflections.rb
  20. +5 0 config/initializers/mime_types.rb
  21. +17 0 config/initializers/new_rails_defaults.rb
  22. +23 0 config/routes.rb
  23. +38 0 db/migrate/001_initial_setup.rb
  24. +2 0  doc/README_FOR_APP
  25. +40 0 public/.htaccess
  26. +30 0 public/404.html
  27. +30 0 public/422.html
  28. +30 0 public/500.html
  29. +10 0 public/dispatch.cgi
  30. +24 0 public/dispatch.fcgi
  31. +10 0 public/dispatch.rb
  32. BIN  public/favicon.ico
  33. BIN  public/images/rails.png
  34. +288 0 public/index.html
  35. +2 0  public/javascripts/application.js
  36. +833 0 public/javascripts/controls.js
  37. +942 0 public/javascripts/dragdrop.js
  38. +1,088 0 public/javascripts/effects.js
  39. +2,515 0 public/javascripts/prototype.js
  40. +1 0  public/robots.txt
  41. +3 0  script/about
  42. +3 0  script/breakpointer
  43. +3 0  script/console
  44. +3 0  script/dbconsole
  45. +3 0  script/destroy
  46. +3 0  script/generate
  47. +3 0  script/performance/benchmarker
  48. +3 0  script/performance/profiler
  49. +3 0  script/performance/request
  50. +3 0  script/plugin
  51. +3 0  script/process/inspector
  52. +3 0  script/process/reaper
  53. +3 0  script/process/spawner
  54. +3 0  script/runner
  55. +3 0  script/server
  56. +5 0 test/fixtures/bits.yml
  57. +5 0 test/fixtures/form_fields.yml
  58. +5 0 test/fixtures/navi_actions.yml
  59. +5 0 test/fixtures/rips.yml
  60. +18 0 test/functional/rip_controller_test.rb
  61. +38 0 test/test_helper.rb
  62. +10 0 test/unit/bit_test.rb
  63. +10 0 test/unit/form_field_test.rb
  64. +10 0 test/unit/navi_action_test.rb
  65. +10 0 test/unit/rip_test.rb
12 .loadpath
... ... @@ -0,0 +1,12 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<loadpath>
  3 + <pathentry path="" type="src"/>
  4 + <pathentry path="org.rubypeople.rdt.launching.RUBY_CONTAINER" type="con"/>
  5 + <pathentry path="GEM_LIB/gems/activesupport-1.4.4/lib" type="var"/>
  6 + <pathentry path="GEM_LIB/gems/actionwebservice-1.2.6/lib" type="var"/>
  7 + <pathentry path="GEM_LIB/gems/actionpack-1.13.6/lib" type="var"/>
  8 + <pathentry path="GEM_LIB/gems/actionmailer-1.3.6/lib" type="var"/>
  9 + <pathentry path="GEM_LIB/gems/activerecord-1.15.6/lib" type="var"/>
  10 + <pathentry path="GEM_LIB/gems/rails-1.2.6/lib" type="var"/>
  11 + <pathentry path="GEM_LIB/gems/rake-0.7.3/lib" type="var"/>
  12 +</loadpath>
18 .project
... ... @@ -0,0 +1,18 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>bitrip</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.rubypeople.rdt.core.rubybuilder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + </buildSpec>
  14 + <natures>
  15 + <nature>org.rubypeople.rdt.core.rubynature</nature>
  16 + <nature>org.radrails.rails.core.railsnature</nature>
  17 + </natures>
  18 +</projectDescription>
3  Capfile
... ... @@ -0,0 +1,3 @@
  1 +load 'deploy' if respond_to?(:namespace) # cap2 differentiator
  2 +Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
  3 +load 'config/deploy'
256 README
... ... @@ -0,0 +1,256 @@
  1 +== Welcome to Rails
  2 +
  3 +Rails is a web-application framework that includes everything needed to create
  4 +database-backed web applications according to the Model-View-Control pattern.
  5 +
  6 +This pattern splits the view (also called the presentation) into "dumb" templates
  7 +that are primarily responsible for inserting pre-built data in between HTML tags.
  8 +The model contains the "smart" domain objects (such as Account, Product, Person,
  9 +Post) that holds all the business logic and knows how to persist themselves to
  10 +a database. The controller handles the incoming requests (such as Save New Account,
  11 +Update Product, Show Post) by manipulating the model and directing data to the view.
  12 +
  13 +In Rails, the model is handled by what's called an object-relational mapping
  14 +layer entitled Active Record. This layer allows you to present the data from
  15 +database rows as objects and embellish these data objects with business logic
  16 +methods. You can read more about Active Record in
  17 +link:files/vendor/rails/activerecord/README.html.
  18 +
  19 +The controller and view are handled by the Action Pack, which handles both
  20 +layers by its two parts: Action View and Action Controller. These two layers
  21 +are bundled in a single package due to their heavy interdependence. This is
  22 +unlike the relationship between the Active Record and Action Pack that is much
  23 +more separate. Each of these packages can be used independently outside of
  24 +Rails. You can read more about Action Pack in
  25 +link:files/vendor/rails/actionpack/README.html.
  26 +
  27 +
  28 +== Getting Started
  29 +
  30 +1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
  31 + and your application name. Ex: rails myapp
  32 +2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
  33 +3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
  34 +4. Follow the guidelines to start developing your application
  35 +
  36 +
  37 +== Web Servers
  38 +
  39 +By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise
  40 +Rails will use WEBrick, the webserver that ships with Ruby. When you run script/server,
  41 +Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures
  42 +that you can always get up and running quickly.
  43 +
  44 +Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
  45 +suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
  46 +getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
  47 +More info at: http://mongrel.rubyforge.org
  48 +
  49 +If Mongrel is not installed, Rails will look for lighttpd. It's considerably faster than
  50 +Mongrel and WEBrick and also suited for production use, but requires additional
  51 +installation and currently only works well on OS X/Unix (Windows users are encouraged
  52 +to start with Mongrel). We recommend version 1.4.11 and higher. You can download it from
  53 +http://www.lighttpd.net.
  54 +
  55 +And finally, if neither Mongrel or lighttpd are installed, Rails will use the built-in Ruby
  56 +web server, WEBrick. WEBrick is a small Ruby web server suitable for development, but not
  57 +for production.
  58 +
  59 +But of course its also possible to run Rails on any platform that supports FCGI.
  60 +Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
  61 +please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
  62 +
  63 +
  64 +== Apache .htaccess example
  65 +
  66 +# General Apache options
  67 +AddHandler fastcgi-script .fcgi
  68 +AddHandler cgi-script .cgi
  69 +Options +FollowSymLinks +ExecCGI
  70 +
  71 +# If you don't want Rails to look in certain directories,
  72 +# use the following rewrite rules so that Apache won't rewrite certain requests
  73 +#
  74 +# Example:
  75 +# RewriteCond %{REQUEST_URI} ^/notrails.*
  76 +# RewriteRule .* - [L]
  77 +
  78 +# Redirect all requests not available on the filesystem to Rails
  79 +# By default the cgi dispatcher is used which is very slow
  80 +#
  81 +# For better performance replace the dispatcher with the fastcgi one
  82 +#
  83 +# Example:
  84 +# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
  85 +RewriteEngine On
  86 +
  87 +# If your Rails application is accessed via an Alias directive,
  88 +# then you MUST also set the RewriteBase in this htaccess file.
  89 +#
  90 +# Example:
  91 +# Alias /myrailsapp /path/to/myrailsapp/public
  92 +# RewriteBase /myrailsapp
  93 +
  94 +RewriteRule ^$ index.html [QSA]
  95 +RewriteRule ^([^.]+)$ $1.html [QSA]
  96 +RewriteCond %{REQUEST_FILENAME} !-f
  97 +RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
  98 +
  99 +# In case Rails experiences terminal errors
  100 +# Instead of displaying this message you can supply a file here which will be rendered instead
  101 +#
  102 +# Example:
  103 +# ErrorDocument 500 /500.html
  104 +
  105 +ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
  106 +
  107 +
  108 +== Debugging Rails
  109 +
  110 +Sometimes your application goes wrong. Fortunately there are a lot of tools that
  111 +will help you debug it and get it back on the rails.
  112 +
  113 +First area to check is the application log files. Have "tail -f" commands running
  114 +on the server.log and development.log. Rails will automatically display debugging
  115 +and runtime information to these files. Debugging info will also be shown in the
  116 +browser on requests from 127.0.0.1.
  117 +
  118 +You can also log your own messages directly into the log file from your code using
  119 +the Ruby logger class from inside your controllers. Example:
  120 +
  121 + class WeblogController < ActionController::Base
  122 + def destroy
  123 + @weblog = Weblog.find(params[:id])
  124 + @weblog.destroy
  125 + logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
  126 + end
  127 + end
  128 +
  129 +The result will be a message in your log file along the lines of:
  130 +
  131 + Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
  132 +
  133 +More information on how to use the logger is at http://www.ruby-doc.org/core/
  134 +
  135 +Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
  136 +
  137 +* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
  138 +* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
  139 +
  140 +These two online (and free) books will bring you up to speed on the Ruby language
  141 +and also on programming in general.
  142 +
  143 +
  144 +== Debugger
  145 +
  146 +Debugger support is available through the debugger command when you start your Mongrel or
  147 +Webrick server with --debugger. This means that you can break out of execution at any point
  148 +in the code, investigate and change the model, AND then resume execution!
  149 +You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
  150 +Example:
  151 +
  152 + class WeblogController < ActionController::Base
  153 + def index
  154 + @posts = Post.find(:all)
  155 + debugger
  156 + end
  157 + end
  158 +
  159 +So the controller will accept the action, run the first line, then present you
  160 +with a IRB prompt in the server window. Here you can do things like:
  161 +
  162 + >> @posts.inspect
  163 + => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
  164 + #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
  165 + >> @posts.first.title = "hello from a debugger"
  166 + => "hello from a debugger"
  167 +
  168 +...and even better is that you can examine how your runtime objects actually work:
  169 +
  170 + >> f = @posts.first
  171 + => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
  172 + >> f.
  173 + Display all 152 possibilities? (y or n)
  174 +
  175 +Finally, when you're ready to resume execution, you enter "cont"
  176 +
  177 +
  178 +== Console
  179 +
  180 +You can interact with the domain model by starting the console through <tt>script/console</tt>.
  181 +Here you'll have all parts of the application configured, just like it is when the
  182 +application is running. You can inspect domain models, change values, and save to the
  183 +database. Starting the script without arguments will launch it in the development environment.
  184 +Passing an argument will specify a different environment, like <tt>script/console production</tt>.
  185 +
  186 +To reload your controllers and models after launching the console run <tt>reload!</tt>
  187 +
  188 +== dbconsole
  189 +
  190 +You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
  191 +You would be connected to the database with the credentials defined in database.yml.
  192 +Starting the script without arguments will connect you to the development database. Passing an
  193 +argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
  194 +Currently works for mysql, postgresql and sqlite.
  195 +
  196 +== Description of Contents
  197 +
  198 +app
  199 + Holds all the code that's specific to this particular application.
  200 +
  201 +app/controllers
  202 + Holds controllers that should be named like weblogs_controller.rb for
  203 + automated URL mapping. All controllers should descend from ApplicationController
  204 + which itself descends from ActionController::Base.
  205 +
  206 +app/models
  207 + Holds models that should be named like post.rb.
  208 + Most models will descend from ActiveRecord::Base.
  209 +
  210 +app/views
  211 + Holds the template files for the view that should be named like
  212 + weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
  213 + syntax.
  214 +
  215 +app/views/layouts
  216 + Holds the template files for layouts to be used with views. This models the common
  217 + header/footer method of wrapping views. In your views, define a layout using the
  218 + <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
  219 + call <% yield %> to render the view using this layout.
  220 +
  221 +app/helpers
  222 + Holds view helpers that should be named like weblogs_helper.rb. These are generated
  223 + for you automatically when using script/generate for controllers. Helpers can be used to
  224 + wrap functionality for your views into methods.
  225 +
  226 +config
  227 + Configuration files for the Rails environment, the routing map, the database, and other dependencies.
  228 +
  229 +db
  230 + Contains the database schema in schema.rb. db/migrate contains all
  231 + the sequence of Migrations for your schema.
  232 +
  233 +doc
  234 + This directory is where your application documentation will be stored when generated
  235 + using <tt>rake doc:app</tt>
  236 +
  237 +lib
  238 + Application specific libraries. Basically, any kind of custom code that doesn't
  239 + belong under controllers, models, or helpers. This directory is in the load path.
  240 +
  241 +public
  242 + The directory available for the web server. Contains subdirectories for images, stylesheets,
  243 + and javascripts. Also contains the dispatchers and the default HTML files. This should be
  244 + set as the DOCUMENT_ROOT of your web server.
  245 +
  246 +script
  247 + Helper scripts for automation and generation.
  248 +
  249 +test
  250 + Unit and functional tests along with fixtures. When using the script/generate scripts, template
  251 + test files will be generated for you and placed in this directory.
  252 +
  253 +vendor
  254 + External libraries that the application depends on. Also includes the plugins subdirectory.
  255 + If the app has frozen rails, those gems also go here, under vendor/rails/.
  256 + This directory is in the load path.
10 Rakefile
... ... @@ -0,0 +1,10 @@
  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'
15 app/controllers/application.rb
... ... @@ -0,0 +1,15 @@
  1 +# Filters added to this controller apply to all controllers in the application.
  2 +# Likewise, all the methods added will be available for all controllers.
  3 +
  4 +class ApplicationController < ActionController::Base
  5 + helper :all # include all helpers, all the time
  6 +
  7 + # See ActionController::RequestForgeryProtection for details
  8 + # Uncomment the :secret if you're not using the cookie session store
  9 + protect_from_forgery # :secret => 'ff10981320140076dcd167f882173421'
  10 +
  11 + # See ActionController::Base for details
  12 + # Uncomment this to filter the contents of submitted sensitive data parameters
  13 + # from your application log (in this case, all fields with names like "password").
  14 + # filter_parameter_logging :password
  15 +end
2  app/controllers/rip_controller.rb
... ... @@ -0,0 +1,2 @@
  1 +class RipController < ApplicationController
  2 +end
3  app/helpers/application_helper.rb
... ... @@ -0,0 +1,3 @@
  1 +# Methods added to this helper will be available to all templates in the application.
  2 +module ApplicationHelper
  3 +end
2  app/helpers/rip_helper.rb
... ... @@ -0,0 +1,2 @@
  1 +module RipHelper
  2 +end
10 app/models/bit.rb
... ... @@ -0,0 +1,10 @@
  1 +class Bit < ActiveRecord::Base
  2 +
  3 + act_as_list :scope => :rip
  4 +
  5 + belongs_to :rip
  6 +
  7 + validates_presence_of :xpath
  8 +
  9 +
  10 +end
2  app/models/form_field.rb
... ... @@ -0,0 +1,2 @@
  1 +class FormField < ActiveRecord::Base
  2 +end
2  app/models/navi_action.rb
... ... @@ -0,0 +1,2 @@
  1 +class NaviAction < ActiveRecord::Base
  2 +end
9 app/models/rip.rb
... ... @@ -0,0 +1,9 @@
  1 +class Rip < ActiveRecord::Base
  2 +
  3 + has_many :navi_actions
  4 + has_many :bits
  5 +
  6 + validates_uniqueness_of :name
  7 + validates_format_of :start_page, :with => /^http:\/\/.+/
  8 +
  9 +end
39 config/boot.rb
... ... @@ -0,0 +1,39 @@
  1 +# Don't change this file. Configuration is done in config/environment.rb and config/environments/*.rb
  2 +
  3 +RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
  4 +
  5 +unless defined?(Rails::Initializer)
  6 + if File.directory?("#{RAILS_ROOT}/vendor/rails")
  7 + require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
  8 + else
  9 + require 'rubygems'
  10 +
  11 + rails_gem_version =
  12 + if defined? RAILS_GEM_VERSION
  13 + RAILS_GEM_VERSION
  14 + else
  15 + File.read("#{File.dirname(__FILE__)}/environment.rb") =~ /^[^#]*RAILS_GEM_VERSION\s+=\s+'([\d.]+)'/
  16 + $1
  17 + end
  18 +
  19 + if rails_gem_version
  20 + rails_gem = Gem.cache.search('rails', "=#{rails_gem_version}.0").sort_by { |g| g.version.version }.last
  21 +
  22 + if rails_gem
  23 + gem "rails", "=#{rails_gem.version.version}"
  24 + require rails_gem.full_gem_path + '/lib/initializer'
  25 + else
  26 + STDERR.puts %(Cannot find gem for Rails =#{rails_gem_version}.0:
  27 + Install the missing gem with 'gem install -v=#{rails_gem_version} rails', or
  28 + change environment.rb to define RAILS_GEM_VERSION with your desired version.
  29 + )
  30 + exit 1
  31 + end
  32 + else
  33 + gem "rails"
  34 + require 'initializer'
  35 + end
  36 + end
  37 +
  38 + Rails::Initializer.run(:set_load_path)
  39 +end
62 config/environment.rb
... ... @@ -0,0 +1,62 @@
  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.6' 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}/app/models/scrubyt )
  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 + # Add new inflection rules using the following format
  45 + # (all these examples are active by default):
  46 + # Inflector.inflections do |inflect|
  47 + # inflect.plural /^(ox)$/i, '\1en'
  48 + # inflect.singular /^(ox)en/i, '\1'
  49 + # inflect.irregular 'person', 'people'
  50 + # inflect.uncountable %w( fish sheep )
  51 + # end
  52 +
  53 + # See Rails::Configuration for more options
  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
  61 +gem "RubyInline", "= 3.6.3"
  62 +require 'scrubyt'
21 config/environments/development.rb
... ... @@ -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
18 config/environments/production.rb
... ... @@ -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
19 config/environments/test.rb
... ... @@ -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
10 config/initializers/inflections.rb
... ... @@ -0,0 +1,10 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Add new inflection rules using the following format
  4 +# (all these examples are active by default):
  5 +# ActiveSupport::Inflector.inflections do |inflect|
  6 +# inflect.plural /^(ox)$/i, '\1en'
  7 +# inflect.singular /^(ox)en/i, '\1'
  8 +# inflect.irregular 'person', 'people'
  9 +# inflect.uncountable %w( fish sheep )
  10 +# end
5 config/initializers/mime_types.rb
... ... @@ -0,0 +1,5 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +
  3 +# Add new mime types for use in respond_to blocks:
  4 +# Mime::Type.register "text/richtext", :rtf
  5 +# Mime::Type.register_alias "text/html", :iphone
17 config/initializers/new_rails_defaults.rb
... ... @@ -0,0 +1,17 @@
  1 +# These settings change the behavior of Rails 2 apps and will be defaults
  2 +# for Rails 3. You can remove this initializer when Rails 3 is released.
  3 +
  4 +if defined?(ActiveRecord)
  5 + # Include Active Record class name as root for JSON serialized output.
  6 + ActiveRecord::Base.include_root_in_json = true
  7 +
  8 + # Store the full class name (including module namespace) in STI type column.
  9 + ActiveRecord::Base.store_full_sti_class = true
  10 +end
  11 +
  12 +# Use ISO 8601 format for JSON serialized times and dates.
  13 +ActiveSupport.use_standard_json_time_format = true
  14 +
  15 +# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
  16 +# if you're including raw json in an HTML page.
  17 +ActiveSupport.escape_html_entities_in_json = false
23 config/routes.rb
... ... @@ -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
38 db/migrate/001_initial_setup.rb
... ... @@ -0,0 +1,38 @@
  1 +class InitialSetup < ActiveRecord::Migration
  2 + def self.up
  3 + create_table :rips do |t|
  4 + t.column :name, :string, :null => false
  5 + t.column :description, :text
  6 + t.column :start_page, :string, :null => false
  7 + end
  8 +
  9 + create_table :bits do |t|
  10 + t.column :label, :string
  11 + t.column :xpath, :string, :null => false
  12 + t.column :generalize, :boolean, :default => true
  13 + t.column :id_rip, :int, :null => false
  14 + t.column :position, :int
  15 + end
  16 +
  17 + create_table :navi_actions do |t|
  18 + t.column :type, :string
  19 + t.column :id_rip, :int, :null => false
  20 + t.column :position, :int
  21 + t.column :link_text, :string
  22 + end
  23 +
  24 + create_table :form_fields do |t|
  25 + t.column :type, :string, :null => false
  26 + t.column :name, :string, :null => false
  27 + t.column :value, :string
  28 + t.column :navi_action_id, :int, :null => false
  29 + end
  30 + end
  31 +
  32 + def self.down
  33 + drop_table :form_fields
  34 + drop_table :navi_actions
  35 + drop_table :bits
  36 + drop_table :rips
  37 + end
  38 +end
2  doc/README_FOR_APP
... ... @@ -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.
40 public/.htaccess
... ... @@ -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"
30 public/404.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>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>
30 public/422.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>The change you wanted was rejected (422)</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/422.html -->
  25 + <div class="dialog">
  26 + <h1>The change you wanted was rejected.</h1>
  27 + <p>Maybe you tried to change something you didn't have access to.</p>
  28 + </div>
  29 +</body>
  30 +</html>
30 public/500.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>
10 public/dispatch.cgi
... ... @@ -0,0 +1,10 @@
  1 +#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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
24 public/dispatch.fcgi
... ... @@ -0,0 +1,24 @@
  1 +#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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!
10 public/dispatch.rb
... ... @@ -0,0 +1,10 @@
  1 +#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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
BIN  public/favicon.ico
Binary file not shown
BIN  public/images/rails.png
288 public/index.html
... ... @@ -0,0 +1,288 @@
  1 +<html>
  2 + <head>
  3 + <title>Aptana RadRails</title>
  4 + <style>
  5 + html {
  6 + height: 95%;
  7 + width: 99%;
  8 + padding: 0;
  9 + margin: 0;
  10 + }
  11 +
  12 + body {
  13 + font: 10pt verdana;
  14 + font-family: verdana;
  15 + height: 100%;
  16 + padding: 0;
  17 + margin: 0;
  18 + }
  19 +
  20 + #contents {
  21 + width: 100%;
  22 + height: 95%;
  23 + }
  24 +
  25 + #editOrSave {
  26 + width: 100%;
  27 + }
  28 +
  29 + .readonly {
  30 + font: 8pt verdana;
  31 + background-color: #f0f0ff;
  32 + border: none;
  33 + padding: 8px;
  34 + }
  35 +
  36 + td {
  37 + font: 10pt verdana;
  38 + font-family: verdana;
  39 + height: 100%;
  40 + padding: 10px;
  41 + margin: 0;
  42 + }
  43 +
  44 + .note {
  45 + padding: 10px;
  46 + border: 1px solid #CCCCCC;
  47 + }
  48 +
  49 + h2 {
  50 + width: 100%;
  51 + background-color: #b43530;
  52 + color: #FFFFFF;
  53 + padding: 20px;
  54 + }
  55 +
  56 + pre {
  57 + font-size: 80%;
  58 + padding: 10px;
  59 + border: 1px solid #EEEEEE;
  60 + }
  61 +
  62 + #search {
  63 + margin: 0;
  64 + padding-top: 10px;
  65 + padding-bottom: 10px;
  66 + font-size: 11px;
  67 + }
  68 +
  69 + #search input {
  70 + font-size: 11px;
  71 + margin: 2px;
  72 + }
  73 +
  74 + #search-text {
  75 + width: 170px
  76 + }
  77 +
  78 + #sidebar {
  79 + border-left: 1px solid #DDDDDD;
  80 + }
  81 +
  82 + #sidebar ul {
  83 + margin-left: 0;
  84 + padding-left: 0;
  85 + }
  86 +
  87 + #sidebar ul h3 {
  88 + margin-top: 25px;
  89 + font-size: 16px;
  90 + padding-bottom: 10px;
  91 + border-bottom: 1px solid #ccc;
  92 + }
  93 +
  94 + #sidebar li {
  95 + list-style-type: none;
  96 + }
  97 +
  98 + #sidebar ul.links li {
  99 + margin-bottom: 5px;
  100 + }
  101 + </style>
  102 + <script type="text/javascript" src="javascripts/prototype.js">
  103 + </script>
  104 + <script type="text/javascript" src="javascripts/effects.js">
  105 + </script>
  106 + <script type="text/javascript">
  107 + function about(){
  108 + if (Element.empty('about-content')) {
  109 + new Ajax.Updater('about-content', 'rails/info/properties', {
  110 + method: 'get',
  111 + onFailure: function(){
  112 + Element.classNames('about-content').add('failure')
  113 + },
  114 + onComplete: function(){
  115 + new Effect.BlindDown('about-content', {
  116 + duration: 0.25
  117 + })
  118 + }
  119 + });
  120 + }
  121 + else {
  122 + new Effect[Element.visible('about-content') ? 'BlindUp' : 'BlindDown']('about-content', {
  123 + duration: 0.25
  124 + });
  125 + }
  126 + }
  127 +
  128 + window.onload = function(){
  129 + $('search-text').value = '';
  130 + $('search').onsubmit = function(){
  131 + $('search-text').value = 'site:rubyonrails.org ' + $F('search-text');
  132 + }
  133 + }
  134 + </script>
  135 + </head>
  136 + <body>
  137 + <h2>Welcome to Aptana RadRails</h2>
  138 + <table cellpadding="10">
  139 + <tr>
  140 + <td colspan="2">
  141 + <p>
  142 + <img src="images/rails.png" align="left" style="padding-right:10px">Aptana RadRails provides a rich and powerful user interface for creating Ruby on Rails applications. You can create projects,
  143 + edit them with ease, and debug them with a variety of tools. RadRails ships with an embedded jRuby interpreter ready to go,
  144 + or you can configure it to use an external Rails installation.
  145 + </p>
  146 + </td>
  147 + </tr>
  148 + <tr>
  149 + <td valign="top">
  150 + <h3>Getting Started</h3>
  151 + <p>
  152 + Below is a short introduction to using the functionality of Aptana RadRails.
  153 + <div id="about">
  154 + <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
  155 + <div id="about-content" style="display: none">
  156 + </div>
  157 + </div>
  158 + </p>
  159 + <h4>Creating a simple application</h4>
  160 + <p>
  161 + <ol>
  162 + <li>
  163 + Make sure this project is selected in the Ruby Explorer view, and select the <b>Generators</b>
  164 + view at the bottom of the screen.
  165 + </li>
  166 + <li>
  167 + Select <b>scaffold</b>
  168 + from the dropdown, and paste in the following:<pre>
  169 +recipe title:string author:string description:text
  170 +</pre>
  171 + </li>
  172 + <li>
  173 + Press <b>Go</b>. Rails will create a complete skeleton application including form entry fields and a database schema based on the above information.
  174 + </li>
  175 + <li>
  176 + Once it has finished writing information to the console, go to the </b>Rake Tasks</b>
  177 + view and choose <b>db:migrate</b>. Press <b>Go</b>.
  178 + </li>
  179 + <li>
  180 + This populates the database with an empty recipe table.
  181 + </li>
  182 + <li>
  183 + Once that has finished, click <a href="/recipes">here</a>
  184 + (note the url it created) to start populating data. Enter a few records.
  185 + </li>
  186 + <li>
  187 + If you lose this tab, you can re-launch your application from the <b>Run</b>
  188 + button in the top toolbar. Click on the arrow to the right-hand side of the button to launch the web browser again.
  189 + </li>
  190 + </ol>
  191 + </p>
  192 + <h4>Viewing your data</h4>
  193 + <p>
  194 + Go to to Window > Open Perspective > Data. Make sure the Data Navigator view is selected. You can expand out the data navigator tree for your project and view the data in the tables.
  195 + </p>
  196 + <h4>Viewing your server</h4>
  197 + <p>
  198 + Click on the <b>Servers</b>
  199 + view in order to stop and restart your internal Rails server.
  200 + </p>
  201 + <h4>Customizing your Application</h4>
  202 + <p>
  203 + You can begin editing the files under app/views to edit the template pages of your application. For further customization options and more advanced topics, see the RadRails documentation.
  204 + Key file locations:
  205 + <ol>
  206 + <li>
  207 + <b>/config/database.yml</b>: your database configuration
  208 + </li>
  209 + <li>
  210 + <b>/db/schema.db</b>: your database schema
  211 + </li>
  212 + <li>
  213 + <b>/public</b>: the root of your web site (including the location of this file)
  214 + </li>
  215 + </ol>
  216 + </p>
  217 + </td>
  218 + <td valign="top" id="sidebar">
  219 + <h3>Exploring Rails</h3>
  220 + <li>
  221 + <form id="search" action="http://www.google.com/search" method="get">
  222 + <input type="hidden" name="hl" value="en" /><input type="text" id="search-text" name="q" value="site:rubyonrails.org " /><input type="submit" value="Search" />the Rails site
  223 + </form>
  224 + </li>
  225 + <li>
  226 + <h3>RadRails Community</h3>
  227 + <ul class="links">
  228 + <li>
  229 + <a href="http://www.aptana.org/rails">RadRails home</a>
  230 + </li>
  231 + <li>
  232 + <a href="http://www.aptana.com/blog">Weblog</a>
  233 + </li>
  234 + <li>
  235 + <a href="http://forums.aptana.com/">Forums</a>
  236 + </li>
  237 + <li>
  238 + <a href="http://support.aptana.com/asap/">Bug tracker</a>
  239 + </li>
  240 + </ul>
  241 + </li>
  242 + <h3>Other Community Links</h3>
  243 + <ul class="links">
  244 + <li>
  245 + <a href="http://www.rubyonrails.org/">Ruby on Rails</a>
  246 + </li>
  247 + <li>
  248 + <a href="http://weblog.rubyonrails.org/">Official weblog</a>
  249 + </li>
  250 + <li>
  251 + <a href="http://lists.rubyonrails.org/">Mailing lists</a>
  252 + </li>
  253 + <li>
  254 + <a href="http://wiki.rubyonrails.org/rails/pages/IRC">IRC channel</a>
  255 + </li>
  256 + <li>
  257 + <a href="http://wiki.rubyonrails.org/">Wiki</a>
  258 + </li>
  259 + <li>
  260 + <a href="http://dev.rubyonrails.org/">Bug tracker</a>
  261 + </li>
  262 + </ul>
  263 + </li>
  264 + <li>
  265 + <h3>Browse the documentation</h3>
  266 + <ul class="links">
  267 + <li>
  268 + <b>Rails API:</b>
  269 + <br/>
  270 + Window > Show View > Rails API
  271 + </li>
  272 + <li>
  273 + <b>Ruby standard library:</b>
  274 + <br/>
  275 + Window > Show View > Ruby Standard Library API
  276 + </li>
  277 + <li>
  278 + <b>Core documentation:</b>
  279 + <br/>
  280 + Window > Show View > Ruby Core API
  281 + </li>
  282 + </ul>
  283 + </li>
  284 + </td>
  285 + </tr>
  286 + </table>
  287 + </body>
  288 +</html>
2  public/javascripts/application.js
... ... @@ -0,0 +1,2 @@
  1 +// Place your application-specific JavaScript functions and classes here
  2 +// This file is automatically included by javascript_include_tag :defaults
833 public/javascripts/controls.js
... ... @@ -0,0 +1,833 @@
  1 +// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
  2 +// (c) 2005, 2006 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
  3 +// (c) 2005, 2006 Jon Tirsen (http://www.tirsen.com)
  4 +// Contributors:
  5 +// Richard Livsey
  6 +// Rahul Bhargava
  7 +// Rob Wills
  8 +//
  9 +// script.aculo.us is freely distributable under the terms of an MIT-style license.
  10 +// For details, see the script.aculo.us web site: http://script.aculo.us/
  11 +
  12 +// Autocompleter.Base handles all the autocompletion functionality
  13 +// that's independent of the data source for autocompletion. This
  14 +// includes drawing the autocompletion menu, observing keyboard
  15 +// and mouse events, and similar.
  16 +//
  17 +// Specific autocompleters need to provide, at the very least,
  18 +// a getUpdatedChoices function that will be invoked every time
  19 +// the text inside the monitored textbox changes. This method
  20 +// should get the text for which to provide autocompletion by
  21 +// invoking this.getToken(), NOT by directly accessing
  22 +// this.element.value. This is to allow incremental tokenized
  23 +// autocompletion. Specific auto-completion logic (AJAX, etc)
  24 +// belongs in getUpdatedChoices.
  25 +//
  26 +// Tokenized incremental autocompletion is enabled automatically
  27 +// when an autocompleter is instantiated with the 'tokens' option
  28 +// in the options parameter, e.g.:
  29 +// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
  30 +// will incrementally autocomplete with a comma as the token.
  31 +// Additionally, ',' in the above example can be replaced with
  32 +// a token array, e.g. { tokens: [',', '\n'] } which
  33 +// enables autocompletion on multiple tokens. This is most
  34 +// useful when one of the tokens is \n (a newline), as it
  35 +// allows smart autocompletion after linebreaks.
  36 +
  37 +if(typeof Effect == 'undefined')
  38 + throw("controls.js requires including script.aculo.us' effects.js library");
  39 +
  40 +var Autocompleter = {}
  41 +Autocompleter.Base = function() {};
  42 +Autocompleter.Base.prototype = {
  43 + baseInitialize: function(element, update, options) {
  44 + this.element = $(element);
  45 + this.update = $(update);
  46 + this.hasFocus = false;
  47 + this.changed = false;
  48 + this.active = false;
  49 + this.index = 0;