Skip to content
This repository
Browse code

Rails 3.1.0.rc1 & Capybara 1.0.0.beta1

  • Loading branch information...
commit d9af160fa98575451688a2fa42c491c6eac13b9d 1 parent f7df4a0
Luismi Cavallé authored

Showing 74 changed files with 289 additions and 18,819 deletions. Show diff stats Hide diff stats

  1. +1 3 Gemfile
  2. +73 63 Gemfile.lock
  3. +0 1  spec/acceptance/getting_started_spec.rb
  4. +1 0  spec/fixtures/rails_project/.gitignore
  5. +12 17 spec/fixtures/rails_project/Gemfile
  6. +12 7 spec/fixtures/rails_project/README
  7. +1 1  spec/fixtures/rails_project/Rakefile
  8. 0  spec/fixtures/rails_project/{public → app/assets}/images/rails.png
  9. +9 0 spec/fixtures/rails_project/app/assets/javascripts/application.js
  10. +7 0 spec/fixtures/rails_project/app/assets/stylesheets/application.css
  11. 0  spec/fixtures/rails_project/{public/stylesheets → app/mailers}/.gitkeep
  12. 0  spec/fixtures/{rails_project_with_steak/public/stylesheets → rails_project/app/models}/.gitkeep
  13. +3 3 spec/fixtures/rails_project/app/views/layouts/application.html.erb
  14. +8 1 spec/fixtures/rails_project/config/application.rb
  15. +3 0  spec/fixtures/rails_project/config/database.yml
  16. +1 3 spec/fixtures/rails_project/config/environments/development.rb
  17. +15 12 spec/fixtures/rails_project/config/environments/production.rb
  18. +5 1 spec/fixtures/rails_project/config/environments/test.rb
  19. +1 1  spec/fixtures/rails_project/config/initializers/secret_token.rb
  20. +12 0 spec/fixtures/rails_project/config/initializers/wrap_parameters.rb
  21. +1 1  spec/fixtures/rails_project/config/locales/en.yml
  22. +1 1  spec/fixtures/rails_project/config/routes.rb
  23. +1 1  spec/fixtures/rails_project/db/seeds.rb
  24. 0  spec/fixtures/rails_project/log/.gitkeep
  25. +10 8 spec/fixtures/rails_project/public/index.html
  26. +0 2  spec/fixtures/rails_project/public/javascripts/application.js
  27. +0 965 spec/fixtures/rails_project/public/javascripts/controls.js
  28. +0 974 spec/fixtures/rails_project/public/javascripts/dragdrop.js
  29. +0 1,123 spec/fixtures/rails_project/public/javascripts/effects.js
  30. +0 6,001 spec/fixtures/rails_project/public/javascripts/prototype.js
  31. +0 191 spec/fixtures/rails_project/public/javascripts/rails.js
  32. 0  spec/fixtures/rails_project/test/fixtures/.gitkeep
  33. 0  spec/fixtures/rails_project/test/functional/.gitkeep
  34. 0  spec/fixtures/rails_project/test/integration/.gitkeep
  35. +4 1 spec/fixtures/rails_project/test/performance/browsing_test.rb
  36. 0  spec/fixtures/rails_project/test/unit/.gitkeep
  37. 0  spec/fixtures/rails_project/vendor/assets/stylesheets/.gitkeep
  38. +1 0  spec/fixtures/rails_project_with_steak/.gitignore
  39. +12 18 spec/fixtures/rails_project_with_steak/Gemfile
  40. +0 121 spec/fixtures/rails_project_with_steak/Gemfile.lock
  41. +12 7 spec/fixtures/rails_project_with_steak/README
  42. +1 1  spec/fixtures/rails_project_with_steak/Rakefile
  43. 0  spec/fixtures/rails_project_with_steak/{public → app/assets}/images/rails.png
  44. +9 0 spec/fixtures/rails_project_with_steak/app/assets/javascripts/application.js
  45. +7 0 spec/fixtures/rails_project_with_steak/app/assets/stylesheets/application.css
  46. 0  spec/fixtures/rails_project_with_steak/app/mailers/.gitkeep
  47. 0  spec/fixtures/rails_project_with_steak/app/models/.gitkeep
  48. +3 3 spec/fixtures/rails_project_with_steak/app/views/layouts/application.html.erb
  49. +8 1 spec/fixtures/rails_project_with_steak/config/application.rb
  50. +3 0  spec/fixtures/rails_project_with_steak/config/database.yml
  51. +1 3 spec/fixtures/rails_project_with_steak/config/environments/development.rb
  52. +15 12 spec/fixtures/rails_project_with_steak/config/environments/production.rb
  53. +5 1 spec/fixtures/rails_project_with_steak/config/environments/test.rb
  54. +1 1  spec/fixtures/rails_project_with_steak/config/initializers/secret_token.rb
  55. +12 0 spec/fixtures/rails_project_with_steak/config/initializers/wrap_parameters.rb
  56. +1 1  spec/fixtures/rails_project_with_steak/config/locales/en.yml
  57. +1 1  spec/fixtures/rails_project_with_steak/config/routes.rb
  58. +1 1  spec/fixtures/rails_project_with_steak/db/seeds.rb
  59. 0  spec/fixtures/rails_project_with_steak/log/.gitkeep
  60. +10 8 spec/fixtures/rails_project_with_steak/public/index.html
  61. +0 2  spec/fixtures/rails_project_with_steak/public/javascripts/application.js
  62. +0 965 spec/fixtures/rails_project_with_steak/public/javascripts/controls.js
  63. +0 974 spec/fixtures/rails_project_with_steak/public/javascripts/dragdrop.js
  64. +0 1,123 spec/fixtures/rails_project_with_steak/public/javascripts/effects.js
  65. +0 6,001 spec/fixtures/rails_project_with_steak/public/javascripts/prototype.js
  66. +0 191 spec/fixtures/rails_project_with_steak/public/javascripts/rails.js
  67. 0  spec/fixtures/rails_project_with_steak/test/fixtures/.gitkeep
  68. 0  spec/fixtures/rails_project_with_steak/test/functional/.gitkeep
  69. 0  spec/fixtures/rails_project_with_steak/test/integration/.gitkeep
  70. +4 1 spec/fixtures/rails_project_with_steak/test/performance/browsing_test.rb
  71. 0  spec/fixtures/rails_project_with_steak/test/unit/.gitkeep
  72. 0  spec/fixtures/rails_project_with_steak/vendor/assets/stylesheets/.gitkeep
  73. +0 1  spec/support/refresh_fixtures_task.rb
  74. +1 1  steak.gemspec
4 Gemfile
... ... @@ -1,9 +1,7 @@
1 1 source 'http://rubygems.org'
2 2 gemspec
3 3
4   -gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git' # Temporal, this should be in the gemspec as a regular dependency
5   -
6   -gem 'rails', '>= 3.0.0'
  4 +gem 'rails', '>= 3.1.0.rc1'
7 5
8 6 gem 'sqlite3', :platforms => :ruby
9 7 gem 'jdbc-sqlite3', :platforms => :jruby
136 Gemfile.lock
... ... @@ -1,94 +1,100 @@
1   -GIT
2   - remote: git://github.com/jnicklas/capybara.git
3   - revision: 36a0aa942b27e142cc72260f9ccf051999627769
4   - specs:
5   - capybara (1.0.0.beta1)
6   - mime-types (>= 1.16)
7   - nokogiri (>= 1.3.3)
8   - rack (>= 1.0.0)
9   - rack-test (>= 0.5.4)
10   - selenium-webdriver (~> 0.2.0)
11   - xpath (~> 0.1.4)
12   -
13 1 PATH
14 2 remote: .
15 3 specs:
16 4 steak (2.0.0.a0)
  5 + capybara (>= 1.0.0.beta1)
17 6 rspec-rails (>= 2.5.0)
18 7
19 8 GEM
20 9 remote: http://rubygems.org/
21 10 specs:
22   - abstract (1.0.0)
23   - actionmailer (3.0.7)
24   - actionpack (= 3.0.7)
25   - mail (~> 2.2.15)
26   - actionpack (3.0.7)
27   - activemodel (= 3.0.7)
28   - activesupport (= 3.0.7)
29   - builder (~> 2.1.2)
30   - erubis (~> 2.6.6)
31   - i18n (~> 0.5.0)
32   - rack (~> 1.2.1)
33   - rack-mount (~> 0.6.14)
34   - rack-test (~> 0.5.7)
35   - tzinfo (~> 0.3.23)
36   - activemodel (3.0.7)
37   - activesupport (= 3.0.7)
38   - builder (~> 2.1.2)
39   - i18n (~> 0.5.0)
40   - activerecord (3.0.7)
41   - activemodel (= 3.0.7)
42   - activesupport (= 3.0.7)
43   - arel (~> 2.0.2)
44   - tzinfo (~> 0.3.23)
  11 + actionmailer (3.1.0.rc1)
  12 + actionpack (= 3.1.0.rc1)
  13 + mail (~> 2.3.0)
  14 + actionpack (3.1.0.rc1)
  15 + activemodel (= 3.1.0.rc1)
  16 + activesupport (= 3.1.0.rc1)
  17 + builder (~> 3.0.0)
  18 + erubis (~> 2.7.0)
  19 + i18n (~> 0.6.0beta1)
  20 + rack (~> 1.3.0.beta2)
  21 + rack-cache (~> 1.0.1)
  22 + rack-mount (~> 0.8.1)
  23 + rack-test (~> 0.6.0)
  24 + sprockets (~> 2.0.0.beta.5)
  25 + tzinfo (~> 0.3.27)
  26 + activemodel (3.1.0.rc1)
  27 + activesupport (= 3.1.0.rc1)
  28 + bcrypt-ruby (~> 2.1.4)
  29 + builder (~> 3.0.0)
  30 + i18n (~> 0.6.0beta1)
  31 + activerecord (3.1.0.rc1)
  32 + activemodel (= 3.1.0.rc1)
  33 + activesupport (= 3.1.0.rc1)
  34 + arel (~> 2.1.1)
  35 + tzinfo (~> 0.3.27)
45 36 activerecord-jdbc-adapter (1.1.1)
46   - activeresource (3.0.7)
47   - activemodel (= 3.0.7)
48   - activesupport (= 3.0.7)
49   - activesupport (3.0.7)
50   - arel (2.0.10)
51   - builder (2.1.2)
  37 + activeresource (3.1.0.rc1)
  38 + activemodel (= 3.1.0.rc1)
  39 + activesupport (= 3.1.0.rc1)
  40 + activesupport (3.1.0.rc1)
  41 + multi_json (~> 1.0)
  42 + arel (2.1.1)
  43 + bcrypt-ruby (2.1.4)
  44 + bcrypt-ruby (2.1.4-java)
  45 + builder (3.0.0)
  46 + capybara (1.0.0.beta1)
  47 + mime-types (>= 1.16)
  48 + nokogiri (>= 1.3.3)
  49 + rack (>= 1.0.0)
  50 + rack-test (>= 0.5.4)
  51 + selenium-webdriver (>= 0.0.27)
  52 + xpath (~> 0.1.4)
52 53 childprocess (0.1.9)
53 54 ffi (~> 1.0.6)
54 55 columnize (0.3.2)
55 56 diff-lcs (1.1.2)
56   - erubis (2.6.6)
57   - abstract (>= 1.0.0)
  57 + erubis (2.7.0)
58 58 ffi (1.0.9)
59 59 ffi (1.0.9-java)
60   - i18n (0.5.0)
  60 + hike (1.0.0)
  61 + i18n (0.6.0)
61 62 jdbc-sqlite3 (3.6.14.2.056-java)
62 63 json_pure (1.5.1)
63 64 linecache (0.43)
64   - mail (2.2.19)
65   - activesupport (>= 2.3.6)
  65 + mail (2.3.0)
66 66 i18n (>= 0.4.0)
67 67 mime-types (~> 1.16)
68 68 treetop (~> 1.4.8)
69 69 mime-types (1.16)
  70 + multi_json (1.0.3)
70 71 nokogiri (1.4.4)
71 72 nokogiri (1.4.4-java)
72 73 weakling (>= 0.0.3)
73 74 polyglot (0.3.1)
74   - rack (1.2.3)
75   - rack-mount (0.6.14)
  75 + rack (1.3.0)
  76 + rack-cache (1.0.2)
  77 + rack (>= 0.4)
  78 + rack-mount (0.8.1)
76 79 rack (>= 1.0.0)
77   - rack-test (0.5.7)
  80 + rack-ssl (1.3.2)
  81 + rack
  82 + rack-test (0.6.0)
78 83 rack (>= 1.0)
79   - rails (3.0.7)
80   - actionmailer (= 3.0.7)
81   - actionpack (= 3.0.7)
82   - activerecord (= 3.0.7)
83   - activeresource (= 3.0.7)
84   - activesupport (= 3.0.7)
  84 + rails (3.1.0.rc1)
  85 + actionmailer (= 3.1.0.rc1)
  86 + actionpack (= 3.1.0.rc1)
  87 + activerecord (= 3.1.0.rc1)
  88 + activeresource (= 3.1.0.rc1)
  89 + activesupport (= 3.1.0.rc1)
85 90 bundler (~> 1.0)
86   - railties (= 3.0.7)
87   - railties (3.0.7)
88   - actionpack (= 3.0.7)
89   - activesupport (= 3.0.7)
  91 + railties (= 3.1.0.rc1)
  92 + railties (3.1.0.rc1)
  93 + actionpack (= 3.1.0.rc1)
  94 + activesupport (= 3.1.0.rc1)
  95 + rack-ssl (~> 1.3.2)
90 96 rake (>= 0.8.7)
91   - thor (~> 0.14.4)
  97 + thor (~> 0.14.6)
92 98 rake (0.9.1)
93 99 rspec (2.6.0)
94 100 rspec-core (~> 2.6.0)
@@ -109,13 +115,18 @@ GEM
109 115 ruby-debug-base (0.10.4)
110 116 linecache (>= 0.3)
111 117 rubyzip (0.9.4)
112   - selenium-webdriver (0.2.0)
  118 + selenium-webdriver (0.2.1)
113 119 childprocess (>= 0.1.7)
114 120 ffi (>= 1.0.7)
115 121 json_pure
116 122 rubyzip
  123 + sprockets (2.0.0.beta.9)
  124 + hike (~> 1.0)
  125 + rack (~> 1.0)
  126 + tilt (~> 1.1, != 1.3.0)
117 127 sqlite3 (1.3.3)
118 128 thor (0.14.6)
  129 + tilt (1.3.2)
119 130 treetop (1.4.9)
120 131 polyglot (>= 0.3.1)
121 132 tzinfo (0.3.27)
@@ -129,9 +140,8 @@ PLATFORMS
129 140
130 141 DEPENDENCIES
131 142 activerecord-jdbc-adapter
132   - capybara!
133 143 jdbc-sqlite3
134   - rails (>= 3.0.0)
  144 + rails (>= 3.1.0.rc.1)
135 145 ruby-debug
136 146 sqlite3
137 147 steak!
1  spec/acceptance/getting_started_spec.rb
@@ -12,7 +12,6 @@
12 12 append_to 'Gemfile', <<-GEMS
13 13 group :test, :development do
14 14 gem 'steak', :path => '#{root_path}'
15   - gem 'capybara', :path => '#{Bundler.load.specs['capybara'].first.full_gem_path}' # Totally temporal. It should be a steak dependency
16 15 end
17 16 GEMS
18 17
1  spec/fixtures/rails_project/.gitignore
@@ -2,3 +2,4 @@
2 2 db/*.sqlite3
3 3 log/*.log
4 4 tmp/
  5 +.sass-cache/
29 spec/fixtures/rails_project/Gemfile
... ... @@ -1,9 +1,9 @@
1 1 source 'http://rubygems.org'
2 2
3   -gem 'rails', '3.0.7'
  3 +gem 'rails', '3.1.0.rc1'
4 4
5 5 # Bundle edge Rails instead:
6   -# gem 'rails', :git => 'git://github.com/rails/rails.git'
  6 +# gem 'rails', :git => 'git://github.com/rails/rails.git'
7 7
8 8 platforms :ruby do
9 9 gem 'sqlite3'
@@ -36,25 +36,20 @@ platforms :jruby do
36 36 end
37 37
38 38
  39 +# Asset template engines
  40 +gem 'json'
  41 +gem 'sass'
  42 +gem 'coffee-script'
  43 +gem 'uglifier'
  44 +
  45 +gem 'jquery-rails'
  46 +
39 47 # Use unicorn as the web server
40 48 # gem 'unicorn'
41 49
42 50 # Deploy with Capistrano
43 51 # gem 'capistrano'
44 52
45   -# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
  53 +# To use debugger
46 54 # gem 'ruby-debug'
47   -# gem 'ruby-debug19', :require => 'ruby-debug'
48   -
49   -# Bundle the extra gems:
50   -# gem 'bj'
51   -# gem 'nokogiri'
52   -# gem 'sqlite3-ruby', :require => 'sqlite3'
53   -# gem 'aws-s3', :require => 'aws/s3'
54   -
55   -# Bundle gems for the local environment. Make sure to
56   -# put test-only gems in this group so their generators
57   -# and rake tasks are available in development mode:
58   -# group :development, :test do
59   -# gem 'webrat'
60   -# end
  55 +
19 spec/fixtures/rails_project/README
@@ -91,7 +91,7 @@ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
91 91
92 92 class WeblogController < ActionController::Base
93 93 def index
94   - @posts = Post.find(:all)
  94 + @posts = Post.all
95 95 debugger
96 96 end
97 97 end
@@ -139,7 +139,7 @@ To reload your controllers and models after launching the console run
139 139 <tt>reload!</tt>
140 140
141 141 More information about irb can be found at:
142   -link:http://www.rubycentral.com/pickaxe/irb.html
  142 +link:http://www.rubycentral.org/pickaxe/irb.html
143 143
144 144
145 145 == dbconsole
@@ -156,6 +156,10 @@ PostgreSQL and SQLite 3.
156 156 The default directory structure of a generated Ruby on Rails application:
157 157
158 158 |-- app
  159 + | |-- assets
  160 + | |-- images
  161 + | |-- javascripts
  162 + | `-- stylesheets
159 163 | |-- controllers
160 164 | |-- helpers
161 165 | |-- mailers
@@ -172,9 +176,6 @@ The default directory structure of a generated Ruby on Rails application:
172 176 | `-- tasks
173 177 |-- log
174 178 |-- public
175   - | |-- images
176   - | |-- javascripts
177   - | `-- stylesheets
178 179 |-- script
179 180 |-- test
180 181 | |-- fixtures
@@ -188,11 +189,16 @@ The default directory structure of a generated Ruby on Rails application:
188 189 | |-- sessions
189 190 | `-- sockets
190 191 `-- vendor
  192 + |-- assets
  193 + `-- stylesheets
191 194 `-- plugins
192 195
193 196 app
194 197 Holds all the code that's specific to this particular application.
195 198
  199 +app/assets
  200 + Contains subdirectories for images, stylesheets, and JavaScript files.
  201 +
196 202 app/controllers
197 203 Holds controllers that should be named like weblogs_controller.rb for
198 204 automated URL mapping. All controllers should descend from
@@ -237,8 +243,7 @@ lib
237 243 the load path.
238 244
239 245 public
240   - The directory available for the web server. Contains subdirectories for
241   - images, stylesheets, and javascripts. Also contains the dispatchers and the
  246 + The directory available for the web server. Also contains the dispatchers and the
242 247 default HTML files. This should be set as the DOCUMENT_ROOT of your web
243 248 server.
244 249
2  spec/fixtures/rails_project/Rakefile
... ... @@ -1,7 +1,7 @@
  1 +#!/usr/bin/env rake
1 2 # Add your own tasks in files placed in lib/tasks ending in .rake,
2 3 # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 4
4 5 require File.expand_path('../config/application', __FILE__)
5   -require 'rake'
6 6
7 7 RailsProject::Application.load_tasks
0  spec/fixtures/rails_project/public/images/rails.png → ...ixtures/rails_project/app/assets/images/rails.png
File renamed without changes
9 spec/fixtures/rails_project/app/assets/javascripts/application.js
... ... @@ -0,0 +1,9 @@
  1 +// This is a manifest file that'll be compiled into including all the files listed below.
  2 +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
  3 +// be included in the compiled file accessible from http://example.com/assets/application.js
  4 +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
  5 +// the compiled file.
  6 +//
  7 +//= require jquery
  8 +//= require jquery_ujs
  9 +//= require_tree .
7 spec/fixtures/rails_project/app/assets/stylesheets/application.css
... ... @@ -0,0 +1,7 @@
  1 +/*
  2 + * This is a manifest file that'll automatically include all the stylesheets available in this directory
  3 + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
  4 + * the top of the compiled file, but it's generally better to create a new file per style scope.
  5 + *= require_self
  6 + *= require_tree .
  7 +*/
0  ...ixtures/rails_project/public/stylesheets/.gitkeep → spec/fixtures/rails_project/app/mailers/.gitkeep
File renamed without changes
0  ...ls_project_with_steak/public/stylesheets/.gitkeep → spec/fixtures/rails_project/app/models/.gitkeep
File renamed without changes
6 spec/fixtures/rails_project/app/views/layouts/application.html.erb
@@ -2,9 +2,9 @@
2 2 <html>
3 3 <head>
4 4 <title>RailsProject</title>
5   - <%= stylesheet_link_tag :all %>
6   - <%= javascript_include_tag :defaults %>
7   - <%= csrf_meta_tag %>
  5 + <%= stylesheet_link_tag "application" %>
  6 + <%= javascript_include_tag "application" %>
  7 + <%= csrf_meta_tags %>
8 8 </head>
9 9 <body>
10 10
9 spec/fixtures/rails_project/config/application.rb
@@ -30,13 +30,20 @@ class Application < Rails::Application
30 30 # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31 31 # config.i18n.default_locale = :de
32 32
  33 + # Please note that JavaScript expansions are *ignored altogether* if the asset
  34 + # pipeline is enabled (see config.assets.enabled below). Put your defaults in
  35 + # app/assets/javascripts/application.js in that case.
  36 + #
33 37 # JavaScript files you want as :defaults (application.js is always included).
34   - # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
  38 + # config.action_view.javascript_expansions[:defaults] = %w(prototype prototype_ujs)
35 39
36 40 # Configure the default encoding used in templates for Ruby 1.9.
37 41 config.encoding = "utf-8"
38 42
39 43 # Configure sensitive parameters which will be filtered from the log file.
40 44 config.filter_parameters += [:password]
  45 +
  46 + # Enable the asset pipeline
  47 + config.assets.enabled = true
41 48 end
42 49 end
3  spec/fixtures/rails_project/config/database.yml
@@ -23,6 +23,9 @@
23 23
24 24 # SQLite version 3.x
25 25 # gem install sqlite3
  26 +#
  27 +# Ensure the SQLite 3 gem is defined in your Gemfile
  28 +# gem 'sqlite3'
26 29 development:
27 30 adapter: sqlite3
28 31 database: db/development.sqlite3
4 spec/fixtures/rails_project/config/environments/development.rb
@@ -3,7 +3,7 @@
3 3
4 4 # In the development environment your application's code is reloaded on
5 5 # every request. This slows down response time but is perfect for development
6   - # since you don't have to restart the webserver when you make code changes.
  6 + # since you don't have to restart the web server when you make code changes.
7 7 config.cache_classes = false
8 8
9 9 # Log error messages when you accidentally call methods on nil.
@@ -11,7 +11,6 @@
11 11
12 12 # Show full error reports and disable caching
13 13 config.consider_all_requests_local = true
14   - config.action_view.debug_rjs = true
15 14 config.action_controller.perform_caching = false
16 15
17 16 # Don't care if the mailer can't send
@@ -23,4 +22,3 @@
23 22 # Only use best-standards-support built into browsers
24 23 config.action_dispatch.best_standards_support = :builtin
25 24 end
26   -
27 spec/fixtures/rails_project/config/environments/production.rb
... ... @@ -1,7 +1,6 @@
1 1 RailsProject::Application.configure do
2 2 # Settings specified here will take precedence over those in config/application.rb
3 3
4   - # The production environment is meant for finished, "live" apps.
5 4 # Code is not reloaded between requests
6 5 config.cache_classes = true
7 6
@@ -9,14 +8,19 @@
9 8 config.consider_all_requests_local = false
10 9 config.action_controller.perform_caching = true
11 10
12   - # Specifies the header that your server uses for sending files
13   - config.action_dispatch.x_sendfile_header = "X-Sendfile"
  11 + # Disable Rails's static asset server (Apache or nginx will already do this)
  12 + config.serve_static_assets = false
14 13
15   - # For nginx:
16   - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
  14 + # Compress both stylesheets and JavaScripts
  15 + config.assets.js_compressor = :uglifier
  16 + config.assets.css_compressor = :scss
  17 +
  18 + # Specifies the header that your server uses for sending files
  19 + # (comment out if your front-end server doesn't support this)
  20 + config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx
17 21
18   - # If you have no front-end server that supports something like X-Sendfile,
19   - # just comment this out and Rails will serve the files
  22 + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  23 + # config.force_ssl = true
20 24
21 25 # See everything in the log (default is :info)
22 26 # config.log_level = :debug
@@ -27,13 +31,12 @@
27 31 # Use a different cache store in production
28 32 # config.cache_store = :mem_cache_store
29 33
30   - # Disable Rails's static asset server
31   - # In production, Apache or nginx will already do this
32   - config.serve_static_assets = false
33   -
34   - # Enable serving of images, stylesheets, and javascripts from an asset server
  34 + # Enable serving of images, stylesheets, and JavaScripts from an asset server
35 35 # config.action_controller.asset_host = "http://assets.example.com"
36 36
  37 + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
  38 + # config.assets.precompile += %w( search.js )
  39 +
37 40 # Disable delivery errors, bad email addresses will be ignored
38 41 # config.action_mailer.raise_delivery_errors = false
39 42
6 spec/fixtures/rails_project/config/environments/test.rb
@@ -7,7 +7,11 @@
7 7 # and recreated between test runs. Don't rely on the data there!
8 8 config.cache_classes = true
9 9
10   - # Log error messages when you accidentally call methods on nil.
  10 + # Configure static asset server for tests with Cache-Control for performance
  11 + config.serve_static_assets = true
  12 + config.static_cache_control = "public, max-age=3600"
  13 +
  14 + # Log error messages when you accidentally call methods on nil
11 15 config.whiny_nils = true
12 16
13 17 # Show full error reports and disable caching
2  spec/fixtures/rails_project/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
4 4 # If you change this key, all old signed cookies will become invalid!
5 5 # Make sure the secret is at least 30 characters and all random,
6 6 # no regular words or you'll be exposed to dictionary attacks.
7   -RailsProject::Application.config.secret_token = '496186afacd59321a33e8d276aca3cbb57f7fb628535ed477b319ff6ea96a167773e873e98a6be771641efc872b2eaa4ebaae221c93eb5ccdcd0e511b3245d43'
  7 +RailsProject::Application.config.secret_token = 'ad1aecc8c76232b49f94176f2eb8817c32a618f2b38f139b2c602876aba4add6cef1f27523a958015b65841fe246c4a900b76702c649a297b0d7a1d4cd0fea8e'
12 spec/fixtures/rails_project/config/initializers/wrap_parameters.rb
... ... @@ -0,0 +1,12 @@
  1 +# Be sure to restart your server when you modify this file.
  2 +#
  3 +# This file contains the settings for ActionController::ParametersWrapper
  4 +# which will be enabled by default in the upcoming version of Ruby on Rails.
  5 +
  6 +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
  7 +ActionController::Base.wrap_parameters :format => [:json]
  8 +
  9 +# Disable root element in JSON by default.
  10 +if defined?(ActiveRecord)
  11 + ActiveRecord::Base.include_root_in_json = false
  12 +end
2  spec/fixtures/rails_project/config/locales/en.yml
... ... @@ -1,5 +1,5 @@
1 1 # Sample localization file for English. Add more files in this directory for other locales.
2   -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
  2 +# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3 3
4 4 en:
5 5 hello: "Hello world"
2  spec/fixtures/rails_project/config/routes.rb
@@ -48,7 +48,7 @@
48 48
49 49 # You can have the root of your site routed with "root"
50 50 # just remember to delete public/index.html.
51   - # root :to => "welcome#index"
  51 + # root :to => 'welcome#index'
52 52
53 53 # See how all your routes lay out with "rake routes"
54 54
2  spec/fixtures/rails_project/db/seeds.rb
@@ -4,4 +4,4 @@
4 4 # Examples:
5 5 #
6 6 # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7   -# Mayor.create(:name => 'Daley', :city => cities.first)
  7 +# Mayor.create(:name => 'Emanuel', :city => cities.first)
0  spec/fixtures/rails_project/log/.gitkeep
No changes.
18 spec/fixtures/rails_project/public/index.html
@@ -52,7 +52,6 @@
52 52 clear: both;
53 53 }
54 54
55   -
56 55 #header, #about, #getting-started {
57 56 padding-left: 75px;
58 57 padding-right: 30px;
@@ -60,7 +59,7 @@
60 59
61 60
62 61 #header {
63   - background-image: url("images/rails.png");
  62 + background-image: url("/assets/rails.png");
64 63 background-repeat: no-repeat;
65 64 background-position: top left;
66 65 height: 64px;
@@ -168,6 +167,9 @@
168 167 margin-bottom: 5px;
169 168 }
170 169
  170 + .filename {
  171 + font-style: italic;
  172 + }
171 173 </style>
172 174 <script type="text/javascript">
173 175 function about() {
@@ -190,10 +192,10 @@
190 192 <li>
191 193 <h3>Browse the documentation</h3>
192 194 <ul class="links">
193   - <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
194   - <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
195   - <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
196 195 <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
  196 + <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
  197 + <li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
  198 + <li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
197 199 </ul>
198 200 </li>
199 201 </ul>
@@ -221,13 +223,13 @@
221 223 </li>
222 224
223 225 <li>
224   - <h2>Set up a default route and remove or rename this file</h2>
225   - <p>Routes are set up in config/routes.rb.</p>
  226 + <h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
  227 + <p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
226 228 </li>
227 229
228 230 <li>
229 231 <h2>Create your database</h2>
230   - <p>Run <code>rake db:migrate</code> to create your database. If you're not using SQLite (the default), edit <code>config/database.yml</code> with your username and password.</p>
  232 + <p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
231 233 </li>
232 234 </ol>
233 235 </div>
2  spec/fixtures/rails_project/public/javascripts/application.js
... ... @@ -1,2 +0,0 @@
1   -// Place your application-specific JavaScript functions and classes here
2   -// This file is automatically included by javascript_include_tag :defaults
965 spec/fixtures/rails_project/public/javascripts/controls.js
... ... @@ -1,965 +0,0 @@
1   -// script.aculo.us controls.js v1.8.3, Thu Oct 08 11:23:33 +0200 2009
2   -
3   -// Copyright (c) 2005-2009 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4   -// (c) 2005-2009 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
5   -// (c) 2005-2009 Jon Tirsen (http://www.tirsen.com)
6   -// Contributors:
7   -// Richard Livsey
8   -// Rahul Bhargava
9   -// Rob Wills
10   -//
11   -// script.aculo.us is freely distributable under the terms of an MIT-style license.
12   -// For details, see the script.aculo.us web site: http://script.aculo.us/
13   -
14   -// Autocompleter.Base handles all the autocompletion functionality
15   -// that's independent of the data source for autocompletion. This
16   -// includes drawing the autocompletion menu, observing keyboard
17   -// and mouse events, and similar.
18   -//
19   -// Specific autocompleters need to provide, at the very least,
20   -// a getUpdatedChoices function that will be invoked every time
21   -// the text inside the monitored textbox changes. This method
22   -// should get the text for which to provide autocompletion by
23   -// invoking this.getToken(), NOT by directly accessing
24   -// this.element.value. This is to allow incremental tokenized
25   -// autocompletion. Specific auto-completion logic (AJAX, etc)
26   -// belongs in getUpdatedChoices.
27   -//
28   -// Tokenized incremental autocompletion is enabled automatically
29   -// when an autocompleter is instantiated with the 'tokens' option
30   -// in the options parameter, e.g.:
31   -// new Ajax.Autocompleter('id','upd', '/url/', { tokens: ',' });
32   -// will incrementally autocomplete with a comma as the token.
33   -// Additionally, ',' in the above example can be replaced with
34   -// a token array, e.g. { tokens: [',', '\n'] } which
35   -// enables autocompletion on multiple tokens. This is most
36   -// useful when one of the tokens is \n (a newline), as it
37   -// allows smart autocompletion after linebreaks.
38   -
39   -if(typeof Effect == 'undefined')
40   - throw("controls.js requires including script.aculo.us' effects.js library");
41   -
42   -var Autocompleter = { };
43   -Autocompleter.Base = Class.create({
44   - baseInitialize: function(element, update, options) {
45   - element = $(element);
46   - this.element = element;
47   - this.update = $(update);
48   - this.hasFocus = false;
49   - this.changed = false;
50   - this.active = false;
51   - this.index = 0;
52   - this.entryCount = 0;
53   - this.oldElementValue = this.element.value;
54   -
55   - if(this.setOptions)
56   - this.setOptions(options);
57   - else
58   - this.options = options || { };
59   -
60   - this.options.paramName = this.options.paramName || this.element.name;
61   - this.options.tokens = this.options.tokens || [];
62   - this.options.frequency = this.options.frequency || 0.4;
63   - this.options.minChars = this.options.minChars || 1;
64   - this.options.onShow = this.options.onShow ||
65   - function(element, update){
66   - if(!update.style.position || update.style.position=='absolute') {
67   - update.style.position = 'absolute';
68   - Position.clone(element, update, {
69   - setHeight: false,
70   - offsetTop: element.offsetHeight
71   - });
72   - }
73   - Effect.Appear(update,{duration:0.15});
74   - };
75   - this.options.onHide = this.options.onHide ||
76   - function(element, update){ new Effect.Fade(update,{duration:0.15}) };
77   -
78   - if(typeof(this.options.tokens) == 'string')
79   - this.options.tokens = new Array(this.options.tokens);
80   - // Force carriage returns as token delimiters anyway
81   - if (!this.options.tokens.include('\n'))
82   - this.options.tokens.push('\n');
83   -
84   - this.observer = null;
85   -
86   - this.element.setAttribute('autocomplete','off');
87   -
88   - Element.hide(this.update);
89   -
90   - Event.observe(this.element, 'blur', this.onBlur.bindAsEventListener(this));
91   - Event.observe(this.element, 'keydown', this.onKeyPress.bindAsEventListener(this));
92   - },
93   -
94   - show: function() {
95   - if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
96   - if(!this.iefix &&
97   - (Prototype.Browser.IE) &&
98   - (Element.getStyle(this.update, 'position')=='absolute')) {
99   - new Insertion.After(this.update,
100   - '<iframe id="' + this.update.id + '_iefix" '+
101   - 'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
102   - 'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
103   - this.iefix = $(this.update.id+'_iefix');
104   - }
105   - if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
106   - },
107   -
108   - fixIEOverlapping: function() {
109   - Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
110   - this.iefix.style.zIndex = 1;
111   - this.update.style.zIndex = 2;
112   - Element.show(this.iefix);
113   - },
114   -
115   - hide: function() {
116   - this.stopIndicator();
117   - if(Element.getStyle(this.update, 'display')!='none') this.options.onHide(this.element, this.update);
118   - if(this.iefix) Element.hide(this.iefix);
119   - },
120   -
121   - startIndicator: function() {
122   - if(this.options.indicator) Element.show(this.options.indicator);
123   - },
124   -
125   - stopIndicator: function() {
126   - if(this.options.indicator) Element.hide(this.options.indicator);
127   - },
128   -
129   - onKeyPress: function(event) {
130   - if(this.active)
131   - switch(event.keyCode) {
132   - case Event.KEY_TAB:
133   - case Event.KEY_RETURN:
134   - this.selectEntry();
135   - Event.stop(event);
136   - case Event.KEY_ESC:
137   - this.hide();
138   - this.active = false;
139   - Event.stop(event);
140   - return;
141   - case Event.KEY_LEFT:
142   - case Event.KEY_RIGHT:
143   - return;
144   - case Event.KEY_UP:
145   - this.markPrevious();
146   - this.render();
147   - Event.stop(event);
148   - return;
149   - case Event.KEY_DOWN:
150   - this.markNext();
151   - this.render();
152   - Event.stop(event);
153   - return;
154   - }
155   - else
156   - if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
157   - (Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
158   -
159   - this.changed = true;
160   - this.hasFocus = true;
161   -
162   - if(this.observer) clearTimeout(this.observer);
163   - this.observer =
164   - setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
165   - },
166   -
167   - activate: function() {
168   - this.changed = false;
169   - this.hasFocus = true;
170   - this.getUpdatedChoices();
171   - },
172   -
173   - onHover: function(event) {
174   - var element = Event.findElement(event, 'LI');
175   - if(this.index != element.autocompleteIndex)
176   - {
177   - this.index = element.autocompleteIndex;
178   - this.render();
179   - }
180   - Event.stop(event);
181   - },
182   -
183   - onClick: function(event) {
184   - var element = Event.findElement(event, 'LI');
185   - this.index = element.autocompleteIndex;
186   - this.selectEntry();
187   - this.hide();
188   - },
189   -
190   - onBlur: function(event) {
191   - // needed to make click events working
192   - setTimeout(this.hide.bind(this), 250);
193   - this.hasFocus = false;
194   - this.active = false;
195   - },
196   -
197   - render: function() {
198   - if(this.entryCount > 0) {
199   - for (var i = 0; i < this.entryCount; i++)
200   - this.index==i ?
201   - Element.addClassName(this.getEntry(i),"selected") :
202   - Element.removeClassName(this.getEntry(i),"selected");
203   - if(this.hasFocus) {
204   - this.show();
205   - this.active = true;
206   - }
207   - } else {
208   - this.active = false;
209   - this.hide();
210   - }
211   - },
212   -
213   - markPrevious: function() {
214   - if(this.index > 0) this.index--;
215   - else this.index = this.entryCount-1;
216   - this.getEntry(this.index).scrollIntoView(true);
217   - },
218   -
219   - markNext: function() {
220   - if(this.index < this.entryCount-1) this.index++;
221   - else this.index = 0;
222   - this.getEntry(this.index).scrollIntoView(false);
223   - },
224   -
225   - getEntry: function(index) {
226   - return this.update.firstChild.childNodes[index];
227   - },
228   -
229   - getCurrentEntry: function() {
230   - return this.getEntry(this.index);
231   - },
232   -
233   - selectEntry: function() {
234   - this.active = false;
235   - this.updateElement(this.getCurrentEntry());
236   - },
237   -
238   - updateElement: function(selectedElement) {
239   - if (this.options.updateElement) {
240   - this.options.updateElement(selectedElement);
241   - return;
242   - }
243   - var value = '';
244   - if (this.options.select) {
245   - var nodes = $(selectedElement).select('.' + this.options.select) || [];
246   - if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
247   - } else
248   - value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
249   -
250   - var bounds = this.getTokenBounds();
251   - if (bounds[0] != -1) {
252   - var newValue = this.element.value.substr(0, bounds[0]);
253   - var whitespace = this.element.value.substr(bounds[0]).match(/^\s+/);
254   - if (whitespace)
255   - newValue += whitespace[0];
256   - this.element.value = newValue + value + this.element.value.substr(bounds[1]);
257   - } else {
258   - this.element.value = value;
259   - }
260   - this.oldElementValue = this.element.value;
261   - this.element.focus();
262   -
263   - if (this.options.afterUpdateElement)
264   - this.options.afterUpdateElement(this.element, selectedElement);
265   - },
266   -
267   - updateChoices: function(choices) {
268   - if(!this.changed && this.hasFocus) {
269   - this.update.innerHTML = choices;
270   - Element.cleanWhitespace(this.update);
271   - Element.cleanWhitespace(this.update.down());
272   -
273   - if(this.update.firstChild && this.update.down().childNodes) {
274   - this.entryCount =
275   - this.update.down().childNodes.length;
276   - for (var i = 0; i < this.entryCount; i++) {
277   - var entry = this.getEntry(i);
278   - entry.autocompleteIndex = i;
279   - this.addObservers(entry);
280   - }
281   - } else {
282   - this.entryCount = 0;
283   - }
284   -
285   - this.stopIndicator();
286   - this.index = 0;
287   -
288   - if(this.entryCount==1 && this.options.autoSelect) {
289   - this.selectEntry();
290   - this.hide();
291   - } else {
292   - this.render();
293   - }
294   - }
295   - },
296   -
297   - addObservers: function(element) {
298   - Event.observe(element, "mouseover", this.onHover.bindAsEventListener(this));
299   - Event.observe(element, "click", this.onClick.bindAsEventListener(this));
300   - },
301   -
302   - onObserverEvent: function() {
303   - this.changed = false;
304   - this.tokenBounds = null;
305   - if(this.getToken().length>=this.options.minChars) {
306   - this.getUpdatedChoices();
307   - } else {
308   - this.active = false;
309   - this.hide();
310   - }
311   - this.oldElementValue = this.element.value;
312   - },
313   -
314   - getToken: function() {
315   - var bounds = this.getTokenBounds();
316   - return this.element.value.substring(bounds[0], bounds[1]).strip();
317   - },
318   -
319   - getTokenBounds: function() {
320   - if (null != this.tokenBounds) return this.tokenBounds;
321   - var value = this.element.value;
322   - if (value.strip().empty()) return [-1, 0];
323   - var diff = arguments.callee.getFirstDifferencePos(value, this.oldElementValue);
324   - var offset = (diff == this.oldElementValue.length ? 1 : 0);
325   - var prevTokenPos = -1, nextTokenPos = value.length;
326   - var tp;
327   - for (var index = 0, l = this.options.tokens.length; index < l; ++index) {
328   - tp = value.lastIndexOf(this.options.tokens[index], diff + offset - 1);
329   - if (tp > prevTokenPos) prevTokenPos = tp;
330   - tp = value.indexOf(this.options.tokens[index], diff + offset);
331   - if (-1 != tp && tp < nextTokenPos) nextTokenPos = tp;
332   - }
333   - return (this.tokenBounds = [prevTokenPos + 1, nextTokenPos]);
334   - }
335   -});
336   -
337   -Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos = function(newS, oldS) {
338   - var boundary = Math.min(newS.length, oldS.length);
339   - for (var index = 0; index < boundary; ++index)
340   - if (newS[index] != oldS[index])
341   - return index;
342   - return boundary;
343   -};
344   -
345   -Ajax.Autocompleter = Class.create(Autocompleter.Base, {
346   - initialize: function(element, update, url, options) {
347   - this.baseInitialize(element, update, options);
348   - this.options.asynchronous = true;
349   - this.options.onComplete = this.onComplete.bind(this);
350   - this.options.defaultParams = this.options.parameters || null;
351   - this.url = url;
352   - },
353   -
354   - getUpdatedChoices: function() {
355   - this.startIndicator();
356   -
357   - var entry = encodeURIComponent(this.options.paramName) + '=' +
358   - encodeURIComponent(this.getToken());
359   -
360   - this.options.parameters = this.options.callback ?
361   - this.options.callback(this.element, entry) : entry;
362   -
363   - if(this.options.defaultParams)
364   - this.options.parameters += '&' + this.options.defaultParams;
365   -
366   - new Ajax.Request(this.url, this.options);
367   - },
368   -
369   - onComplete: function(request) {
370   - this.updateChoices(request.responseText);
371   - }
372   -});
373   -
374   -// The local array autocompleter. Used when you'd prefer to
375   -// inject an array of autocompletion options into the page, rather
376   -// than sending out Ajax queries, which can be quite slow sometimes.
377   -//
378   -// The constructor takes four parameters. The first two are, as usual,
379   -// the id of the monitored textbox, and id of the autocompletion menu.
380   -// The third is the array you want to autocomplete from, and the fourth
381   -// is the options block.
382   -//
383   -// Extra local autocompletion options:
384   -// - choices - How many autocompletion choices to offer
385   -//
386   -// - partialSearch - If false, the autocompleter will match entered
387   -// text only at the beginning of strings in the
388   -// autocomplete array. Defaults to true, which will
389   -// match text at the beginning of any *word* in the
390   -// strings in the autocomplete array. If you want to
391   -// search anywhere in the string, additionally set
392   -// the option fullSearch to true (default: off).
393   -//
394   -// - fullSsearch - Search anywhere in autocomplete array strings.
395   -//
396   -// - partialChars - How many characters to enter before triggering
397   -// a partial match (unlike minChars, which defines
398   -// how many characters are required to do any match
399   -// at all). Defaults to 2.
400   -//
401   -// - ignoreCase - Whether to ignore case when autocompleting.
402   -// Defaults to true.
403   -//
404   -// It's possible to pass in a custom function as the 'selector'
405   -// option, if you prefer to write your own autocompletion logic.
406   -// In that case, the other options above will not apply unless
407   -// you support them.
408   -
409   -Autocompleter.Local = Class.create(Autocompleter.Base, {
410   - initialize: function(element, update, array, options) {
411   - this.baseInitialize(element, update, options);
412   - this.options.array = array;
413   - },
414   -
415   - getUpdatedChoices: function() {
416   - this.updateChoices(this.options.selector(this));
417   - },
418   -
419   - setOptions: function(options) {
420   - this.options = Object.extend({
421   - choices: 10,
422   - partialSearch: true,
423   - partialChars: 2,
424   - ignoreCase: true,
425   - fullSearch: false,
426   - selector: function(instance) {
427   - var ret = []; // Beginning matches
428   - var partial = []; // Inside matches
429   - var entry = instance.getToken();
430   - var count = 0;
431   -
432   - for (var i = 0; i < instance.options.array.length &&
433   - ret.length < instance.options.choices ; i++) {
434   -
435   - var elem = instance.options.array[i];
436   - var foundPos = instance.options.ignoreCase ?
437   - elem.toLowerCase().indexOf(entry.toLowerCase()) :
438   - elem.indexOf(entry);
439