Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Deleted old sample app

  • Loading branch information...
commit b8db7e8250eb0bb83e613f605f5512e89dbc7808 1 parent 07c8ca6
@raul authored
Showing with 0 additions and 2,974 deletions.
  1. +0 −256 SampleApp/README
  2. +0 −10 SampleApp/Rakefile
  3. +0 −17 SampleApp/app/controllers/application.rb
  4. +0 −85 SampleApp/app/controllers/users_controller.rb
  5. +0 −3  SampleApp/app/helpers/application_helper.rb
  6. +0 −2  SampleApp/app/helpers/users_helper.rb
  7. +0 −2  SampleApp/app/models/user.rb
  8. +0 −35 SampleApp/app/views/layouts/application.html.erb
  9. +0 −22 SampleApp/app/views/users/edit.html.erb
  10. +0 −22 SampleApp/app/views/users/index.html.erb
  11. +0 −21 SampleApp/app/views/users/new.html.erb
  12. +0 −13 SampleApp/app/views/users/show.html.erb
  13. +0 −109 SampleApp/config/boot.rb
  14. +0 −19 SampleApp/config/database.yml
  15. +0 −67 SampleApp/config/environment.rb
  16. +0 −17 SampleApp/config/environments/development.rb
  17. +0 −22 SampleApp/config/environments/production.rb
  18. +0 −22 SampleApp/config/environments/test.rb
  19. +0 −10 SampleApp/config/initializers/inflections.rb
  20. +0 −5 SampleApp/config/initializers/mime_types.rb
  21. +0 −15 SampleApp/config/initializers/new_rails_defaults.rb
  22. +0 −14 SampleApp/config/routes.rb
  23. +0 −3  SampleApp/config/routes_en.yml
  24. +0 −3  SampleApp/config/routes_es.yml
  25. BIN  SampleApp/db/development.sqlite3
  26. +0 −14 SampleApp/db/migrate/20080606095256_create_users.rb
  27. +0 −21 SampleApp/db/schema.rb
  28. BIN  SampleApp/db/test.sqlite3
  29. +0 −2  SampleApp/doc/README_FOR_APP
  30. +0 −14 SampleApp/lang/es.yml
  31. +0 −30 SampleApp/public/404.html
  32. +0 −30 SampleApp/public/422.html
  33. +0 −30 SampleApp/public/500.html
  34. +0 −10 SampleApp/public/dispatch.cgi
  35. +0 −24 SampleApp/public/dispatch.fcgi
  36. +0 −10 SampleApp/public/dispatch.rb
  37. +0 −54 SampleApp/public/stylesheets/scaffold.css
  38. +0 −3  SampleApp/script/about
  39. +0 −3  SampleApp/script/console
  40. +0 −3  SampleApp/script/dbconsole
  41. +0 −3  SampleApp/script/destroy
  42. +0 −3  SampleApp/script/generate
  43. +0 −3  SampleApp/script/performance/benchmarker
  44. +0 −3  SampleApp/script/performance/profiler
  45. +0 −3  SampleApp/script/performance/request
  46. +0 −3  SampleApp/script/plugin
  47. +0 −3  SampleApp/script/process/inspector
  48. +0 −3  SampleApp/script/process/reaper
  49. +0 −3  SampleApp/script/process/spawner
  50. +0 −3  SampleApp/script/runner
  51. +0 −3  SampleApp/script/server
  52. +0 −9 SampleApp/test/fixtures/users.yml
  53. +0 −45 SampleApp/test/functional/users_controller_test.rb
  54. +0 −55 SampleApp/test/test_helper.rb
  55. +0 −8 SampleApp/test/unit/user_test.rb
  56. +0 −18 SampleApp/vendor/plugins/gibberish/LICENSE
  57. +0 −118 SampleApp/vendor/plugins/gibberish/README
  58. +0 −14 SampleApp/vendor/plugins/gibberish/Rakefile
  59. +0 −3  SampleApp/vendor/plugins/gibberish/init.rb
  60. +0 −3  SampleApp/vendor/plugins/gibberish/lang/es.yml
  61. +0 −3  SampleApp/vendor/plugins/gibberish/lang/fr.yml
  62. +0 −8 SampleApp/vendor/plugins/gibberish/lib/gibberish.rb
  63. +0 −88 SampleApp/vendor/plugins/gibberish/lib/gibberish/localize.rb
  64. +0 −17 SampleApp/vendor/plugins/gibberish/lib/gibberish/string_ext.rb
  65. +0 −203 SampleApp/vendor/plugins/gibberish/test/gibberish_test.rb
  66. +0 −1  SampleApp/vendor/plugins/gibberish/test/lang/es.yml
  67. +0 −1  SampleApp/vendor/plugins/gibberish/test/lang/fr.yml
  68. +0 −12 SampleApp/vendor/plugins/translate_routes/ChangeLog
  69. +0 −20 SampleApp/vendor/plugins/translate_routes/MIT-LICENSE
  70. +0 −150 SampleApp/vendor/plugins/translate_routes/README
  71. +0 −22 SampleApp/vendor/plugins/translate_routes/Rakefile
  72. 0  SampleApp/vendor/plugins/translate_routes/config/routes_en.yml
  73. +0 −1  SampleApp/vendor/plugins/translate_routes/config/routes_es.yml
  74. +0 −1  SampleApp/vendor/plugins/translate_routes/doc/created.rid
  75. +0 −351 SampleApp/vendor/plugins/translate_routes/doc/files/README.html
  76. +0 −26 SampleApp/vendor/plugins/translate_routes/doc/fr_class_index.html
  77. +0 −27 SampleApp/vendor/plugins/translate_routes/doc/fr_file_index.html
  78. +0 −26 SampleApp/vendor/plugins/translate_routes/doc/fr_method_index.html
  79. +0 −24 SampleApp/vendor/plugins/translate_routes/doc/index.html
  80. +0 −208 SampleApp/vendor/plugins/translate_routes/doc/rdoc-style.css
  81. +0 −1  SampleApp/vendor/plugins/translate_routes/init.rb
  82. +0 −1  SampleApp/vendor/plugins/translate_routes/install.rb
  83. +0 −170 SampleApp/vendor/plugins/translate_routes/lib/translate_routes.rb
  84. +0 −42 SampleApp/vendor/plugins/translate_routes/tasks/translate_routes_tasks.rake
  85. +0 −222 SampleApp/vendor/plugins/translate_routes/test/translate_routes_test.rb
  86. +0 −1  SampleApp/vendor/plugins/translate_routes/uninstall.rb
View
256 SampleApp/README
@@ -1,256 +0,0 @@
-== Welcome to Rails
-
-Rails is a web-application framework that includes everything needed to create
-database-backed web applications according to the Model-View-Control pattern.
-
-This pattern splits the view (also called the presentation) into "dumb" templates
-that are primarily responsible for inserting pre-built data in between HTML tags.
-The model contains the "smart" domain objects (such as Account, Product, Person,
-Post) that holds all the business logic and knows how to persist themselves to
-a database. The controller handles the incoming requests (such as Save New Account,
-Update Product, Show Post) by manipulating the model and directing data to the view.
-
-In Rails, the model is handled by what's called an object-relational mapping
-layer entitled Active Record. This layer allows you to present the data from
-database rows as objects and embellish these data objects with business logic
-methods. You can read more about Active Record in
-link:files/vendor/rails/activerecord/README.html.
-
-The controller and view are handled by the Action Pack, which handles both
-layers by its two parts: Action View and Action Controller. These two layers
-are bundled in a single package due to their heavy interdependence. This is
-unlike the relationship between the Active Record and Action Pack that is much
-more separate. Each of these packages can be used independently outside of
-Rails. You can read more about Action Pack in
-link:files/vendor/rails/actionpack/README.html.
-
-
-== Getting Started
-
-1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
- and your application name. Ex: rails myapp
-2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
-3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
-4. Follow the guidelines to start developing your application
-
-
-== Web Servers
-
-By default, Rails will try to use Mongrel and lighttpd if they are installed, otherwise
-Rails will use WEBrick, the webserver that ships with Ruby. When you run script/server,
-Rails will check if Mongrel exists, then lighttpd and finally fall back to WEBrick. This ensures
-that you can always get up and running quickly.
-
-Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
-suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
-getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
-More info at: http://mongrel.rubyforge.org
-
-If Mongrel is not installed, Rails will look for lighttpd. It's considerably faster than
-Mongrel and WEBrick and also suited for production use, but requires additional
-installation and currently only works well on OS X/Unix (Windows users are encouraged
-to start with Mongrel). We recommend version 1.4.11 and higher. You can download it from
-http://www.lighttpd.net.
-
-And finally, if neither Mongrel or lighttpd are installed, Rails will use the built-in Ruby
-web server, WEBrick. WEBrick is a small Ruby web server suitable for development, but not
-for production.
-
-But of course its also possible to run Rails on any platform that supports FCGI.
-Apache, LiteSpeed, IIS are just a few. For more information on FCGI,
-please visit: http://wiki.rubyonrails.com/rails/pages/FastCGI
-
-
-== Apache .htaccess example
-
-# General Apache options
-AddHandler fastcgi-script .fcgi
-AddHandler cgi-script .cgi
-Options +FollowSymLinks +ExecCGI
-
-# If you don't want Rails to look in certain directories,
-# use the following rewrite rules so that Apache won't rewrite certain requests
-#
-# Example:
-# RewriteCond %{REQUEST_URI} ^/notrails.*
-# RewriteRule .* - [L]
-
-# Redirect all requests not available on the filesystem to Rails
-# By default the cgi dispatcher is used which is very slow
-#
-# For better performance replace the dispatcher with the fastcgi one
-#
-# Example:
-# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
-RewriteEngine On
-
-# If your Rails application is accessed via an Alias directive,
-# then you MUST also set the RewriteBase in this htaccess file.
-#
-# Example:
-# Alias /myrailsapp /path/to/myrailsapp/public
-# RewriteBase /myrailsapp
-
-RewriteRule ^$ index.html [QSA]
-RewriteRule ^([^.]+)$ $1.html [QSA]
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
-
-# In case Rails experiences terminal errors
-# Instead of displaying this message you can supply a file here which will be rendered instead
-#
-# Example:
-# ErrorDocument 500 /500.html
-
-ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
-
-
-== Debugging Rails
-
-Sometimes your application goes wrong. Fortunately there are a lot of tools that
-will help you debug it and get it back on the rails.
-
-First area to check is the application log files. Have "tail -f" commands running
-on the server.log and development.log. Rails will automatically display debugging
-and runtime information to these files. Debugging info will also be shown in the
-browser on requests from 127.0.0.1.
-
-You can also log your own messages directly into the log file from your code using
-the Ruby logger class from inside your controllers. Example:
-
- class WeblogController < ActionController::Base
- def destroy
- @weblog = Weblog.find(params[:id])
- @weblog.destroy
- logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
- end
- end
-
-The result will be a message in your log file along the lines of:
-
- Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
-
-More information on how to use the logger is at http://www.ruby-doc.org/core/
-
-Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
-
-* The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
-* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
-
-These two online (and free) books will bring you up to speed on the Ruby language
-and also on programming in general.
-
-
-== Debugger
-
-Debugger support is available through the debugger command when you start your Mongrel or
-Webrick server with --debugger. This means that you can break out of execution at any point
-in the code, investigate and change the model, AND then resume execution!
-You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
-Example:
-
- class WeblogController < ActionController::Base
- def index
- @posts = Post.find(:all)
- debugger
- end
- end
-
-So the controller will accept the action, run the first line, then present you
-with a IRB prompt in the server window. Here you can do things like:
-
- >> @posts.inspect
- => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
- #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
- >> @posts.first.title = "hello from a debugger"
- => "hello from a debugger"
-
-...and even better is that you can examine how your runtime objects actually work:
-
- >> f = @posts.first
- => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
- >> f.
- Display all 152 possibilities? (y or n)
-
-Finally, when you're ready to resume execution, you enter "cont"
-
-
-== Console
-
-You can interact with the domain model by starting the console through <tt>script/console</tt>.
-Here you'll have all parts of the application configured, just like it is when the
-application is running. You can inspect domain models, change values, and save to the
-database. Starting the script without arguments will launch it in the development environment.
-Passing an argument will specify a different environment, like <tt>script/console production</tt>.
-
-To reload your controllers and models after launching the console run <tt>reload!</tt>
-
-== dbconsole
-
-You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
-You would be connected to the database with the credentials defined in database.yml.
-Starting the script without arguments will connect you to the development database. Passing an
-argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
-Currently works for mysql, postgresql and sqlite.
-
-== Description of Contents
-
-app
- Holds all the code that's specific to this particular application.
-
-app/controllers
- Holds controllers that should be named like weblogs_controller.rb for
- automated URL mapping. All controllers should descend from ApplicationController
- which itself descends from ActionController::Base.
-
-app/models
- Holds models that should be named like post.rb.
- Most models will descend from ActiveRecord::Base.
-
-app/views
- Holds the template files for the view that should be named like
- weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
- syntax.
-
-app/views/layouts
- Holds the template files for layouts to be used with views. This models the common
- header/footer method of wrapping views. In your views, define a layout using the
- <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
- call <% yield %> to render the view using this layout.
-
-app/helpers
- Holds view helpers that should be named like weblogs_helper.rb. These are generated
- for you automatically when using script/generate for controllers. Helpers can be used to
- wrap functionality for your views into methods.
-
-config
- Configuration files for the Rails environment, the routing map, the database, and other dependencies.
-
-db
- Contains the database schema in schema.rb. db/migrate contains all
- the sequence of Migrations for your schema.
-
-doc
- This directory is where your application documentation will be stored when generated
- using <tt>rake doc:app</tt>
-
-lib
- Application specific libraries. Basically, any kind of custom code that doesn't
- belong under controllers, models, or helpers. This directory is in the load path.
-
-public
- The directory available for the web server. Contains subdirectories for images, stylesheets,
- and javascripts. Also contains the dispatchers and the default HTML files. This should be
- set as the DOCUMENT_ROOT of your web server.
-
-script
- Helper scripts for automation and generation.
-
-test
- Unit and functional tests along with fixtures. When using the script/generate scripts, template
- test files will be generated for you and placed in this directory.
-
-vendor
- External libraries that the application depends on. Also includes the plugins subdirectory.
- If the app has frozen rails, those gems also go here, under vendor/rails/.
- This directory is in the load path.
View
10 SampleApp/Rakefile
@@ -1,10 +0,0 @@
-# Add your own tasks in files placed in lib/tasks ending in .rake,
-# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
-
-require(File.join(File.dirname(__FILE__), 'config', 'boot'))
-
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-require 'tasks/rails'
View
17 SampleApp/app/controllers/application.rb
@@ -1,17 +0,0 @@
-# Filters added to this controller apply to all controllers in the application.
-# Likewise, all the methods added will be available for all controllers.
-
-class ApplicationController < ActionController::Base
-
- before_filter :set_language
-
- private
-
- def set_language
- @lang = params[ActionController::Routing::Translator.lang_param_key] || ActionController::Routing::Translator.default_lang
- default_url_options ActionController::Routing::Translator => @lang
-
- Gibberish.current_language = @lang.to_sym # If you use the Gibberish plugin to translate strings
- end
-
-end
View
85 SampleApp/app/controllers/users_controller.rb
@@ -1,85 +0,0 @@
-class UsersController < ApplicationController
- # GET /users
- # GET /users.xml
- def index
- @users = User.find(:all)
-
- respond_to do |format|
- format.html # index.html.erb
- format.xml { render :xml => @users }
- end
- end
-
- # GET /users/1
- # GET /users/1.xml
- def show
- @user = User.find(params[:id])
-
- respond_to do |format|
- format.html # show.html.erb
- format.xml { render :xml => @user }
- end
- end
-
- # GET /users/new
- # GET /users/new.xml
- def new
- @user = User.new
-
- respond_to do |format|
- format.html # new.html.erb
- format.xml { render :xml => @user }
- end
- end
-
- # GET /users/1/edit
- def edit
- @user = User.find(params[:id])
- end
-
- # POST /users
- # POST /users.xml
- def create
- @user = User.new(params[:user])
-
- respond_to do |format|
- if @user.save
- flash[:notice] = 'User was successfully created.'[:User_was_successfully_created]
- format.html { redirect_to(@user) }
- format.xml { render :xml => @user, :status => :created, :location => @user }
- else
- format.html { render :action => "new" }
- format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # PUT /users/1
- # PUT /users/1.xml
- def update
- @user = User.find(params[:id])
-
- respond_to do |format|
- if @user.update_attributes(params[:user])
- flash[:notice] = 'User was successfully updated.'[:User_was_successfully_updated]
- format.html { redirect_to(@user) }
- format.xml { head :ok }
- else
- format.html { render :action => "edit" }
- format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
- end
- end
- end
-
- # DELETE /users/1
- # DELETE /users/1.xml
- def destroy
- @user = User.find(params[:id])
- @user.destroy
-
- respond_to do |format|
- format.html { redirect_to(users_url) }
- format.xml { head :ok }
- end
- end
-end
View
3  SampleApp/app/helpers/application_helper.rb
@@ -1,3 +0,0 @@
-# Methods added to this helper will be available to all templates in the application.
-module ApplicationHelper
-end
View
2  SampleApp/app/helpers/users_helper.rb
@@ -1,2 +0,0 @@
-module UsersHelper
-end
View
2  SampleApp/app/models/user.rb
@@ -1,2 +0,0 @@
-class User < ActiveRecord::Base
-end
View
35 SampleApp/app/views/layouts/application.html.erb
@@ -1,35 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
- <title>Sample translate routes application</title>
- <%= stylesheet_link_tag 'scaffold' %>
-</head>
-<body>
-<p>
- This is a sample application to show how easily you can integrate the translate routes plugin to your Rails applications.
- The key points are located on:</p>
- <ul>
- <li><strong>/config/routes.rb</strong>: you can see how to add translation to your defined routes</li>
- <li><strong>/app/controllers/application.rb</strong>: it shows an example of how to set the language from the URL. You could also set the language from current user profiles, etc.</li>
- <li><strong>/app/views/layouts/application.html.erb</strong>: here you can see some routing helpers in action:
- <ul>
- <li><%= link_to 'a link based on the current language', users_path %></li>
- <li><%= link_to 'a link to an english URL', users_en_path %></li>
- <li><%= link_to 'a link to an spanish URL', users_es_path %></li>
- </ul>
- </li>
- <li><strong>/test/test_helper.rb</strong>: includes some code to include a default language parameter to your functional and integration tests</li>
- </ul>
-<p>The application is a simple users CRUD and includes the gibberish plugin to translate all the user interface strings.</p>
-
-<p style="color: green"><%= flash[:notice] %></p>
-
-<%= @lang == 'es' ? link_to('English version', :lang => 'en') : link_to('Spanish version', :lang => 'es') %>
-
-<%= yield %>
-
-</body>
-</html>
View
22 SampleApp/app/views/users/edit.html.erb
@@ -1,22 +0,0 @@
-<h1><%= 'Editing user'[:Editing_user] %></h1>
-
-<% form_for(@user) do |f| %>
- <%= f.error_messages %>
-
- <p>
- <%= 'Name'[:Name] %>
- <br />
- <%= f.text_field :name %>
- </p>
- <p>
- <%= 'Last Name'[:Last_Name] %>
- <br />
- <%= f.text_field :last_name %>
- </p>
- <p>
- <%= f.submit "Update"[:Update] %>
- </p>
-<% end %>
-
-<%= link_to 'Show'[:Show], @user %> |
-<%= link_to 'Back'[:Back], users_path %>
View
22 SampleApp/app/views/users/index.html.erb
@@ -1,22 +0,0 @@
-<h1><%= 'Listing users'[:Listing_users] %></h1>
-
-<table>
- <tr>
- <th><%= 'Name'[:Name] %></th>
- <th><%= 'Last Name'[:Last_Name] %></th>
- </tr>
-
-<% for user in @users %>
- <tr>
- <td><%=h user.name %></td>
- <td><%=h user.last_name %></td>
- <td><%= link_to 'Show'[:Show], user %></td>
- <td><%= link_to 'Edit'[:Edit], edit_user_path(user) %></td>
- <td><%= link_to 'Destroy'[:Destroy], user, :confirm => 'Are you sure?'[:Are_you_sure], :method => :delete %></td>
- </tr>
-<% end %>
-</table>
-
-<br />
-
-<%= link_to 'New user'[:New_user], new_user_path %>
View
21 SampleApp/app/views/users/new.html.erb
@@ -1,21 +0,0 @@
-<h1><%= 'New user'[:New_user] %></h1>
-
-<% form_for(@user) do |f| %>
- <%= f.error_messages %>
-
- <p>
- <%= 'Name'[:Name] %>
- <br />
- <%= f.text_field :name %>
- </p>
- <p>
- <%= 'Last Name'[:Last_Name] %>
- <br />
- <%= f.text_field :last_name %>
- </p>
- <p>
- <%= f.submit "Create"[:Create] %>
- </p>
-<% end %>
-
-<%= link_to 'Back'[:Back], users_path %>
View
13 SampleApp/app/views/users/show.html.erb
@@ -1,13 +0,0 @@
-<p>
- <b><%= 'Name'[:Name] %></b>
- <%=h @user.name %>
-</p>
-
-<p>
- <b><%= 'Last Name'[:Last_Name] %></b>
- <%=h @user.last_name %>
-</p>
-
-
-<%= link_to 'Edit'[:Edit], edit_user_path(@user) %> |
-<%= link_to 'Back'[:Back], users_path %>
View
109 SampleApp/config/boot.rb
@@ -1,109 +0,0 @@
-# Don't change this file!
-# Configure your app in config/environment.rb and config/environments/*.rb
-
-RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
-
-module Rails
- class << self
- def boot!
- unless booted?
- preinitialize
- pick_boot.run
- end
- end
-
- def booted?
- defined? Rails::Initializer
- end
-
- def pick_boot
- (vendor_rails? ? VendorBoot : GemBoot).new
- end
-
- def vendor_rails?
- File.exist?("#{RAILS_ROOT}/vendor/rails")
- end
-
- def preinitialize
- load(preinitializer_path) if File.exist?(preinitializer_path)
- end
-
- def preinitializer_path
- "#{RAILS_ROOT}/config/preinitializer.rb"
- end
- end
-
- class Boot
- def run
- load_initializer
- Rails::Initializer.run(:set_load_path)
- end
- end
-
- class VendorBoot < Boot
- def load_initializer
- require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
- Rails::Initializer.run(:install_gem_spec_stubs)
- end
- end
-
- class GemBoot < Boot
- def load_initializer
- self.class.load_rubygems
- load_rails_gem
- require 'initializer'
- end
-
- def load_rails_gem
- if version = self.class.gem_version
- gem 'rails', version
- else
- gem 'rails'
- end
- rescue Gem::LoadError => load_error
- $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.)
- exit 1
- end
-
- class << self
- def rubygems_version
- Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
- end
-
- def gem_version
- if defined? RAILS_GEM_VERSION
- RAILS_GEM_VERSION
- elsif ENV.include?('RAILS_GEM_VERSION')
- ENV['RAILS_GEM_VERSION']
- else
- parse_gem_version(read_environment_rb)
- end
- end
-
- def load_rubygems
- require 'rubygems'
-
- unless rubygems_version >= '0.9.4'
- $stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
- exit 1
- end
-
- rescue LoadError
- $stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
- exit 1
- end
-
- def parse_gem_version(text)
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
- end
-
- private
- def read_environment_rb
- File.read("#{RAILS_ROOT}/config/environment.rb")
- end
- end
- end
-end
-
-# All that for this:
-Rails.boot!
View
19 SampleApp/config/database.yml
@@ -1,19 +0,0 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- timeout: 5000
View
67 SampleApp/config/environment.rb
@@ -1,67 +0,0 @@
-# Be sure to restart your server when you modify this file
-
-# Uncomment below to force Rails into production mode when
-# you don't control web/app server and can't set it the proper way
-# ENV['RAILS_ENV'] ||= 'production'
-
-# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
-
-# Bootstrap the Rails environment, frameworks, and default configuration
-require File.join(File.dirname(__FILE__), 'boot')
-
-Rails::Initializer.run do |config|
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
- # See Rails::Configuration for more options.
-
- # Skip frameworks you're not going to use. To use Rails without a database
- # you must remove the Active Record framework.
- # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
-
- # Specify gems that this application depends on.
- # They can then be installed with "rake gems:install" on new installations.
- # config.gem "bj"
- # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
- # config.gem "aws-s3", :lib => "aws/s3"
-
- # Only load the plugins named here, in the order given. By default, all plugins
- # in vendor/plugins are loaded in alphabetical order.
- # :all can be used as a placeholder for all plugins not explicitly named
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # Add additional load paths for your own custom dirs
- # config.load_paths += %W( #{RAILS_ROOT}/extras )
-
- # Force all environments to use the same logger level
- # (by default production uses :info, the others :debug)
- # config.log_level = :debug
-
- # Make Time.zone default to the specified zone, and make Active Record store time values
- # in the database in UTC, and return them converted to the specified local zone.
- # Run "rake -D time" for a list of tasks for finding time zone names. Uncomment to use default local time.
- config.time_zone = 'UTC'
-
- # Your secret key for verifying cookie session data integrity.
- # If you change this key, all old sessions will become invalid!
- # Make sure the secret is at least 30 characters and all random,
- # no regular words or you'll be exposed to dictionary attacks.
- config.action_controller.session = {
- :session_key => '_sample_session',
- :secret => 'd04eb7b652bc627b96fe6dd5c02fe98ab5ebeb62990a76df18c9411a92f342d36f6ad1f969c77b756acff1b25167cf90c2cabf42958d041790bad01fd44e9558'
- }
-
- # Use the database for sessions instead of the cookie-based default,
- # which shouldn't be used to store highly confidential information
- # (create the session table with "rake db:sessions:create")
- # config.action_controller.session_store = :active_record_store
-
- # Use SQL instead of Active Record's schema dumper when creating the test database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
-
- # Activate observers that should always be running
- # config.active_record.observers = :cacher, :garbage_collector
-end
View
17 SampleApp/config/environments/development.rb
@@ -1,17 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# In the development environment your application's code is reloaded on
-# every request. This slows down response time but is perfect for development
-# since you don't have to restart the webserver when you make code changes.
-config.cache_classes = false
-
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
-
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_view.debug_rjs = true
-config.action_controller.perform_caching = false
-
-# Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
View
22 SampleApp/config/environments/production.rb
@@ -1,22 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# The production environment is meant for finished, "live" apps.
-# Code is not reloaded between requests
-config.cache_classes = true
-
-# Use a different logger for distributed setups
-# config.logger = SyslogLogger.new
-
-# Full error reports are disabled and caching is turned on
-config.action_controller.consider_all_requests_local = false
-config.action_controller.perform_caching = true
-config.action_view.cache_template_loading = true
-
-# Use a different cache store in production
-# config.cache_store = :mem_cache_store
-
-# Enable serving of images, stylesheets, and javascripts from an asset server
-# config.action_controller.asset_host = "http://assets.example.com"
-
-# Disable delivery errors, bad email addresses will be ignored
-# config.action_mailer.raise_delivery_errors = false
View
22 SampleApp/config/environments/test.rb
@@ -1,22 +0,0 @@
-# Settings specified here will take precedence over those in config/environment.rb
-
-# The test environment is used exclusively to run your application's
-# test suite. You never need to work with it otherwise. Remember that
-# your test database is "scratch space" for the test suite and is wiped
-# and recreated between test runs. Don't rely on the data there!
-config.cache_classes = true
-
-# Log error messages when you accidentally call methods on nil.
-config.whiny_nils = true
-
-# Show full error reports and disable caching
-config.action_controller.consider_all_requests_local = true
-config.action_controller.perform_caching = false
-
-# Disable request forgery protection in test environment
-config.action_controller.allow_forgery_protection = false
-
-# Tell Action Mailer not to deliver emails to the real world.
-# The :test delivery method accumulates sent emails in the
-# ActionMailer::Base.deliveries array.
-config.action_mailer.delivery_method = :test
View
10 SampleApp/config/initializers/inflections.rb
@@ -1,10 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# Inflector.inflections do |inflect|
-# inflect.plural /^(ox)$/i, '\1en'
-# inflect.singular /^(ox)en/i, '\1'
-# inflect.irregular 'person', 'people'
-# inflect.uncountable %w( fish sheep )
-# end
View
5 SampleApp/config/initializers/mime_types.rb
@@ -1,5 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# Add new mime types for use in respond_to blocks:
-# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
View
15 SampleApp/config/initializers/new_rails_defaults.rb
@@ -1,15 +0,0 @@
-# These settings change the behavior of Rails 2 apps and will be defaults
-# for Rails 3. You can remove this initializer when Rails 3 is released.
-
-# Include Active Record class name as root for JSON serialized output.
-ActiveRecord::Base.include_root_in_json = true
-
-# Store the full class name (including module namespace) in STI type column.
-ActiveRecord::Base.store_full_sti_class = true
-
-# Use ISO 8601 format for JSON serialized times and dates.
-ActiveSupport.use_standard_json_time_format = true
-
-# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
-# if you're including raw json in an HTML page.
-ActiveSupport.escape_html_entities_in_json = false
View
14 SampleApp/config/routes.rb
@@ -1,14 +0,0 @@
-ActionController::Routing::Routes.draw do |map|
-
- map.resources :users
-
- # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
- map.root :controller => 'users', :action => 'index'
-
- # See how all your routes lay out with "rake routes"
-
- # Install the default routes as the lowest priority.
- map.connect ':controller/:action/:id'
- map.connect ':controller/:action/:id.:format'
-end
-ActionController::Routing::Translator.translate_from_files
View
3  SampleApp/config/routes_en.yml
@@ -1,3 +0,0 @@
-edit:
-new:
-users:
View
3  SampleApp/config/routes_es.yml
@@ -1,3 +0,0 @@
-edit: editar
-new: crear
-users: usuarios
View
BIN  SampleApp/db/development.sqlite3
Binary file not shown
View
14 SampleApp/db/migrate/20080606095256_create_users.rb
@@ -1,14 +0,0 @@
-class CreateUsers < ActiveRecord::Migration
- def self.up
- create_table :users do |t|
- t.string :name
- t.string :last_name
-
- t.timestamps
- end
- end
-
- def self.down
- drop_table :users
- end
-end
View
21 SampleApp/db/schema.rb
@@ -1,21 +0,0 @@
-# This file is auto-generated from the current state of the database. Instead of editing this file,
-# please use the migrations feature of Active Record to incrementally modify your database, and
-# then regenerate this schema definition.
-#
-# Note that this schema.rb definition is the authoritative source for your database schema. If you need
-# to create the application database on another system, you should be using db:schema:load, not running
-# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
-# you'll amass, the slower it'll run and the greater likelihood for issues).
-#
-# It's strongly recommended to check this file into your version control system.
-
-ActiveRecord::Schema.define(:version => 20080606095256) do
-
- create_table "users", :force => true do |t|
- t.string "name"
- t.string "last_name"
- t.datetime "created_at"
- t.datetime "updated_at"
- end
-
-end
View
BIN  SampleApp/db/test.sqlite3
Binary file not shown
View
2  SampleApp/doc/README_FOR_APP
@@ -1,2 +0,0 @@
-Use this README file to introduce your application and point to useful places in the API for learning more.
-Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
View
14 SampleApp/lang/es.yml
@@ -1,14 +0,0 @@
-Are_you_sure: ¿Estás seguro?
-Back: Volver
-Create: Crear
-Destroy: Eliminar
-Edit: Editar
-Editing_user: Editar usuario
-Last_Name: Apellido
-Listing_users: Listado de usuarios
-Name: Nombre
-New_user: Crear usuario
-Show: Mostrar
-Update: Actualizar
-User_was_successfully_created: Usuario creado correctamente
-User_was_successfully_updated: Usuario actualizado correctamente
View
30 SampleApp/public/404.html
@@ -1,30 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <title>The page you were looking for doesn't exist (404)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
-</head>
-
-<body>
- <!-- This file lives in public/404.html -->
- <div class="dialog">
- <h1>The page you were looking for doesn't exist.</h1>
- <p>You may have mistyped the address or the page may have moved.</p>
- </div>
-</body>
-</html>
View
30 SampleApp/public/422.html
@@ -1,30 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <title>The change you wanted was rejected (422)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
-</head>
-
-<body>
- <!-- This file lives in public/422.html -->
- <div class="dialog">
- <h1>The change you wanted was rejected.</h1>
- <p>Maybe you tried to change something you didn't have access to.</p>
- </div>
-</body>
-</html>
View
30 SampleApp/public/500.html
@@ -1,30 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <title>We're sorry, but something went wrong (500)</title>
- <style type="text/css">
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
- div.dialog {
- width: 25em;
- padding: 0 4em;
- margin: 4em auto 0 auto;
- border: 1px solid #ccc;
- border-right-color: #999;
- border-bottom-color: #999;
- }
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
- </style>
-</head>
-
-<body>
- <!-- This file lives in public/500.html -->
- <div class="dialog">
- <h1>We're sorry, but something went wrong.</h1>
- <p>We've been notified about this issue and we'll take a look at it shortly.</p>
- </div>
-</body>
-</html>
View
10 SampleApp/public/dispatch.cgi
@@ -1,10 +0,0 @@
-#!/opt/local/bin/ruby
-
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
-
-# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
-# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
-require "dispatcher"
-
-ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
View
24 SampleApp/public/dispatch.fcgi
@@ -1,24 +0,0 @@
-#!/opt/local/bin/ruby
-#
-# You may specify the path to the FastCGI crash log (a log of unhandled
-# exceptions which forced the FastCGI instance to exit, great for debugging)
-# and the number of requests to process before running garbage collection.
-#
-# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
-# and the GC period is nil (turned off). A reasonable number of requests
-# could range from 10-100 depending on the memory footprint of your app.
-#
-# Example:
-# # Default log path, normal GC behavior.
-# RailsFCGIHandler.process!
-#
-# # Default log path, 50 requests between GC.
-# RailsFCGIHandler.process! nil, 50
-#
-# # Custom log path, normal GC behavior.
-# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
-#
-require File.dirname(__FILE__) + "/../config/environment"
-require 'fcgi_handler'
-
-RailsFCGIHandler.process!
View
10 SampleApp/public/dispatch.rb
@@ -1,10 +0,0 @@
-#!/opt/local/bin/ruby
-
-require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
-
-# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:
-# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired
-require "dispatcher"
-
-ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch
View
54 SampleApp/public/stylesheets/scaffold.css
@@ -1,54 +0,0 @@
-body { background-color: #fff; color: #333; }
-
-body, p, ol, ul, td {
- font-family: verdana, arial, helvetica, sans-serif;
- font-size: 13px;
- line-height: 18px;
-}
-
-pre {
- background-color: #eee;
- padding: 10px;
- font-size: 11px;
-}
-
-a { color: #000; }
-a:visited { color: #666; }
-a:hover { color: #fff; background-color:#000; }
-
-.fieldWithErrors {
- padding: 2px;
- background-color: red;
- display: table;
-}
-
-#errorExplanation {
- width: 400px;
- border: 2px solid red;
- padding: 7px;
- padding-bottom: 12px;
- margin-bottom: 20px;
- background-color: #f0f0f0;
-}
-
-#errorExplanation h2 {
- text-align: left;
- font-weight: bold;
- padding: 5px 5px 5px 15px;
- font-size: 12px;
- margin: -7px;
- background-color: #c00;
- color: #fff;
-}
-
-#errorExplanation p {
- color: #333;
- margin-bottom: 0;
- padding: 5px;
-}
-
-#errorExplanation ul li {
- font-size: 12px;
- list-style: square;
-}
-
View
3  SampleApp/script/about
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/about'
View
3  SampleApp/script/console
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/console'
View
3  SampleApp/script/dbconsole
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/dbconsole'
View
3  SampleApp/script/destroy
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/destroy'
View
3  SampleApp/script/generate
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/generate'
View
3  SampleApp/script/performance/benchmarker
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/benchmarker'
View
3  SampleApp/script/performance/profiler
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/profiler'
View
3  SampleApp/script/performance/request
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/performance/request'
View
3  SampleApp/script/plugin
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/plugin'
View
3  SampleApp/script/process/inspector
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/process/inspector'
View
3  SampleApp/script/process/reaper
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/process/reaper'
View
3  SampleApp/script/process/spawner
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../../config/boot'
-require 'commands/process/spawner'
View
3  SampleApp/script/runner
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/runner'
View
3  SampleApp/script/server
@@ -1,3 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/server'
View
9 SampleApp/test/fixtures/users.yml
@@ -1,9 +0,0 @@
-# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-
-one:
- name: MyString
- last_name: MyString
-
-two:
- name: MyString
- last_name: MyString
View
45 SampleApp/test/functional/users_controller_test.rb
@@ -1,45 +0,0 @@
-require 'test_helper'
-
-class UsersControllerTest < ActionController::TestCase
- def test_should_get_index
- get :index
- assert_response :success
- assert_not_nil assigns(:users)
- end
-
- def test_should_get_new
- get :new
- assert_response :success
- end
-
- def test_should_create_user
- assert_difference('User.count') do
- post :create, :user => { }
- end
-
- assert_redirected_to user_path(assigns(:user))
- end
-
- def test_should_show_user
- get :show, :id => users(:one).id
- assert_response :success
- end
-
- def test_should_get_edit
- get :edit, :id => users(:one).id
- assert_response :success
- end
-
- def test_should_update_user
- put :update, :id => users(:one).id, :user => { }
- assert_redirected_to user_path(assigns(:user))
- end
-
- def test_should_destroy_user
- assert_difference('User.count', -1) do
- delete :destroy, :id => users(:one).id
- end
-
- assert_redirected_to users_path
- end
-end
View
55 SampleApp/test/test_helper.rb
@@ -1,55 +0,0 @@
-ENV["RAILS_ENV"] = "test"
-require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
-require 'test_help'
-
-class Test::Unit::TestCase
- # Transactional fixtures accelerate your tests by wrapping each test method
- # in a transaction that's rolled back on completion. This ensures that the
- # test database remains unchanged so your fixtures don't have to be reloaded
- # between every test method. Fewer database queries means faster tests.
- #
- # Read Mike Clark's excellent walkthrough at
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
- #
- # Every Active Record database supports transactions except MyISAM tables
- # in MySQL. Turn off transactional fixtures in this case; however, if you
- # don't care one way or the other, switching from MyISAM to InnoDB tables
- # is recommended.
- #
- # The only drawback to using transactional fixtures is when you actually
- # need to test transactions. Since your test is bracketed by a transaction,
- # any transactions started in your code will be automatically rolled back.
- self.use_transactional_fixtures = true
-
- # Instantiated fixtures are slow, but give you @david where otherwise you
- # would need people(:david). If you don't want to migrate your existing
- # test cases which use the @david style and don't mind the speed hit (each
- # instantiated fixtures translates to a database query per test method),
- # then set this back to true.
- self.use_instantiated_fixtures = false
-
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
- #
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
- # -- they do not yet inherit this setting
- fixtures :all
-
- # Add more helper methods to be used by all tests here...
-
-end
-
-# include default lang on your test requests (test requests doesn't support default_url_options):
-module ActionController
- module TestProcess
- unless method_defined?(:process_without_default_language)
- def process_with_default_language(action, parameters = nil, session = nil, flash = nil)
- lang_pair = {ActionController::Routing::Translator.lang_param_key => ActionController::Routing::Translator.default_lang}
- parameters = lang_pair.merge(parameters) rescue lang_pair
- process_without_default_language(action, parameters, session, flash)
- end
-
- alias :process_without_default_language :process
- alias :process :process_with_default_language
- end
- end
-end
View
8 SampleApp/test/unit/user_test.rb
@@ -1,8 +0,0 @@
-require 'test_helper'
-
-class UserTest < ActiveSupport::TestCase
- # Replace this with your real tests.
- def test_truth
- assert true
- end
-end
View
18 SampleApp/vendor/plugins/gibberish/LICENSE
@@ -1,18 +0,0 @@
-Copyright (c) 2007 Chris Wanstrath
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
118 SampleApp/vendor/plugins/gibberish/README
@@ -1,118 +0,0 @@
-= Gibberish
-
-Yet another localization library. Maybe with the most agreeable API?
-
-= Usage
-
-It's simple. Your default language, by default, is English (:en).
-
- >> "Hey there!"[:hey]
- => "Hey there!"
-
-Gibberish looks in RAILS_ROOT/lang/*.yml for translation files. Say you have RAILS_ROOT/lang/es.yml,
-right? Gibberish will detect that you know about the :es language and will serve up translations
-defined in that file if requested to do so.
-
-Here's a real simple example file (it's just "key: translation"):
-
- $ cat lang/es.yml
- hey: ¡Hey allí!
-
-And, as follows, a real simple example session:
-
- >> "Hey there!"[:hey]
- => "Hey there!"
- >> Gibberish.current_language
- => :en
- >> Gibberish.current_language = :es
- => :es
- >> "Hey there!"[:hey]
- => "¡Hey allí!"
- >> Gibberish.current_language = nil
- => nil
- >> "Hey there!"[:hey]
- => "Hey there!"
-
-It even works with simple interpolation:
-
- >> "Hey, {name}!"[:hey_name, 'Chris']
- => "Hey, Chris!"
- >> "{name} is from {place}"[:hey_place, 'Chris', 'the Dreamworld']
- => "Chris is from the Dreamworld"
-
-Notice we don't use hashes (#) like normal Ruby interpolation. Also, the names of the variables
-in the brackets don't really mean much. Interpolation is done in order -- the first argument replaces
-the first variable in brackets, the second the second, etc.
-
-Interpolation can also be done via hash:
-
- >> "{name} is from {place}"[:hey_place, { :place => 'Gotham City', :name => 'Batman' }]
- => "Batman is from Gotham City"
-
-This of course works with your translations:
-
- $ cat lang/es.yml
- hey: ¡Hey allí!
- hey_name: ¡Hola {name}!
-
- >> "Hey, {name}!"[:hey_name, 'Chris']
- => "Hey, Chris!"
- >> Gibberish.current_language = :es
- => :es
- >> "Hey, {name}!"[:hey_name, 'Cristóbal']
- => ¡Hola Cristóbal!
-
-Neat. What other methods do we get?
-
-The classic around_filter:
-
- class ApplicationController < ActionController::Base
- around_filter :set_language
-
- private
- def set_language
- Gibberish.use_language(session[:language]) { yield }
- end
- end
-
-For the duration of the block, :es is set as the language of choice. After the block is run everything
-returns to normal. Rad.
-
-Finally, some checking methods, if you need them:
-
- >> Gibberish.default_language?
- => true
- >> Gibberish.current_language = :es
- => :es
- >> Gibberish.current_language
- => :es
- >> Gibberish.default_language?
- => false
-
-Languages are loaded by default at Rails startup. In dev mode, language YAML files are reloaded when
-modified. No need to reboot the server.
-
- >> Gibberish.load_languages!
- => [:es, :fr, :de, :kl]
- >> Gibberish.languages
- => [:es, :fr, :de, :kl]
-
-More as it's needed.
-
-= Warning
-
-By default, Ruby returns nil when a symbol is passed to String's [] method. Some of Rails, it seems, depends
-on this behavior. Yes, I am changing !!core Ruby behavior!! The humanity!
-
-To deal with this assumption, Gibberish has a reserved_keys array. It, by default, contains :limit (so Rails
-migrations don't explode on you.) To add to this array, just pass it more keys:
-
- >> Gibberish.add_reserved_key :another_key
- => [:limit, :another_key]
- >> Gibberish.add_reserved_keys :more, :keys
- => [:limit, :another_key, :more, :keys]
-
-You've been warned. It really shouldn't affect you, though.
-
->> Chris Wanstrath
-=> chris[at]ozmm[dot]org
View
14 SampleApp/vendor/plugins/gibberish/Rakefile
@@ -1,14 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-desc 'Generate RDoc documentation for the Gibberish plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- files = ['README', 'LICENSE', 'lib/**/*.rb']
- rdoc.rdoc_files.add(files)
- rdoc.main = "README" # page to start on
- rdoc.title = "gibberish"
- rdoc.template = File.exists?(t="/Users/chris/ruby/projects/err/rock/template.rb") ? t : "/var/www/rock/template.rb"
- rdoc.rdoc_dir = 'doc' # rdoc output folder
- rdoc.options << '--inline-source'
-end
View
3  SampleApp/vendor/plugins/gibberish/init.rb
@@ -1,3 +0,0 @@
-require 'gibberish'
-
-Gibberish.load_languages!
View
3  SampleApp/vendor/plugins/gibberish/lang/es.yml
@@ -1,3 +0,0 @@
-welcome_friend: ¡Bienvenido amigo!
-welcome_user: ¡Bienvenido {user}!
-love_rails: Amo los carriles.
View
3  SampleApp/vendor/plugins/gibberish/lang/fr.yml
@@ -1,3 +0,0 @@
-welcome_friend: Bienvenue, ami!
-welcome_user: Bienvenue, {user}!
-love_rails: J'aime des rails.
View
8 SampleApp/vendor/plugins/gibberish/lib/gibberish.rb
@@ -1,8 +0,0 @@
-require 'gibberish/localize'
-require 'gibberish/string_ext'
-
-String.send :include, Gibberish::StringExt
-
-module Gibberish
- extend Localize
-end
View
88 SampleApp/vendor/plugins/gibberish/lib/gibberish/localize.rb
@@ -1,88 +0,0 @@
-module Gibberish
- module Localize
- @@default_language = :en
- mattr_reader :default_language
-
- @@reserved_keys = [ :limit ]
- mattr_reader :reserved_keys
-
- def add_reserved_key(*key)
- (@@reserved_keys += key.flatten).uniq!
- end
- alias :add_reserved_keys :add_reserved_key
-
- @@languages = {}
- def languages
- @@languages.keys
- end
-
- @@current_language = nil
- def current_language
- @@current_language || default_language
- end
-
- def current_language=(language)
- load_languages! if defined?(RAILS_ENV) && RAILS_ENV == 'development'
-
- language = language.to_sym if language.respond_to? :to_sym
- @@current_language = @@languages[language] ? language : nil
- end
-
- def use_language(language)
- start_language = current_language
- self.current_language = language
- yield
- self.current_language = start_language
- end
-
- def default_language?
- current_language == default_language
- end
-
- def translations
- @@languages[current_language] || {}
- end
-
- def translate(string, key, *args)
- return if reserved_keys.include? key
- target = translations[key] || string
- interpolate_string(target.dup, *args.dup)
- end
-
- def load_languages!
- language_files.each do |file|
- key = File.basename(file, '.*').to_sym
- @@languages[key] ||= {}
- @@languages[key].merge! YAML.load_file(file).symbolize_keys
- end
- languages
- end
-
- @@language_paths = [RAILS_ROOT]
- def language_paths
- @@language_paths ||= []
- end
- private
- def interpolate_string(string, *args)
- if args.last.is_a? Hash
- interpolate_with_hash(string, args.last)
- else
- interpolate_with_strings(string, args)
- end
- end
-
- def interpolate_with_hash(string, hash)
- hash.inject(string) do |target, (search, replace)|
- target.sub("{#{search}}", replace)
- end
- end
-
- def interpolate_with_strings(string, strings)
- string.gsub(/\{\w+\}/) { strings.shift }
- end
-
- def language_files
- @@language_paths.map {|path| Dir[File.join(path, 'lang', '*.{yml,yaml}')]}.flatten
- end
- end
-end
View
17 SampleApp/vendor/plugins/gibberish/lib/gibberish/string_ext.rb
@@ -1,17 +0,0 @@
-module Gibberish
- module StringExt
- def brackets_with_translation(*args)
- args = [underscore.tr(' ', '_').to_sym] if args.empty?
- return brackets_without_translation(*args) unless args.first.is_a? Symbol
- Gibberish.translate(self, args.shift, *args)
- end
-
- def self.included(base)
- base.class_eval do
- alias :brackets :[]
- alias_method_chain :brackets, :translation
- alias :[] :brackets
- end
- end
- end
-end
View
203 SampleApp/vendor/plugins/gibberish/test/gibberish_test.rb
@@ -1,203 +0,0 @@
-begin
- require 'rubygems'
- require 'test/spec'
-rescue LoadError
- puts "==> The test/spec library (gem) is required to run the Gibberish tests."
- exit
-end
-
-$:.unshift File.dirname(__FILE__) + '/../lib'
-RAILS_ROOT = File.dirname(__FILE__) + '/..'
-
-require 'active_support'
-require 'gibberish'
-
-Gibberish.load_languages!
-
-context "After loading languages, Gibberish" do
- teardown do
- Gibberish.current_language = nil
- end
-
- specify "should know what languages it has translations for" do
- Gibberish.languages.should.include :es
- end
-
- specify "should know if it is using the default language" do
- Gibberish.should.be.default_language
- end
-
- specify "should be able to switch between existing languages" do
- Gibberish.current_language = :es
- string = "Welcome, friend!"
- string[:welcome_friend].should.not.equal string
-
- Gibberish.current_language = :fr
- string[:welcome_friend].should.not.equal string
-
- Gibberish.current_language = nil
- string[:welcome_friend].should.equal string
- end
-
- specify "should be able to switch languages using strings" do
- Gibberish.current_language = 'es'
- Gibberish.current_language.should.equal :es
- end
-
- specify "should be able to switch to the default language at any time" do
- Gibberish.current_language = :fr
- Gibberish.should.not.be.default_language
-
- Gibberish.current_language = nil
- Gibberish.should.be.default_language
- end
-
- specify "should be able to switch to a certain language for the duration of a block" do
- Gibberish.should.be.default_language
-
- string = "Welcome, friend!"
- string[:welcome_friend].should.equal string
-
- Gibberish.use_language :es do
- string[:welcome_friend].should.not.equal string
- Gibberish.should.not.be.default_language
- end
-
- Gibberish.should.be.default_language
- string[:welcome_friend].should.equal string
- end
-
- specify "should return an array of the languages it loaded" do
- languages = Gibberish.load_languages!
- languages.should.be.an.instance_of Array
- languages.should.include :es
- languages.should.include :fr
- end
-
- specify "should know what languages it has loaded" do
- languages = Gibberish.languages
- languages.should.be.an.instance_of Array
- languages.should.include :es
- languages.should.include :fr
- end
-
- specify "should be able to accept new, unique reserved keys" do
- key = :something_evil
- Gibberish.add_reserved_key key
- Gibberish.reserved_keys.should.include key
- Gibberish.reserved_keys.size.should.equal 2
- Gibberish.add_reserved_key key
- Gibberish.add_reserved_key key
- Gibberish.reserved_keys.size.should.equal 2
- end
-
- specify "should have loaded language files from directories other than the default" do
- Gibberish.language_paths << File.dirname(__FILE__)
- Gibberish.load_languages!
- string = "I don't speak Babble."
- Gibberish.use_language :es do
- string[:no_babble].should.equal "No hablo Bable."
- end
- Gibberish.use_language :fr do
- string[:no_babble].should.equal "Je ne parle pas Babble."
- end
- end
-end
-
-context "When no language is set" do
- setup do
- Gibberish.current_language = nil
- end
-
- specify "the default language should be used" do
- Gibberish.current_language.should.equal Gibberish.default_language
- end
-
- specify "a gibberish string should return itself" do
- string = "Welcome, friend!"
- Gibberish.translate(string, :welcome_friend).should.equal string
-
- string[:welcome_friend].should.equal string
- end
-end
-
-context "When a non-existent language is set" do
- setup do
- Gibberish.current_language = :klingon
- end
-
- specify "the default language should be used" do
- Gibberish.current_language.should.equal Gibberish.default_language
- end
-
- specify "gibberish strings should return themselves" do
- string = "something gibberishy"
- string[:welcome_friend].should.equal string
- end
-end
-
-context "A gibberish string (in general)" do
- specify "should be a string" do
- "gibberish"[:just_a_string].should.be.an.instance_of String
- "non-gibberish".should.be.an.instance_of String
- end
-
- specify "should interpolate if passed arguments and replaces are present" do
- 'Hi, {user} of {place}'[:hi_there, 'chris', 'france'].should.equal "Hi, chris of france"
- '{computer} omg?'[:puter, 'mac'].should.equal "mac omg?"
- end
-
- specify "should interpolate based on key if passed a hash" do
- 'Hi, {user} of {place}'[:hi_there, { :place => 'france', :user => 'chris' }].should.equal "Hi, chris of france"
-
- bands = { 'other_bad_band' => 'Deputy', :good_band => 'Word Picture', 'bad_band' => 'Dagger' }
- answer = 'Well, Dagger sucks and so does Deputy, but Word Picture is pretty rad.'
- 'Well, {bad_band} sucks and so does {other_bad_band}, but {good_band} is pretty rad.'[:snobbish, bands].should.equal answer
- end
-
- specify "should not affect existing string methods" do
- string = "chris"
- answer = 'ch'
- string[0..1].should.equal answer
- string[0, 2].should.equal answer
- string[0].should.equal 99
- string[/ch/].should.equal answer
- string['ch'].should.equal answer
- string['bc'].should.be.nil
- string[/dog/].should.be.nil
- end
-
- specify "should return nil if a reserved key is used" do
- "string"[:limit].should.be.nil
- end
-
- specify "should set default key to underscored string" do
- Gibberish.current_language = :es
- 'welcome friend'[].should == '¡Bienvenido amigo!'
- end
-end
-
-context "When a non-default language is set" do
- setup do
- Gibberish.current_language = :es
- end
-
- specify "that language should be used" do
- Gibberish.current_language.should.equal :es
- end
-
- specify "the default language should not be used" do
- Gibberish.should.not.be.default_language
- end
-
- specify "a gibberish string should return itself if a corresponding key is not found" do
- string = "The internet!"
- string[:the_internet].should.equal string
- end
-
- specify "a gibberish string should return a translated version of itself if a corresponding key is found" do
- "Welcome, friend!"[:welcome_friend].should.equal '¡Bienvenido amigo!'
- "I love Rails."[:love_rails].should.equal "Amo los carriles."
- 'Welcome, {user}!'[:welcome_user, 'Marvin'].should.equal '¡Bienvenido Marvin!'
- end
-end
View
1  SampleApp/vendor/plugins/gibberish/test/lang/es.yml
@@ -1 +0,0 @@
-no_babble: No hablo Bable.
View
1  SampleApp/vendor/plugins/gibberish/test/lang/fr.yml
@@ -1 +0,0 @@
-no_babble: Je ne parle pas Babble.
View
12 SampleApp/vendor/plugins/translate_routes/ChangeLog
@@ -1,12 +0,0 @@
--- 0.96.1 (Aug 5th 2008)
- * Fixed by Mathieu Fosse: helpers didn't worked as expected when lang_param_key is undefined
-
--- 0.96 (Jun 10th 2008)
- * Added update_yaml task, suggested by Francesc Esplugas
-
--- 0.95 (Jan 21st 2008)
- * Still beta version
- * Added yaml files support for dictionaries
-
--- 0.9 (Dec 27th 2007)
- * Beta version
View
20 SampleApp/vendor/plugins/translate_routes/MIT-LICENSE
@@ -1,20 +0,0 @@
-Copyright (c) 2007 Raul Murciano [http://raul.murciano.net], Domestika INTERNET S.L. [http://domestika.org]
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
150 SampleApp/vendor/plugins/translate_routes/README
@@ -1,150 +0,0 @@
-=TranslateRoutes
-
-This Rails plugin provides a simple way to translate your URLs to any number of languages.
-
-It's designed to be extremely and easy to use and customize.
-As it works after routing processing, it plays nice with all kind of routing definitions, including RESTful and named routes.
-It also takes care of your current routing helpers by translating them transparently.
-
-==Installation
-Just check it out on your app's <tt>/vendor/plugins</tt> and see the examples below.
-
-==Usage
-
-
-Let's start with a tiny example. Of course you need to define your routes first, e.g:
-
- ActionController::Routing::Routes.draw do |map|
- map.connect 'contact', :controller => 'contact', :action => 'index'
- end
-
-After that, on the same routes.rb file, you can translate the generated route by doing:
-
- ActionController::Routing::Translator.translate do |t|
- t['es'] = {
- 'contact' => 'contacto'
- }
- end
-
-This will give you the next routes (check it out by doing 'rake routes'):
-
- /es/contacto {:lang=>"es", :controller=>"contact", :action=>"index"}
- /contact {:lang=>"en", :controller=>"contact", :action=>"index"}
-
-As you can see:
-- a +lang+ param has been added to your routes, with the value of the used language (*)
-- +en+ is the default language (*)
-- the URLs associated with a language are always prefixed with the language code that you provided on the translation.
-- the default language URLs have no language prefix (*)
-(*) You can customize this behaviour, see "Configuration" below.
-
-Let's add some routes and translations to our example:
-
- ActionController::Routing::Routes.draw do |map|
- map.connect 'contact', :controller => 'contact', :action => 'index'
- map.home '', :controller => 'main', :action => 'index'
- map.resources :people
- end
-
- ActionController::Routing::Translator.translate do |t|
-
- t['es'] = {
- 'contact' => 'contacto',
- 'people' => 'gente',
- 'new' => 'crear',
- 'edit' =>'editar'
- }
-
- t['fr'] = {
- 'people' => 'personne',
- 'new' => 'neuf'
- }
- end
-
-Again, you can use <tt>rake routes</tt> to see the generated URLs. I'll only talk about some of them:
-
-We didn't give any french translation for +contact+, so the french associated URLs use the untranslated text:
-
- /fr/contact {:lang=>"fr", :controller=>"contact", :action=>"index"}
- /es/contacto {:lang=>"es", :controller=>"contact", :action=>"index"}
- /contact {:lang=>"en", :controller=>"contact", :action=>"index"}
-
-The named routes have generated not only translated URLs but also a helper for each language:
-
- home_fr /fr {:lang=>"fr", :controller=>"main", :action=>"index"}
- home_es /es {:lang=>"es", :controller=>"main", :action=>"index"}
- home_en / {:lang=>"en", :controller=>"main", :action=>"index"}
-
-This means that you can use +home_es_path+ and +home_es_url+ on your controllers and views.
-
-No +home+ named route is shown on the list so it looks like you can't use a simple +home_path+ helper, but relax: you have a +home_path+ helper available for your controllers and views. It looks for the current +lang+ value and redirects to the appropiate helper. This means that if you're rendering the <tt>contact/index</tt> view when visiting <tt>/es/contacto</tt>, the +home_path+ helper will call to +home_es_path+ and return its result. The same applies to +home_url+, obviously.
-
-We can see that resource controllers and actions are translated as well:
-
- new_person_fr GET /fr/personne/neuf {:lang=>"fr", :controller=>"people", :action=>"new"}
- new_person_es GET /es/gente/crear {:lang=>"es", :controller=>"people", :action=>"new"}
- new_person GET /people/new {:lang=>"en", :controller=>"people", :action=>"new"}
-
-Finally, we can get rid of that verbose translation hashes by using yaml files. Create a file inside your <tt>/config</tt> directory, called <tt>routes_es.yml</tt> and fill it with your desired translations, e.g:
-
- # /config/routes_es.yml
- person: persona
-
-and replace all the
-
- ActionController::Routing::Translator.translate do
- ...
- end
-
-stuff on <tt>routes.rb</tt> with this simple line:
-
- ActionController::Routing::Translator.translate_from_files
-
-
-== Configuration
-You can customize some features by adding some lines before your translation code:
-
-- You can change the language param key (<tt>:lang</tt> by default). To change this feature use:
-
- ActionController::Routing::Translator.lang_param_key = :foo
-
-This key should have the same name that the instance variable which keeps the language code on your controllers and views.
-
-- You can change the default language of your application with:
-
- ActionController::Routing::Translator.default_lang = 'es'
-
-Of course, you can also translate your default language. If, as I do, all your controllers and actions have english names, you can have an english version on your site for free by doing:
-
- ActionController::Routing::Translator.default_lang = 'es'
- ActionController::Routing::Translator.translate do |t|
- t['en'] = {}
- t['es'] = { # spanish translation here }
- end
-
-or adding the equivalent <tt>/config/routes_es.yml</tt> and an empty <tt>/config/routes_en.yml</tt>
-
-- You can add a prefix also on your default language routes by doing:
-
- ActionController::Routing::Translator.prefix_on_default_lang = true
-
-<b>WARNING!</b> this way you'll disable your root -empty- route: if english is your default language, your empty route will be translated to <tt>/en</tt> so you must manually take care of it.
-
-
-== Suggestions, bug reports, questions
-Feedback and comments will be always welcome at raul@murciano.net
-
-
-== Credits
-- Raul Murciano [http://raul.murciano.net] - code
-- Domestika INTERNET S.L [http://domestika.org] - incredible support, really nice people to work with!
-
-
-== Rails routing resources
-- David Black's 'Rails Routing' ebook rocks! - 'Ruby for Rails' too, BTW.
-- Obie Fernandez's 'The Rails Way' - the definitive RoR reference, great work Obie!
-
-== License
-Copyright (c) 2007
-Raul Murciano [http://raul.murciano.net]
-Domestika INTERNET S.L. [http://domestika.org], released under the MIT license (see MIT-LICENSE)
View
22 SampleApp/vendor/plugins/translate_routes/Rakefile
@@ -1,22 +0,0 @@
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-
-desc 'Default: run unit tests.'
-task :default => :test
-
-desc 'Test the translate_routes plugin.'
-Rake::TestTask.new(:test) do |t|
- t.libs << 'lib'
- t.pattern = 'test/**/*_test.rb'
- t.verbose = true
-end
-
-desc 'Generate documentation for the translate_routes plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'TranslateRoutes'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('lib/**/*.rb')
-end
View
0  SampleApp/vendor/plugins/translate_routes/config/routes_en.yml
No changes.
View
1  SampleApp/vendor/plugins/translate_routes/config/routes_es.yml
@@ -1 +0,0 @@
-people: gente
View
1  SampleApp/vendor/plugins/translate_routes/doc/created.rid
@@ -1 +0,0 @@
-Fri, 06 Jun 2008 11:06:26 +0200
View
351 SampleApp/vendor/plugins/translate_routes/doc/files/README.html
@@ -1,351 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>File: README</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
- <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
- <script type="text/javascript">
- // <![CDATA[
-
- function popupCode( url ) {
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
- }
-
- function toggleCode( id ) {
- if ( document.getElementById )
- elem = document.getElementById( id );
- else if ( document.all )
- elem = eval( "document.all." + id );
- else
- return false;
-
- elemStyle = elem.style;
-
- if ( elemStyle.display != "block" ) {
- elemStyle.display = "block"
- } else {
- elemStyle.display = "none"
- }
-
- return true;
- }
-
- // Make codeblocks hidden by default
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
-
- // ]]>
- </script>
-
-</head>
-<body>
-
-
-
- <div id="fileHeader">
- <h1>README</h1>
- <table class="header-table">
- <tr class="top-aligned-row">
- <td><strong>Path:</strong></td>
- <td>README
- </td>
- </tr>
- <tr class="top-aligned-row">
- <td><strong>Last Update:</strong></td>
- <td>Fri Jun 06 11:05:04 +0200 2008</td>
- </tr>
- </table>
- </div>
- <!-- banner header -->
-
- <div id="bodyContent">
-
-
-
- <div id="contextContent">
-
- <div id="description">
- <h1>TranslateRoutes</h1>
-<p>
-This Rails plugin provides a simple way to translate your URLs to any
-number of languages.
-</p>
-<p>
-It&#8216;s designed to be extremely and easy to use and customize. As it
-works after routing processing, it plays nice with all kind of routing
-definitions, including RESTful and named routes. It also takes care of your
-current routing helpers by translating them transparently.
-</p>
-<h2>Installation</h2>
-<p>
-Just check it out on your app&#8216;s <tt>/vendor/plugins</tt> and see the
-examples below.
-</p>
-<h2>Usage</h2>
-<p>
-Let&#8216;s start with a tiny example. Of course you need to define your
-routes first, e.g:
-</p>
-<pre>
- ActionController::Routing::Routes.draw do |map|
- map.connect 'contact', :controller =&gt; 'contact', :action =&gt; 'index'
- end
-</pre>
-<p>
-After that, on the same routes.rb file, you can translate the generated
-route by doing:
-</p>
-<pre>
- ActionController::Routing::Translator.translate do |t|
- t['es'] = {
- 'contact' =&gt; 'contacto'
- }