Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial commit

  • Loading branch information...
commit 4b31398313e6e40389daf2f635c49393c1c4e196 0 parents
Shane Mingins authored
Showing with 2,546,648 additions and 0 deletions.
  1. BIN  .DS_Store
  2. +256 −0 README
  3. +10 −0 Rakefile
  4. +27 −0 app/controllers/application.rb
  5. +86 −0 app/controllers/people_controller.rb
  6. +96 −0 app/controllers/posts_controller.rb
  7. +3 −0  app/helpers/application_helper.rb
  8. +2 −0  app/helpers/people_helper.rb
  9. +2 −0  app/helpers/posts_helper.rb
  10. +3 −0  app/models/person.rb
  11. +3 −0  app/models/post.rb
  12. +23 −0 app/views/layouts/application.html.erb
  13. +24 −0 app/views/people/edit.html.erb
  14. +26 −0 app/views/people/index.html.erb
  15. +24 −0 app/views/people/new.html.erb
  16. +23 −0 app/views/people/show.html.erb
  17. +16 −0 app/views/posts/edit.html.erb
  18. +21 −0 app/views/posts/index.html.erb
  19. +13 −0 app/views/posts/locale.html.erb
  20. +16 −0 app/views/posts/new.html.erb
  21. +22 −0 app/views/posts/show.html.erb
  22. +109 −0 config/boot.rb
  23. +65 −0 config/database.yml
  24. +77 −0 config/environment.rb
  25. +17 −0 config/environments/development.rb
  26. +24 −0 config/environments/production.rb
  27. +22 −0 config/environments/test.rb
  28. +2 −0  config/initializers/i18n.rb
  29. +10 −0 config/initializers/inflections.rb
  30. +5 −0 config/initializers/mime_types.rb
  31. +17 −0 config/initializers/new_rails_defaults.rb
  32. +9 −0 config/locales/en.yml
  33. +50 −0 config/routes.rb
  34. BIN  db/development.sqlite3
  35. +23 −0 db/migrate/20090201233020_create_i18n_tables.rb
  36. +13 −0 db/migrate/20090203030734_create_posts.rb
  37. +15 −0 db/migrate/20090211235214_create_people.rb
  38. +45 −0 db/schema.rb
  39. BIN  db/test.sqlite3
  40. +5 −0 doc/README_FOR_APP
  41. +132 −0 lib/tasks/rspec.rake
  42. +8 −0 lib/tasks/test.rake
  43. +102 −0 lib/translate_extractor.rb
  44. +172,095 −0 log/development.log
  45. 0  log/production.log
  46. 0  log/server.log
  47. +2,363,844 −0 log/test.log
  48. +1 −0  nbproject/private/private.properties
  49. +4 −0 nbproject/private/private.xml
  50. +110 −0 nbproject/private/rake-d.txt
  51. +3 −0  nbproject/project.properties
  52. +9 −0 nbproject/project.xml
  53. +30 −0 public/404.html
  54. +30 −0 public/422.html
  55. +33 −0 public/500.html
  56. +10 −0 public/dispatch.cgi
  57. +24 −0 public/dispatch.fcgi
  58. +10 −0 public/dispatch.rb
  59. BIN  public/es/images/rails.png
  60. 0  public/favicon.ico
  61. BIN  public/images/batman.jpg
  62. BIN  public/images/custom1_bar.gif
  63. BIN  public/images/custom1_box.gif
  64. BIN  public/images/percentImage.png
  65. BIN  public/images/percentImage_back.png
  66. BIN  public/images/percentImage_back1.png
  67. BIN  public/images/percentImage_back2.png
  68. BIN  public/images/percentImage_back3.png
  69. BIN  public/images/percentImage_back4.png
  70. BIN  public/images/progress_bar/Thumbs.db
  71. BIN  public/images/progress_bar/add.gif
  72. BIN  public/images/progress_bar/custom1_bar.gif
  73. BIN  public/images/progress_bar/custom1_box.gif
  74. BIN  public/images/progress_bar/empty.gif
  75. BIN  public/images/progress_bar/fill.gif
  76. BIN  public/images/progress_bar/get.gif
  77. BIN  public/images/progress_bar/minus.gif
  78. BIN  public/images/progress_bar/percentImage.png
  79. BIN  public/images/progress_bar/percentImage_back.png
  80. BIN  public/images/progress_bar/percentImage_back1.png
  81. BIN  public/images/progress_bar/percentImage_back2.png
  82. BIN  public/images/progress_bar/percentImage_back3.png
  83. BIN  public/images/progress_bar/percentImage_back4.png
  84. BIN  public/images/progress_bar/set.gif
  85. BIN  public/images/rails.png
  86. +274 −0 public/index.html
  87. +2 −0  public/javascripts/application.js
  88. +963 −0 public/javascripts/controls.js
  89. +973 −0 public/javascripts/dragdrop.js
  90. +1,128 −0 public/javascripts/effects.js
  91. +509 −0 public/javascripts/jsProgressBarHandler.js
  92. +370 −0 public/javascripts/progress_bar/jsProgressBarHandler.js
  93. +4,320 −0 public/javascripts/prototype.js
  94. +5 −0 public/robots.txt
  95. +54 −0 public/stylesheets/scaffold.css
  96. +4 −0 script/about
  97. +5 −0 script/autospec
  98. +3 −0  script/console
  99. +3 −0  script/dbconsole
  100. +3 −0  script/destroy
  101. +3 −0  script/generate
  102. +3 −0  script/performance/benchmarker
  103. +3 −0  script/performance/profiler
  104. +3 −0  script/performance/request
  105. +3 −0  script/plugin
  106. +3 −0  script/process/inspector
  107. +3 −0  script/process/reaper
  108. +3 −0  script/process/spawner
  109. +3 −0  script/runner
  110. +3 −0  script/server
  111. +5 −0 script/spec
  112. +116 −0 script/spec_server
  113. +2 −0  spec/rcov.opts
  114. +4 −0 spec/spec.opts
  115. +47 −0 spec/spec_helper.rb
  116. +4 −0 stories/all.rb
  117. +3 −0  stories/helper.rb
  118. +11 −0 test/fixtures/people.yml
  119. +7 −0 test/fixtures/posts.yml
  120. +45 −0 test/functional/people_controller_test.rb
  121. +45 −0 test/functional/posts_controller_test.rb
  122. +9 −0 test/performance/browsing_test.rb
  123. +38 −0 test/test_helper.rb
  124. +8 −0 test/unit/person_test.rb
  125. +8 −0 test/unit/post_test.rb
  126. BIN  vendor/.DS_Store
  127. +1 −0  vendor/plugins/i18n_backend_database
BIN  .DS_Store
Binary file not shown
256 README
@@ -0,0 +1,256 @@
+== 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.
10 Rakefile
@@ -0,0 +1,10 @@
+# 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'
27 app/controllers/application.rb
@@ -0,0 +1,27 @@
+# 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
+ helper :all # include all helpers, all the time
+
+ # See ActionController::RequestForgeryProtection for details
+ # Uncomment the :secret if you're not using the cookie session store
+ protect_from_forgery # :secret => '4f06d1929d0fab376ded90e39c383c7a'
+
+ # See ActionController::Base for details
+ # Uncomment this to filter the contents of submitted sensitive data parameters
+ # from your application log (in this case, all fields with names like "password").
+ # filter_parameter_logging :password
+ before_filter :set_locale
+
+ protected
+
+ def set_locale
+ I18n.locale = params[:locale] || :en
+ end
+
+ def default_url_options(options = nil)
+ {:locale => I18n.locale}
+ end
+
+end
86 app/controllers/people_controller.rb
@@ -0,0 +1,86 @@
+class PeopleController < ApplicationController
+ # TODO - test
+ # GET /people
+ # GET /people.xml
+ def index
+ @people = Person.find(:all)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @people }
+ end
+ end
+
+ # GET /people/1
+ # GET /people/1.xml
+ def show
+ @person = Person.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @person }
+ end
+ end
+
+ # GET /people/new
+ # GET /people/new.xml
+ def new
+ @person = Person.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @person }
+ end
+ end
+
+ # GET /people/1/edit
+ def edit
+ @person = Person.find(params[:id])
+ end
+
+ # POST /people
+ # POST /people.xml
+ def create
+ @person = Person.new(params[:person])
+
+ respond_to do |format|
+ if @person.save
+ flash[:notice] = 'Person was successfully created.'
+ format.html { redirect_to(@person) }
+ format.xml { render :xml => @person, :status => :created, :location => @person }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @person.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /people/1
+ # PUT /people/1.xml
+ def update
+ @person = Person.find(params[:id])
+
+ respond_to do |format|
+ if @person.update_attributes(params[:person])
+ flash[:notice] = 'Person was successfully updated.'
+ format.html { redirect_to(@person) }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @person.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /people/1
+ # DELETE /people/1.xml
+ def destroy
+ @person = Person.find(params[:id])
+ @person.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(people_url) }
+ format.xml { head :ok }
+ end
+ end
+end
96 app/controllers/posts_controller.rb
@@ -0,0 +1,96 @@
+class PostsController < ApplicationController
+
+ def locale
+ @locale = I18n.locale
+ end
+
+ def change_locale
+ I18n.locale = params[:locale] unless params[:locale].blank?
+ puts "I18n.locale = #{I18n.locale}"
+ redirect_to locale_posts_url
+ end
+
+ # GET /posts
+ # GET /posts.xml
+ def index
+ @posts = Post.find(:all)
+
+ respond_to do |format|
+ format.html # index.html.erb
+ format.xml { render :xml => @posts }
+ end
+ end
+
+ # GET /posts/1
+ # GET /posts/1.xml
+ def show
+ @post = Post.find(params[:id])
+
+ respond_to do |format|
+ format.html # show.html.erb
+ format.xml { render :xml => @post }
+ end
+ end
+
+ # GET /posts/new
+ # GET /posts/new.xml
+ def new
+ @post = Post.new
+
+ respond_to do |format|
+ format.html # new.html.erb
+ format.xml { render :xml => @post }
+ end
+ end
+
+ # GET /posts/1/edit
+ def edit
+ @post = Post.find(params[:id])
+ end
+
+ # POST /posts
+ # POST /posts.xml
+ def create
+ @post = Post.new(params[:post])
+
+ respond_to do |format|
+ if @post.save
+ flash[:notice] = 'Post was successfully created.'
+ format.html { redirect_to(@post) }
+ format.xml { render :xml => @post, :status => :created, :location => @post }
+ else
+ format.html { render :action => "new" }
+ format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # PUT /posts/1
+ # PUT /posts/1.xml
+ def update
+ @post = Post.find(params[:id])
+
+ respond_to do |format|
+ if @post.update_attributes(params[:post])
+ flash[:notice] = 'Post was successfully updated.'
+ format.html { redirect_to(@post) }
+ format.xml { head :ok }
+ else
+ format.html { render :action => "edit" }
+ format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
+ end
+ end
+ end
+
+ # DELETE /posts/1
+ # DELETE /posts/1.xml
+ def destroy
+ @post = Post.find(params[:id])
+ @post.destroy
+
+ respond_to do |format|
+ format.html { redirect_to(posts_url) }
+ format.xml { head :ok }
+ end
+ end
+end
3  app/helpers/application_helper.rb
@@ -0,0 +1,3 @@
+# Methods added to this helper will be available to all templates in the application.
+module ApplicationHelper
+end
2  app/helpers/people_helper.rb
@@ -0,0 +1,2 @@
+module PeopleHelper
+end
2  app/helpers/posts_helper.rb
@@ -0,0 +1,2 @@
+module PostsHelper
+end
3  app/models/person.rb
@@ -0,0 +1,3 @@
+class Person < ActiveRecord::Base
+ validates_presence_of :name, :city, :age
+end
3  app/models/post.rb
@@ -0,0 +1,3 @@
+class Post < ActiveRecord::Base
+ validates_presence_of :content#, :message => 'This is a custom message'
+end
23 app/views/layouts/application.html.erb
@@ -0,0 +1,23 @@
+<!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>I18n Demo: <%= controller.action_name %></title>
+ <%= stylesheet_link_tag 'scaffold' %>
+</head>
+
+<body class="content">
+ <div class="content">
+ <p>
+ <%= I18n.t("Select locale") %>
+ <%= link_to 'en', url_for(:locale => 'en') %> &middot;
+ <%= link_to 'es', url_for(:locale => 'es') %>
+ </p>
+ <p style="color: green"><%= flash[:notice] %></p>
+ <%= yield %>
+ </div>
+</body>
+
+</html>
24 app/views/people/edit.html.erb
@@ -0,0 +1,24 @@
+<h1>Editing person</h1>
+
+<% form_for(@person) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :city %><br />
+ <%= f.text_field :city %>
+ </p>
+ <p>
+ <%= f.label :age %><br />
+ <%= f.text_field :age %>
+ </p>
+ <p>
+ <%= f.submit "Update" %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', @person %> |
+<%= link_to 'Back', people_path %>
26 app/views/people/index.html.erb
@@ -0,0 +1,26 @@
+<h1>Listing people</h1>
+<%= image_tag(I18n.ta("rails.png")) %>
+<%= image_tag(I18n.ta("batman.jpg"), :height => "100", :width => "100") %>
+
+<table>
+ <tr>
+ <th>Name</th>
+ <th>City</th>
+ <th>Age</th>
+ </tr>
+
+<% for person in @people %>
+ <tr>
+ <td><%=h person.name %></td>
+ <td><%=h person.city %></td>
+ <td><%=h person.age %></td>
+ <td><%= link_to 'Show', person %></td>
+ <td><%= link_to 'Edit', edit_person_path(person) %></td>
+ <td><%= link_to 'Destroy', person, :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New person', new_person_path(:locale => I18n.locale) %>
24 app/views/people/new.html.erb
@@ -0,0 +1,24 @@
+<h1>New person</h1>
+
+<% form_for(@person) do |f| %>
+ <%= hidden_field_tag :locale, I18n.locale %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :name %><br />
+ <%= f.text_field :name %>
+ </p>
+ <p>
+ <%= f.label :city %><br />
+ <%= f.text_field :city %>
+ </p>
+ <p>
+ <%= f.label :age %><br />
+ <%= f.text_field :age %>
+ </p>
+ <p>
+ <%= f.submit "Create" %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', people_path %>
23 app/views/people/show.html.erb
@@ -0,0 +1,23 @@
+<h3><%= I18n.t('Hi from {{person}}, should work! And with {{my_link}}', :person => @person.name, :my_link => people_path) %></h3>
+
+<%= I18n.t('Add a New Photo') %>
+<%= I18n.t('Add a New Photo') %>
+<%= I18n.t('add a new photo') %>
+<p>
+ <b>Name:</b>
+ <%=h @person.name %>
+</p>
+
+<p>
+ <b>City:</b>
+ <%=h @person.city %>
+</p>
+
+<p>
+ <b>Age:</b>
+ <%=h @person.age %>
+</p>
+
+
+<%= link_to 'Edit', edit_person_path(@person) %> |
+<%= link_to 'Back', people_path %>
16 app/views/posts/edit.html.erb
@@ -0,0 +1,16 @@
+<h1>Editing post</h1>
+
+<% form_for(@post) do |f| %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :content %><br />
+ <%= f.text_field :content %>
+ </p>
+ <p>
+ <%= f.submit "Update" %>
+ </p>
+<% end %>
+
+<%= link_to 'Show', @post %> |
+<%= link_to 'Back', posts_path %>
21 app/views/posts/index.html.erb
@@ -0,0 +1,21 @@
+<h1><%= I18n.t("Listing posts") %></h1><h1><%= I18n.t("Listing posts in same line!") %></h1>
+<%= image_tag(I18n.ta("batman.jpg"), :height => "100", :width => "100") %>
+<table>
+ <tr>
+ <th>Content</th>
+ </tr>
+
+<% for post in @posts %>
+ <tr>
+ <td><%=h I18n.t(post.content) %></td>
+ <td><%= link_to 'Show', post %></td>
+ <td><%= link_to 'Edit', edit_post_path(post) %></td>
+ <td><%= link_to 'Destroy', post, :confirm => 'Are you sure?', :method => :delete %></td>
+ </tr>
+<% end %>
+</table>
+
+<br />
+
+<%= link_to 'New post', new_post_path(:locale => I18n.locale) %> |
+<%= link_to 'Locale', locale_posts_path %>
13 app/views/posts/locale.html.erb
@@ -0,0 +1,13 @@
+<h1>Editing locale: <%= @locale %> or <%= I18n.locale %></h1>
+
+<% form_tag(change_locale_posts_url) do %>
+ <p>
+ <%= text_field_tag 'locale' %>
+ <p>
+
+ <p>
+ <%= submit_tag 'Save' %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', posts_path %>
16 app/views/posts/new.html.erb
@@ -0,0 +1,16 @@
+<h1>New post</h1>
+
+<% form_for(@post) do |f| %>
+ <%= hidden_field_tag :locale, I18n.locale %>
+ <%= f.error_messages %>
+
+ <p>
+ <%= f.label :content %><br />
+ <%= f.text_field :content %>
+ </p>
+ <p>
+ <%= f.submit "Create" %>
+ </p>
+<% end %>
+
+<%= link_to 'Back', posts_path(:locale => I18n.locale) %>
22 app/views/posts/show.html.erb
@@ -0,0 +1,22 @@
+<p>
+ <b>Content:</b>
+ <%=h @post.content %>
+</p>
+
+<p>
+ <b>Created At:</b>
+ <%=h @post.created_at %>
+</p>
+
+<p>
+ <b>Created At:</b>
+ <%=h time_ago_in_words(@post.created_at) %>
+</p>
+<p>
+ <b>Created At:</b>
+ <strong><%= @post.created_at.strftime("%B %e, %Y") -%></strong>
+</p>
+
+
+<%= link_to 'Edit', edit_post_path(@post) %> |
+<%= link_to 'Back', posts_path %>
109 config/boot.rb
@@ -0,0 +1,109 @@
+# 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 rescue nil
+ 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'
+ min_version = '1.3.1'
+ unless rubygems_version >= min_version
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
+ exit 1
+ end
+
+ rescue LoadError
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. 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!
65 config/database.yml
@@ -0,0 +1,65 @@
+# SQLite version 3.x
+# gem install sqlite3-ruby (not necessary on OS X Leopard)
+# development:
+# adapter: sqlite3
+# database: db/development.sqlite3
+# pool: 5
+# 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
+# pool: 5
+# timeout: 5000
+#
+# production:
+# adapter: sqlite3
+# database: db/production.sqlite3
+# pool: 5
+# timeout: 5000
+
+# MySQL
+development:
+ adapter: mysql
+ encoding: utf8
+ database: i18n_development
+ username: root
+ password:
+ socket: /tmp/mysql.sock
+
+test:
+ adapter: mysql
+ encoding: utf8
+ database: i18n_test
+ username: root
+ password:
+ socket: /tmp/mysql.sock
+
+production:
+ adapter: mysql
+ encoding: utf8
+ database: i18n_production
+ username: root
+ password:
+ socket: /tmp/mysql.sock
+
+# Postgresql
+# development:
+# adapter: postgresql
+# database: i18n_development
+# host: localhost
+# encoding: utf8
+# test:
+# adapter: postgresql
+# database: i18n_test
+# host: localhost
+# encoding: utf8
+# production:
+# adapter: postgresql
+# database: i18n_production
+# host: localhost
+# encoding: utf8
+#
77 config/environment.rb
@@ -0,0 +1,77 @@
+# 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.2.2' unless defined? RAILS_GEM_VERSION
+
+# Bootstrap the Rails environment, frameworks, and default configuration
+require File.join(File.dirname(__FILE__), 'boot')
+require 'ruby-debug'
+
+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.
+ # You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3)
+ # config.gem "bj"
+ # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
+ # config.gem "sqlite3-ruby", :lib => "sqlite3"
+ # 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. Comment line to use default local time.
+ config.time_zone = 'UTC'
+
+ # The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
+ # All files from config/locales/*.rb,yml are added automatically.
+ # config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
+ # config.i18n.default_locale = :de
+
+ # 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 => '_i18n_backend_database_demo_session',
+ :secret => '20b8e906551e2e8281da765f4ecb72d7184385ecd3858c9a4abe7ee57d1e99ecf28f1511909bacbc37c88845aa9d645ba4d3375b6c675ce23f3785b7c6f11bef'
+ }
+
+ # 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
+ # Please note that observers generated using script/generate observer need to have an _observer suffix
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
+ config.reload_plugins = true
+end
17 config/environments/development.rb
@@ -0,0 +1,17 @@
+# 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
24 config/environments/production.rb
@@ -0,0 +1,24 @@
+# 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
+
+# Enable threaded mode
+# config.threadsafe!
+
+# 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
+
+# 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
22 config/environments/test.rb
@@ -0,0 +1,22 @@
+# 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
2  config/initializers/i18n.rb
@@ -0,0 +1,2 @@
+I18n.backend = I18n::Backend::Database.new # registers the backend
+I18n.backend.cache_store = :memory_store # optional: specify an alternate cache store
10 config/initializers/inflections.rb
@@ -0,0 +1,10 @@
+# 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):
+# ActiveSupport::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
5 config/initializers/mime_types.rb
@@ -0,0 +1,5 @@
+# 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
17 config/initializers/new_rails_defaults.rb
@@ -0,0 +1,17 @@
+# 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.
+
+if defined?(ActiveRecord)
+ # 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
+end
+
+# 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
9 config/locales/en.yml
@@ -0,0 +1,9 @@
+# Sample localization file for English. Add more files in this directory for other locales.
+# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+
+en:
+ hello: "Hello world"
+ hi: "Hi there {{name}}"
+ foo:
+ one: "Foo"
+ other: "Foos"
50 config/routes.rb
@@ -0,0 +1,50 @@
+ActionController::Routing::Routes.draw do |map|
+ map.resources :people
+
+ map.resources :posts, :collection => {:locale => :get, :change_locale => :post}
+
+
+ map.from_plugin 'i18n_backend_database'
+
+ # The priority is based upon order of creation: first created -> highest priority.
+
+ # Sample of regular route:
+ # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
+ # Keep in mind you can assign values other than :controller and :action
+
+ # Sample of named route:
+ # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
+ # This route can be invoked with purchase_url(:id => product.id)
+
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
+ # map.resources :products
+
+ # Sample resource route with options:
+ # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
+
+ # Sample resource route with sub-resources:
+ # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
+
+ # Sample resource route with more complex sub-resources
+ # map.resources :products do |products|
+ # products.resources :comments
+ # products.resources :sales, :collection => { :recent => :get }
+ # end
+
+ # Sample resource route within a namespace:
+ # map.namespace :admin do |admin|
+ # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
+ # admin.resources :products
+ # end
+
+ # You can have the root of your site routed with map.root -- just remember to delete public/index.html.
+ # map.root :controller => "welcome"
+
+ # See how all your routes lay out with "rake routes"
+
+ # Install the default routes as the lowest priority.
+ # Note: These default routes make all actions in every controller accessible via GET requests. You should
+ # consider removing the them or commenting them out if you're using named routes and resources.
+ map.connect ':controller/:action/:id'
+ map.connect ':controller/:action/:id.:format'
+end
BIN  db/development.sqlite3
Binary file not shown
23 db/migrate/20090201233020_create_i18n_tables.rb
@@ -0,0 +1,23 @@
+class CreateI18nTables < ActiveRecord::Migration
+ def self.up
+ create_table :locales do |t|
+ t.string :code
+ t.string :name
+ end
+ add_index :locales, :code
+
+ create_table :translations do |t|
+ t.string :key
+ t.string :raw_key
+ t.string :value
+ t.integer :pluralization_index, :default => 1
+ t.integer :locale_id
+ end
+ add_index :translations, [:locale_id, :key, :pluralization_index]
+ end
+
+ def self.down
+ drop_table :locales
+ drop_table :translations
+ end
+end
13 db/migrate/20090203030734_create_posts.rb
@@ -0,0 +1,13 @@
+class CreatePosts < ActiveRecord::Migration
+ def self.up
+ create_table :posts do |t|
+ t.string :content
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :posts
+ end
+end
15 db/migrate/20090211235214_create_people.rb
@@ -0,0 +1,15 @@
+class CreatePeople < ActiveRecord::Migration
+ def self.up
+ create_table :people do |t|
+ t.string :name
+ t.string :city
+ t.integer :age
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :people
+ end
+end
45 db/schema.rb
@@ -0,0 +1,45 @@
+# 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 => 20090211235214) do
+
+ create_table "locales", :force => true do |t|
+ t.string "code"
+ t.string "name"
+ end
+
+ add_index "locales", ["code"], :name => "index_locales_on_code"
+
+ create_table "people", :force => true do |t|
+ t.string "name"
+ t.string "city"
+ t.integer "age"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "posts", :force => true do |t|
+ t.string "content"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ create_table "translations", :force => true do |t|
+ t.string "key"
+ t.string "raw_key"
+ t.string "value"
+ t.integer "pluralization_index", :default => 1
+ t.integer "locale_id"
+ end
+
+ add_index "translations", ["locale_id", "key", "pluralization_index"], :name => "index_translations_on_locale_id_and_key_and_pluralization_index"
+
+end
BIN  db/test.sqlite3
Binary file not shown
5 doc/README_FOR_APP
@@ -0,0 +1,5 @@
+To build the guides:
+
+* Install source-highlighter (http://www.gnu.org/software/src-highlite/source-highlight.html)
+* Install the mizuho gem (http://github.com/FooBarWidget/mizuho/tree/master)
+* Run `rake guides` from the railties directory
132 lib/tasks/rspec.rake
@@ -0,0 +1,132 @@
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec pkg]))
+raise "To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec-rails" if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec-rails pkg]))
+
+# In rails 1.2, plugins aren't available in the path until they're loaded.
+# Check to see if the rspec plugin is installed first and require
+# it if it is. If not, use the gem version.
+rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec/lib')
+$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
+require 'spec/rake/spectask'
+
+spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? "db:test:prepare" : :noop
+task :noop do
+end
+
+task :default => :spec
+task :stats => "spec:statsetup"
+
+desc "Run all specs in spec directory (excluding plugin specs)"
+Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+end
+
+namespace :spec do
+ desc "Run all specs in spec directory with RCov (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:rcov) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.rcov = true
+ t.rcov_opts = lambda do
+ IO.readlines("#{RAILS_ROOT}/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
+ end
+ end
+
+ desc "Print Specdoc for all specs (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ end
+
+ desc "Print Specdoc for all plugin specs"
+ Spec::Rake::SpecTask.new(:plugin_doc) do |t|
+ t.spec_opts = ["--format", "specdoc", "--dry-run"]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
+ end
+
+ [:models, :controllers, :views, :helpers, :lib].each do |sub|
+ desc "Run the specs under spec/#{sub}"
+ Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
+ end
+ end
+
+ desc "Run the specs under vendor/plugins (except RSpec's own)"
+ Spec::Rake::SpecTask.new(:plugins => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude("vendor/plugins/rspec-rails/*")
+ end
+
+ namespace :plugins do
+ desc "Runs the examples for rspec_on_rails"
+ Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb']
+ end
+ end
+
+ # Setup specs for stats
+ task :statsetup do
+ require 'code_statistics'
+ ::STATS_DIRECTORIES << %w(Model\ specs spec/models) if File.exist?('spec/models')
+ ::STATS_DIRECTORIES << %w(View\ specs spec/views) if File.exist?('spec/views')
+ ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
+ ::STATS_DIRECTORIES << %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
+ ::STATS_DIRECTORIES << %w(Library\ specs spec/lib) if File.exist?('spec/lib')
+ ::CodeStatistics::TEST_TYPES << "Model specs" if File.exist?('spec/models')
+ ::CodeStatistics::TEST_TYPES << "View specs" if File.exist?('spec/views')
+ ::CodeStatistics::TEST_TYPES << "Controller specs" if File.exist?('spec/controllers')
+ ::CodeStatistics::TEST_TYPES << "Helper specs" if File.exist?('spec/helpers')
+ ::CodeStatistics::TEST_TYPES << "Library specs" if File.exist?('spec/lib')
+ ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
+ end
+
+ namespace :db do
+ namespace :fixtures do
+ desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
+ task :load => :environment do
+ require 'active_record/fixtures'
+ ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
+ (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
+ Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
+ end
+ end
+ end
+ end
+
+ namespace :server do
+ daemonized_server_pid = File.expand_path("spec_server.pid", RAILS_ROOT + "/tmp")
+
+ desc "start spec_server."
+ task :start do
+ if File.exist?(daemonized_server_pid)
+ $stderr.puts "spec_server is already running."
+ else
+ $stderr.puts "Starting up spec server."
+ system("ruby", "script/spec_server", "--daemon", "--pid", daemonized_server_pid)
+ end
+ end
+
+ desc "stop spec_server."
+ task :stop do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Shutting down spec_server."
+ system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) &&
+ File.delete(daemonized_server_pid)
+ end
+ end
+
+ desc "reload spec_server."
+ task :restart do
+ unless File.exist?(daemonized_server_pid)
+ $stderr.puts "No server running."
+ else
+ $stderr.puts "Reloading down spec_server."
+ system("kill", "-s", "USR2", File.read(daemonized_server_pid).strip)
+ end
+ end
+ end
+end
8 lib/tasks/test.rake
@@ -0,0 +1,8 @@
+require 'translate_extractor'
+
+namespace :i18n do
+ desc "Enumerate translate_asset"
+ task :translate_asset do
+ TranslateExtractor.enumerate 'image_tag'
+ end
+end
102 lib/translate_extractor.rb
@@ -0,0 +1,102 @@
+# Implements the logic behind the rake tasks for annotations like
+#
+# rake notes
+# rake notes:optimize
+#
+# and friends. See <tt>rake -T notes</tt> and <tt>railties/lib/tasks/annotations.rake</tt>.
+#
+# Annotation objects are triplets <tt>:line</tt>, <tt>:tag</tt>, <tt>:text</tt> that
+# represent the line where the annotation lives, its tag, and its text. Note
+# the filename is not stored.
+#
+# Annotations are looked for in comments and modulus whitespace they have to
+# start with the tag optionally followed by a colon. Everything up to the end
+# of the line (or closing ERb comment tag) is considered to be their text.
+class TranslateExtractor
+ class Annotation < Struct.new(:line, :tag, :text)
+
+ # Returns a representation of the annotation that looks like this:
+ #
+ # [126] [TODO] This algorithm is simple and clearly correct, make it faster.
+ #
+ # If +options+ has a flag <tt>:tag</tt> the tag is shown as in the example above.
+ # Otherwise the string contains just line and text.
+ def to_s(options={})
+ s = "[%3d] " % line
+ s << "[#{tag}] " if options[:tag]
+ s << text
+ end
+ end
+
+ # Prints all annotations with tag +tag+ under the root directories +app+, +lib+,
+ # and +test+ (recursively). Only filenames with extension +.builder+, +.rb+,
+ # +.rxml+, +.rjs+, +.rhtml+, or +.erb+ are taken into account. The +options+
+ # hash is passed to each annotation's +to_s+.
+ #
+ # This class method is the single entry point for the rake tasks.
+ def self.enumerate(tag, options={})
+ extractor = new(tag)
+ extractor.display(extractor.find, options)
+ end
+
+ attr_reader :tag
+
+ def initialize(tag)
+ @tag = tag
+ end
+
+ # Returns a hash that maps filenames under +dirs+ (recursively) to arrays
+ # with their annotations. Only files with annotations are included, and only
+ # those with extension +.builder+, +.rb+, +.rxml+, +.rjs+, +.rhtml+, and +.erb+
+ # are taken into account.
+ def find(dirs=%w(app lib test))
+ dirs.inject({}) { |h, dir| h.update(find_in(dir)) }
+ end
+
+ # Returns a hash that maps filenames under +dir+ (recursively) to arrays
+ # with their annotations. Only files with annotations are included, and only
+ # those with extension +.builder+, +.rb+, +.rxml+, +.rjs+, +.rhtml+, and +.erb+
+ # are taken into account.
+ def find_in(dir)
+ results = {}
+
+ Dir.glob("#{dir}/*") do |item|
+ next if File.basename(item)[0] == ?.
+
+ if File.directory?(item)
+ results.update(find_in(item))
+ elsif item =~ /\.(builder|(r(?:b|xml|js)))$/
+ results.update(extract_annotations_from(item, /#\s*(#{tag}):?\s*(.*)$/))
+ elsif item =~ /\.(rhtml|erb)$/
+ results.update(extract_annotations_from(item, /<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/))
+ end
+ end
+
+ results
+ end
+
+ # If +file+ is the filename of a file that contains annotations this method returns
+ # a hash with a single entry that maps +file+ to an array of its annotations.
+ # Otherwise it returns an empty hash.
+ def extract_annotations_from(file, pattern)
+ lineno = 0
+ result = File.readlines(file).inject([]) do |list, line|
+ lineno += 1
+ next list unless line =~ pattern
+ list << Annotation.new(lineno, $1, $2)
+ end
+ result.empty? ? {} : { file => result }
+ end
+
+ # Prints the mapping from filenames to annotations in +results+ ordered by filename.
+ # The +options+ hash is passed to each annotation's +to_s+.
+ def display(results, options={})
+ results.keys.sort.each do |file|
+ puts "#{file}:"
+ results[file].each do |note|
+ puts " * #{note.to_s(options)}"
+ end
+ puts
+ end
+ end
+end
172,095 log/development.log
172,095 additions, 0 deletions not shown
0  log/production.log
No changes.
0  log/server.log
No changes.
2,363,844 log/test.log
2,363,844 additions, 0 deletions not shown
1  nbproject/private/private.properties
@@ -0,0 +1 @@
+rails.servertype=MONGREL
4 nbproject/private/private.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
110 nbproject/private/rake-d.txt
@@ -0,0 +1,110 @@
+db\:abort_if_pending_migrations=Raises an error if there are pending migrations
+db\:charset=Retrieves the charset for the current environment's database
+db\:collation=Retrieves the collation for the current environment's database
+db\:create=Create the database defined in config/database.yml for the current RAILS_ENV
+db\:create\:all=Create all the local databases defined in config/database.yml
+db\:drop=Drops the database for the current RAILS_ENV
+db\:drop\:all=Drops all the local databases defined in config/database.yml
+db\:fixtures\:identify=Search for a fixture given a LABEL or ID. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures.
+db\:fixtures\:load=Load fixtures into the current environment's database. Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z. Specify an alternative path (eg. spec/fixtures) using FIXTURES_PATH=spec/fixtures.
+db\:migrate=Migrate the database through scripts in db/migrate. Target specific version with VERSION=x. Turn off output with VERBOSE=false.
+db\:migrate\:down=Runs the "down" for a given migration VERSION.
+db\:migrate\:redo=Rollbacks the database one migration and re migrate up. If you want to rollback more than one step, define STEP=x. Target specific version with VERSION=x.
+db\:migrate\:reset=Resets your database using your migrations for the current environment
+db\:migrate\:up=Runs the "up" for a given migration VERSION.
+db\:reset=Drops and recreates the database from db/schema.rb for the current environment.
+db\:rollback=Rolls the schema back to the previous version. Specify the number of steps with STEP=n
+db\:schema\:dump=Create a db/schema.rb file that can be portably used against any DB supported by AR
+db\:schema\:load=Load a schema.rb file into the database
+db\:sessions\:clear=Clear the sessions table
+db\:sessions\:create=Creates a sessions migration for use with CGI::Session::ActiveRecordStore
+db\:structure\:dump=Dump the database structure to a SQL file
+db\:test\:clone=Recreate the test database from the current environment's database schema
+db\:test\:clone_structure=Recreate the test databases from the development structure
+db\:test\:load=Recreate the test database from the current schema.rb
+db\:test\:prepare=Check for pending migrations and load the test schema
+db\:test\:purge=Empty the test database
+db\:version=Retrieves the current schema version number
+default=
+doc=
+doc/api=
+doc/api/index.html=
+doc/app=
+doc/app/index.html=
+doc\:app=Build the app HTML Files
+doc\:clobber=
+doc\:clobber_app=Remove rdoc products
+doc\:clobber_plugins=Remove plugin documentation
+doc\:clobber_rails=Remove rdoc products
+doc\:guides=Generate Rails guides
+doc\:plugins=Generate documentation for all installed plugins
+doc\:plugins\:i18n_backend_database=Generate documentation for the i18n_backend_database plugin
+doc\:rails=Build the rails HTML Files
+doc\:reapp=Force a rebuild of the RDOC files
+doc\:rerails=Force a rebuild of the RDOC files
+environment=
+gems=List the gems that this rails application depends on
+gems\:base=
+gems\:build=Build any native extensions for unpacked gems
+gems\:install=Installs all required gems for this application.
+gems\:refresh_specs=Regenerate gem specifications in correct format.
+gems\:unpack=Unpacks the specified gem into vendor/gems.
+gems\:unpack\:dependencies=Unpacks the specified gems and its dependencies into vendor/gems
+i18n\:clear_cache=Clear cache
+i18n\:install_admin_assets=
+i18n\:populate\:from_rails=Populate the locales and translations tables from all Rails Locale YAML files.
+i18n\:populate\:load_default_locales=Populate default locales
+i18n\:translate_asset=Enumerate translate_asset
+log\:clear=Truncates all *.log files in log/ to zero bytes
+noop=
+notes=Enumerate all annotations
+notes\:custom=Enumerate a custom annotation, specify with ANNOTATION=WTFHAX
+notes\:fixme=Enumerate all FIXME annotations
+notes\:optimize=Enumerate all OPTIMIZE annotations
+notes\:todo=Enumerate all TODO annotations
+rails\:freeze\:edge=Lock to latest Edge Rails, for a specific release use RELEASE=1.2.0
+rails\:freeze\:gems=Lock this application to the current gems (by unpacking them into vendor/rails)
+rails\:unfreeze=Unlock this application from freeze of gems or edge and return to a fluid use of system gems
+rails\:update=Update both configs, scripts and public/javascripts from Rails
+rails\:update\:configs=Update config/boot.rb from your current rails install
+rails\:update\:javascripts=Update your javascripts from your current rails install
+rails\:update\:scripts=Add new scripts to the application script/ directory
+routes=Print out all defined routes in match order, with names.
+secret=Generate a crytographically secure secret key. This is typically used to generate a secret for cookie sessions.
+spec=Run all specs in spec directory (excluding plugin specs)
+spec\:clobber=
+spec\:clobber_rcov=Remove rcov products for rcov
+spec\:controllers=Run the specs under spec/controllers
+spec\:db\:fixtures\:load=Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y
+spec\:doc=Print Specdoc for all specs (excluding plugin specs)
+spec\:helpers=Run the specs under spec/helpers
+spec\:lib=Run the specs under spec/lib
+spec\:models=Run the specs under spec/models
+spec\:plugin_doc=Print Specdoc for all plugin specs
+spec\:plugins=Run the specs under vendor/plugins (except RSpec's own)
+spec\:plugins\:rspec_on_rails=Runs the examples for rspec_on_rails
+spec\:rcov=Run all specs in spec directory with RCov (excluding plugin specs)
+spec\:server\:restart=reload spec_server.
+spec\:server\:start=start spec_server.
+spec\:server\:stop=stop spec_server.
+spec\:statsetup=
+spec\:views=Run the specs under spec/views
+stats=Report code statistics (KLOCs, etc) from the application
+test=Run all unit, functional and integration tests
+test\:benchmark=Run tests for benchmarkdb:test:prepare / Benchmark the performance tests
+test\:functionals=Run tests for functionalsdb:test:prepare / Run the functional tests in test/functional
+test\:integration=Run tests for integrationdb:test:prepare / Run the integration tests in test/integration
+test\:plugins=Run tests for pluginsenvironment / Run the plugin tests in vendor/plugins/*/**/test (or specify with PLUGIN=name)
+test\:profile=Run tests for profiledb:test:prepare / Profile the performance tests
+test\:recent=Run tests for recentdb:test:prepare / Test recent changes
+test\:uncommitted=Run tests for uncommitteddb:test:prepare / Test changes since last checkin (only Subversion and Git)
+test\:units=Run tests for unitsdb:test:prepare / Run the unit tests in test/unit
+time\:zones\:all=Displays names of all time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6
+time\:zones\:local=Displays names of time zones recognized by the Rails TimeZone class with the same offset as the system local time
+time\:zones\:us=Displays names of US time zones recognized by the Rails TimeZone class, grouped by offset. Results can be filtered with optional OFFSET parameter, e.g., OFFSET=-6
+tmp\:cache\:clear=Clears all files and directories in tmp/cache
+tmp\:clear=Clear session, cache, and socket files from tmp/
+tmp\:create=Creates tmp directories for sessions, cache, and sockets
+tmp\:pids\:clear=Clears all files in tmp/pids
+tmp\:sessions\:clear=Clears all files in tmp/sessions
+tmp\:sockets\:clear=Clears all files in tmp/sockets
3  nbproject/project.properties
@@ -0,0 +1,3 @@
+platform.active=Ruby
+rails.port=3000
+source.encoding=UTF-8
9 nbproject/project.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.ruby.railsprojects</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/rails-project/1">
+ <name>i18n_backend_database_demo</name>
+ </data>
+ </configuration>
+</project>
30 public/404.html
@@ -0,0 +1,30 @@
+<!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>
30 public/422.html
@@ -0,0 +1,30 @@
+<!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>
33 public/500.html
@@ -0,0 +1,33 @@
+<!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>
+ <p><small>(If you're the administrator of this website, then please read
+ the log file "<%=h RAILS_ENV %>.log"
+ to find out what went wrong.)</small></p>
+ </div>
+</body>
+</html>
10 public/dispatch.cgi
@@ -0,0 +1,10 @@
+#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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
24 public/dispatch.fcgi
@@ -0,0 +1,24 @@
+#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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!
10 public/dispatch.rb
@@ -0,0 +1,10 @@
+#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/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
BIN  public/es/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
0  public/favicon.ico
No changes.
BIN  public/images/batman.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/custom1_bar.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/custom1_box.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/percentImage.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/percentImage_back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/percentImage_back1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/percentImage_back2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/percentImage_back3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/percentImage_back4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/Thumbs.db
Binary file not shown
BIN  public/images/progress_bar/add.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/custom1_bar.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/custom1_box.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/empty.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/fill.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/get.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/minus.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/percentImage.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/percentImage_back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/percentImage_back1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/percentImage_back2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/percentImage_back3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/percentImage_back4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/progress_bar/set.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  public/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
274 public/index.html
@@ -0,0 +1,274 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title>Ruby on Rails: Welcome aboard</title>
+ <style type="text/css" media="screen">
+ body {
+ margin: 0;
+ margin-bottom: 25px;
+ padding: 0;
+ background-color: #f0f0f0;
+ font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
+ font-size: 13px;
+ color: #333;
+ }
+
+ h1 {
+ font-size: 28px;
+ color: #000;
+ }
+
+ a {color: #03c}
+ a:hover {
+ background-color: #03c;
+ color: white;
+ text-decoration: none;
+ }
+
+
+ #page {
+ background-color: #f0f0f0;
+ width: 750px;
+ margin: 0;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ #content {
+ float: left;
+ background-color: white;
+ border: 3px solid #aaa;
+ border-top: none;
+ padding: 25px;
+ width: 500px;
+ }
+
+ #sidebar {
+ float: right;
+ width: 175px;
+ }
+
+ #footer {
+ clear: both;
+ }
+
+
+ #header, #about, #getting-started {
+ padding-left: 75px;
+ padding-right: 30px;
+ }
+
+
+ #header {
+ background-image: url("images/rails.png");
+ background-repeat: no-repeat;
+ background-position: top left;
+ height: 64px;
+ }
+ #header h1, #header h2 {margin: 0}
+ #header h2 {
+ color: #888;
+ font-weight: normal;
+ font-size: 16px;
+ }
+
+
+ #about h3 {
+ margin: 0;
+ margin-bottom: 10px;
+ font-size: 14px;
+ }
+
+ #about-content {
+ background-color: #ffd;
+ border: 1px solid #fc0;
+ margin-left: -11px;
+ }
+ #about-content table {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size: 11px;
+ border-collapse: collapse;
+ }
+ #about-content td {
+ padding: 10px;
+ padding-top: 3px;
+ padding-bottom: 3px;
+ }
+ #about-content td.name {color: #555}
+ #about-content td.value {color: #000}
+
+ #about-content.failure {
+ background-color: #fcc;
+ border: 1px solid #f00;
+ }
+ #about-content.failure p {
+ margin: 0;
+ padding: 10px;
+ }
+
+
+ #getting-started {
+ border-top: 1px solid #ccc;
+ margin-top: 25px;
+ padding-top: 15px;
+ }
+ #getting-started h1 {
+ margin: 0;
+ font-size: 20px;
+ }
+ #getting-started h2 {
+ margin: 0;
+ font-size: 14px;
+ font-weight: normal;
+ color: #333;
+ margin-bottom: 25px;
+ }
+ #getting-started ol {
+ margin-left: 0;
+ padding-left: 0;
+ }
+ #getting-started li {
+ font-size: 18px;
+ color: #888;
+ margin-bottom: 25px;
+ }
+ #getting-started li h2 {
+ margin: 0;
+ font-weight: normal;
+ font-size: 18px;