railties 4.0.13 → 4.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +155 -385
  3. data/README.rdoc +1 -1
  4. data/bin/rails +1 -1
  5. data/lib/rails.rb +11 -13
  6. data/lib/rails/all.rb +1 -0
  7. data/lib/rails/api/task.rb +9 -12
  8. data/lib/rails/app_rails_loader.rb +2 -2
  9. data/lib/rails/application.rb +154 -149
  10. data/lib/rails/application/configuration.rb +1 -14
  11. data/lib/rails/application/default_middleware_stack.rb +99 -0
  12. data/lib/rails/application/finisher.rb +2 -0
  13. data/lib/rails/application_controller.rb +16 -0
  14. data/lib/rails/cli.rb +1 -2
  15. data/lib/rails/commands.rb +2 -94
  16. data/lib/rails/commands/application.rb +2 -28
  17. data/lib/rails/commands/commands_tasks.rb +174 -0
  18. data/lib/rails/commands/console.rb +2 -2
  19. data/lib/rails/commands/dbconsole.rb +1 -1
  20. data/lib/rails/commands/plugin.rb +23 -0
  21. data/lib/rails/commands/runner.rb +1 -1
  22. data/lib/rails/commands/server.rb +46 -30
  23. data/lib/rails/configuration.rb +4 -1
  24. data/lib/rails/console/helpers.rb +6 -0
  25. data/lib/rails/engine.rb +29 -18
  26. data/lib/rails/engine/commands.rb +1 -1
  27. data/lib/rails/engine/railties.rb +0 -8
  28. data/lib/rails/generators.rb +4 -3
  29. data/lib/rails/generators/actions.rb +1 -1
  30. data/lib/rails/generators/active_model.rb +0 -8
  31. data/lib/rails/generators/app_base.rb +213 -74
  32. data/lib/rails/generators/base.rb +17 -16
  33. data/lib/rails/generators/erb/scaffold/templates/_form.html.erb +1 -1
  34. data/lib/rails/generators/erb/scaffold/templates/index.html.erb +1 -3
  35. data/lib/rails/generators/migration.rb +18 -26
  36. data/lib/rails/generators/named_base.rb +4 -7
  37. data/lib/rails/generators/rails/app/app_generator.rb +91 -5
  38. data/lib/rails/generators/rails/app/templates/Gemfile +20 -15
  39. data/lib/rails/generators/rails/app/templates/Rakefile +1 -1
  40. data/lib/rails/generators/rails/app/templates/app/assets/javascripts/application.js.tt +2 -0
  41. data/lib/rails/generators/rails/app/templates/app/assets/stylesheets/application.css +5 -3
  42. data/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +5 -1
  43. data/lib/rails/generators/rails/app/templates/config/application.rb +2 -0
  44. data/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml +7 -10
  45. data/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml +11 -31
  46. data/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml +25 -29
  47. data/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml +8 -10
  48. data/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml +8 -11
  49. data/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml +6 -3
  50. data/lib/rails/generators/rails/app/templates/config/databases/mysql.yml +8 -22
  51. data/lib/rails/generators/rails/app/templates/config/databases/oracle.yml +7 -9
  52. data/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +9 -12
  53. data/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml +8 -8
  54. data/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml +7 -17
  55. data/lib/rails/generators/rails/app/templates/config/environment.rb +1 -1
  56. data/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt +2 -5
  57. data/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt +1 -1
  58. data/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +1 -4
  59. data/lib/rails/generators/rails/app/templates/config/initializers/session_store.rb.tt +1 -1
  60. data/lib/rails/generators/rails/app/templates/config/routes.rb +1 -1
  61. data/lib/rails/generators/rails/app/templates/config/{initializers/secret_token.rb.tt → secrets.yml} +10 -2
  62. data/lib/rails/generators/rails/app/templates/public/404.html +20 -11
  63. data/lib/rails/generators/rails/app/templates/public/422.html +20 -11
  64. data/lib/rails/generators/rails/app/templates/public/500.html +19 -10
  65. data/lib/rails/generators/rails/controller/USAGE +1 -0
  66. data/lib/rails/generators/rails/controller/controller_generator.rb +35 -1
  67. data/lib/rails/generators/rails/generator/USAGE +1 -0
  68. data/lib/rails/generators/rails/generator/generator_generator.rb +2 -0
  69. data/lib/rails/generators/rails/model/USAGE +5 -5
  70. data/lib/rails/generators/rails/{plugin_new → plugin}/USAGE +0 -0
  71. data/lib/rails/generators/rails/{plugin_new/plugin_new_generator.rb → plugin/plugin_generator.rb} +10 -4
  72. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/%name%.gemspec +1 -0
  73. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/Gemfile +16 -1
  74. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/MIT-LICENSE +0 -0
  75. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/README.rdoc +0 -0
  76. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/Rakefile +0 -0
  77. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/app/controllers/%name%/application_controller.rb.tt +0 -0
  78. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/app/helpers/%name%/application_helper.rb.tt +0 -0
  79. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/app/mailers/.empty_directory +0 -0
  80. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/app/models/.empty_directory +0 -0
  81. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/app/views/layouts/%name%/application.html.erb.tt +0 -0
  82. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/bin/rails.tt +0 -4
  83. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/config/routes.rb +0 -0
  84. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/gitignore +0 -0
  85. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/lib/%name%.rb +0 -0
  86. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/lib/%name%/engine.rb +0 -0
  87. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/lib/%name%/version.rb +0 -0
  88. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/lib/tasks/%name%_tasks.rake +0 -0
  89. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/rails/application.rb +1 -0
  90. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/rails/boot.rb +0 -0
  91. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/rails/javascripts.js +0 -0
  92. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/rails/routes.rb +0 -0
  93. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/rails/stylesheets.css +5 -3
  94. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/test/%name%_test.rb +0 -0
  95. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/test/integration/navigation_test.rb +0 -0
  96. data/lib/rails/generators/rails/{plugin_new → plugin}/templates/test/test_helper.rb +0 -0
  97. data/lib/rails/generators/rails/scaffold_controller/scaffold_controller_generator.rb +1 -1
  98. data/lib/rails/generators/rails/scaffold_controller/templates/controller.rb +2 -2
  99. data/lib/rails/generators/resource_helpers.rb +20 -5
  100. data/lib/rails/generators/test_unit/generator/generator_generator.rb +26 -0
  101. data/lib/rails/generators/test_unit/generator/templates/generator_test.rb +16 -0
  102. data/lib/rails/generators/test_unit/mailer/mailer_generator.rb +8 -1
  103. data/lib/rails/generators/test_unit/mailer/templates/preview.rb +11 -0
  104. data/lib/rails/generators/testing/assertions.rb +1 -1
  105. data/lib/rails/generators/testing/behaviour.rb +3 -13
  106. data/lib/rails/info.rb +5 -3
  107. data/lib/rails/info_controller.rb +5 -15
  108. data/lib/rails/mailers_controller.rb +73 -0
  109. data/lib/rails/paths.rb +13 -18
  110. data/lib/rails/rack/debugger.rb +2 -2
  111. data/lib/rails/rack/logger.rb +1 -1
  112. data/lib/rails/railtie.rb +38 -2
  113. data/lib/rails/source_annotation_extractor.rb +2 -2
  114. data/lib/rails/tasks.rb +0 -2
  115. data/lib/rails/tasks/documentation.rake +0 -5
  116. data/lib/rails/tasks/engine.rake +1 -1
  117. data/lib/rails/tasks/framework.rake +2 -12
  118. data/lib/rails/templates/layouts/application.html.erb +2 -2
  119. data/lib/rails/templates/rails/mailers/email.html.erb +98 -0
  120. data/lib/rails/templates/rails/mailers/index.html.erb +8 -0
  121. data/lib/rails/templates/rails/mailers/mailer.html.erb +6 -0
  122. data/lib/rails/test_help.rb +4 -1
  123. data/lib/rails/test_unit/sub_test_task.rb +44 -3
  124. data/lib/rails/test_unit/testing.rake +9 -111
  125. data/lib/rails/version.rb +3 -3
  126. data/lib/rails/welcome_controller.rb +4 -3
  127. metadata +99 -76
  128. data/lib/rails/commands/plugin_new.rb +0 -9
  129. data/lib/rails/generators/actions/create_migration.rb +0 -68
@@ -33,12 +33,11 @@
33
33
  #
34
34
  # For more details on the installation and the connection parameters below,
35
35
  # please refer to the latest documents at http://rubyforge.org/docman/?group_id=2361
36
-
37
- development:
36
+ #
37
+ default: &default
38
38
  adapter: ibm_db
39
39
  username: db2inst1
40
40
  password:
41
- database: <%= app_name[0,4] %>_dev
42
41
  #schema: db2inst1
43
42
  #host: localhost
44
43
  #port: 50000
@@ -51,36 +50,17 @@ development:
51
50
  #authentication: SERVER
52
51
  #parameterized: false
53
52
 
53
+ development:
54
+ <<: *default
55
+ database: <%= app_name[0,4] %>_dev
56
+
57
+ # Warning: The database defined as "test" will be erased and
58
+ # re-generated from your development database when you run "rake".
59
+ # Do not set this db to the same as development or production.
54
60
  test:
55
- adapter: ibm_db
56
- username: db2inst1
57
- password:
61
+ <<: *default
58
62
  database: <%= app_name[0,4] %>_tst
59
- #schema: db2inst1
60
- #host: localhost
61
- #port: 50000
62
- #account: my_account
63
- #app_user: my_app_user
64
- #application: my_application
65
- #workstation: my_workstation
66
- #security: SSL
67
- #timeout: 10
68
- #authentication: SERVER
69
- #parameterized: false
70
63
 
71
64
  production:
72
- adapter: ibm_db
73
- username: db2inst1
74
- password:
65
+ <<: *default
75
66
  database: <%= app_name[0,8] %>
76
- #schema: db2inst1
77
- #host: localhost
78
- #port: 50000
79
- #account: my_account
80
- #app_user: my_app_user
81
- #application: my_application
82
- #workstation: my_workstation
83
- #security: SSL
84
- #timeout: 10
85
- #authentication: SERVER
86
- #parameterized: false
@@ -5,58 +5,54 @@
5
5
  # Configure using Gemfile:
6
6
  # gem 'activerecord-jdbcmssql-adapter'
7
7
  #
8
- #development:
9
- # adapter: mssql
10
- # username: <%= app_name %>
11
- # password:
12
- # host: localhost
13
- # database: <%= app_name %>_development
8
+ # development:
9
+ # adapter: mssql
10
+ # username: <%= app_name %>
11
+ # password:
12
+ # host: localhost
13
+ # database: <%= app_name %>_development
14
14
  #
15
15
  # Warning: The database defined as "test" will be erased and
16
16
  # re-generated from your development database when you run "rake".
17
17
  # Do not set this db to the same as development or production.
18
18
  #
19
- #test:
20
- # adapter: mssql
21
- # username: <%= app_name %>
22
- # password:
23
- # host: localhost
24
- # database: <%= app_name %>_test
19
+ # test:
20
+ # adapter: mssql
21
+ # username: <%= app_name %>
22
+ # password:
23
+ # host: localhost
24
+ # database: <%= app_name %>_test
25
25
  #
26
- #production:
27
- # adapter: mssql
28
- # username: <%= app_name %>
29
- # password:
30
- # host: localhost
31
- # database: <%= app_name %>_production
26
+ # production:
27
+ # adapter: mssql
28
+ # username: <%= app_name %>
29
+ # password:
30
+ # host: localhost
31
+ # database: <%= app_name %>_production
32
32
 
33
33
  # If you are using oracle, db2, sybase, informix or prefer to use the plain
34
34
  # JDBC adapter, configure your database setting as the example below (requires
35
35
  # you to download and manually install the database vendor's JDBC driver .jar
36
- # file). See your driver documentation for the apropriate driver class and
36
+ # file). See your driver documentation for the appropriate driver class and
37
37
  # connection string:
38
38
 
39
- development:
39
+ default: &default
40
40
  adapter: jdbc
41
41
  username: <%= app_name %>
42
42
  password:
43
43
  driver:
44
+
45
+ development:
46
+ <<: *default
44
47
  url: jdbc:db://localhost/<%= app_name %>_development
45
48
 
46
49
  # Warning: The database defined as "test" will be erased and
47
50
  # re-generated from your development database when you run "rake".
48
51
  # Do not set this db to the same as development or production.
49
-
50
52
  test:
51
- adapter: jdbc
52
- username: <%= app_name %>
53
- password:
54
- driver:
53
+ <<: *default
55
54
  url: jdbc:db://localhost/<%= app_name %>_test
56
55
 
57
56
  production:
58
- adapter: jdbc
59
- username: <%= app_name %>
60
- password:
61
- driver:
57
+ <<: *default
62
58
  url: jdbc:db://localhost/<%= app_name %>_production
@@ -8,26 +8,24 @@
8
8
  #
9
9
  # And be sure to use new-style password hashing:
10
10
  # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
- development:
11
+ #
12
+ default: &default
12
13
  adapter: mysql
13
- database: <%= app_name %>_development
14
14
  username: root
15
15
  password:
16
16
  host: localhost
17
17
 
18
+ development:
19
+ <<: *default
20
+ database: <%= app_name %>_development
21
+
18
22
  # Warning: The database defined as "test" will be erased and
19
23
  # re-generated from your development database when you run "rake".
20
24
  # Do not set this db to the same as development or production.
21
25
  test:
22
- adapter: mysql
26
+ <<: *default
23
27
  database: <%= app_name %>_test
24
- username: root
25
- password:
26
- host: localhost
27
28
 
28
29
  production:
29
- adapter: mysql
30
+ <<: *default
30
31
  database: <%= app_name %>_production
31
- username: root
32
- password:
33
- host: localhost
@@ -2,14 +2,17 @@
2
2
  #
3
3
  # Configure Using Gemfile
4
4
  # gem 'activerecord-jdbcpostgresql-adapter'
5
-
6
- development:
5
+ #
6
+ default: &default
7
7
  adapter: postgresql
8
8
  encoding: unicode
9
- database: <%= app_name %>_development
10
9
  username: <%= app_name %>
11
10
  password:
12
11
 
12
+ development:
13
+ <<: *default
14
+ database: <%= app_name %>_development
15
+
13
16
  # Connect on a TCP socket. Omitted by default since the client uses a
14
17
  # domain socket that doesn't need configuration. Windows does not have
15
18
  # domain sockets, so uncomment these lines.
@@ -29,15 +32,9 @@ development:
29
32
  # re-generated from your development database when you run "rake".
30
33
  # Do not set this db to the same as development or production.
31
34
  test:
32
- adapter: postgresql
33
- encoding: unicode
35
+ <<: *default
34
36
  database: <%= app_name %>_test
35
- username: <%= app_name %>
36
- password:
37
37
 
38
38
  production:
39
- adapter: postgresql
40
- encoding: unicode
39
+ <<: *default
41
40
  database: <%= app_name %>_production
42
- username: <%= app_name %>
43
- password:
@@ -4,17 +4,20 @@
4
4
  # Configure Using Gemfile
5
5
  # gem 'activerecord-jdbcsqlite3-adapter'
6
6
  #
7
- development:
7
+ default: &default
8
8
  adapter: sqlite3
9
+
10
+ development:
11
+ <<: *default
9
12
  database: db/development.sqlite3
10
13
 
11
14
  # Warning: The database defined as "test" will be erased and
12
15
  # re-generated from your development database when you run "rake".
13
16
  # Do not set this db to the same as development or production.
14
17
  test:
15
- adapter: sqlite3
18
+ <<: *default
16
19
  database: db/test.sqlite3
17
20
 
18
21
  production:
19
- adapter: sqlite3
22
+ <<: *default
20
23
  database: db/production.sqlite3
@@ -8,10 +8,10 @@
8
8
  #
9
9
  # And be sure to use new-style password hashing:
10
10
  # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
- development:
11
+ #
12
+ default: &default
12
13
  adapter: mysql2
13
14
  encoding: utf8
14
- database: <%= app_name %>_development
15
15
  pool: 5
16
16
  username: root
17
17
  password:
@@ -21,31 +21,17 @@ development:
21
21
  host: localhost
22
22
  <% end -%>
23
23
 
24
+ development:
25
+ <<: *default
26
+ database: <%= app_name %>_development
27
+
24
28
  # Warning: The database defined as "test" will be erased and
25
29
  # re-generated from your development database when you run "rake".
26
30
  # Do not set this db to the same as development or production.
27
31
  test:
28
- adapter: mysql2
29
- encoding: utf8
32
+ <<: *default
30
33
  database: <%= app_name %>_test
31
- pool: 5
32
- username: root
33
- password:
34
- <% if mysql_socket -%>
35
- socket: <%= mysql_socket %>
36
- <% else -%>
37
- host: localhost
38
- <% end -%>
39
34
 
40
35
  production:
41
- adapter: mysql2
42
- encoding: utf8
36
+ <<: *default
43
37
  database: <%= app_name %>_production
44
- pool: 5
45
- username: root
46
- password:
47
- <% if mysql_socket -%>
48
- socket: <%= mysql_socket %>
49
- <% else -%>
50
- host: localhost
51
- <% end -%>
@@ -16,24 +16,22 @@
16
16
  # prefetch_rows: 100
17
17
  # cursor_sharing: similar
18
18
  #
19
-
20
- development:
19
+ default: &default
21
20
  adapter: oracle
22
- database: <%= app_name %>_development
23
21
  username: <%= app_name %>
24
22
  password:
25
23
 
24
+ development:
25
+ <<: *default
26
+ database: <%= app_name %>_development
27
+
26
28
  # Warning: The database defined as "test" will be erased and
27
29
  # re-generated from your development database when you run "rake".
28
30
  # Do not set this db to the same as development or production.
29
31
  test:
30
- adapter: oracle
32
+ <<: *default
31
33
  database: <%= app_name %>_test
32
- username: <%= app_name %>
33
- password:
34
34
 
35
35
  production:
36
- adapter: oracle
36
+ <<: *default
37
37
  database: <%= app_name %>_production
38
- username: <%= app_name %>
39
- password:
@@ -14,14 +14,19 @@
14
14
  # Configure Using Gemfile
15
15
  # gem 'pg'
16
16
  #
17
- development:
17
+ default: &default
18
18
  adapter: postgresql
19
19
  encoding: unicode
20
- database: <%= app_name %>_development
20
+ # For details on connection pooling, see rails configuration guide
21
+ # http://guides.rubyonrails.org/configuring.html#database-pooling
21
22
  pool: 5
22
23
  username: <%= app_name %>
23
24
  password:
24
25
 
26
+ development:
27
+ <<: *default
28
+ database: <%= app_name %>_development
29
+
25
30
  # Connect on a TCP socket. Omitted by default since the client uses a
26
31
  # domain socket that doesn't need configuration. Windows does not have
27
32
  # domain sockets, so uncomment these lines.
@@ -44,17 +49,9 @@ development:
44
49
  # re-generated from your development database when you run "rake".
45
50
  # Do not set this db to the same as development or production.
46
51
  test:
47
- adapter: postgresql
48
- encoding: unicode
52
+ <<: *default
49
53
  database: <%= app_name %>_test
50
- pool: 5
51
- username: <%= app_name %>
52
- password:
53
54
 
54
55
  production:
55
- adapter: postgresql
56
- encoding: unicode
56
+ <<: *default
57
57
  database: <%= app_name %>_production
58
- pool: 5
59
- username: <%= app_name %>
60
- password:
@@ -3,23 +3,23 @@
3
3
  #
4
4
  # Ensure the SQLite 3 gem is defined in your Gemfile
5
5
  # gem 'sqlite3'
6
- development:
6
+ #
7
+ default: &default
7
8
  adapter: sqlite3
8
- database: db/development.sqlite3
9
9
  pool: 5
10
10
  timeout: 5000
11
11
 
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
12
16
  # Warning: The database defined as "test" will be erased and
13
17
  # re-generated from your development database when you run "rake".
14
18
  # Do not set this db to the same as development or production.
15
19
  test:
16
- adapter: sqlite3
20
+ <<: *default
17
21
  database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
22
 
21
23
  production:
22
- adapter: sqlite3
24
+ <<: *default
23
25
  database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -21,37 +21,27 @@
21
21
  # If you can connect with "tsql -S servername", your basic FreeTDS installation is working.
22
22
  # 'man tsql' for more info
23
23
  # Set timeout to a larger number if valid queries against a live db fail
24
-
25
- development:
24
+ #
25
+ default: &default
26
26
  adapter: sqlserver
27
27
  encoding: utf8
28
28
  reconnect: false
29
- database: <%= app_name %>_development
30
29
  username: <%= app_name %>
31
30
  password:
32
31
  timeout: 25
33
32
  dataserver: from_freetds.conf
34
33
 
34
+ development:
35
+ <<: *default
36
+ database: <%= app_name %>_development
35
37
 
36
38
  # Warning: The database defined as "test" will be erased and
37
39
  # re-generated from your development database when you run "rake".
38
40
  # Do not set this db to the same as development or production.
39
41
  test:
40
- adapter: sqlserver
41
- encoding: utf8
42
- reconnect: false
42
+ <<: *default
43
43
  database: <%= app_name %>_test
44
- username: <%= app_name %>
45
- password:
46
- timeout: 25
47
- dataserver: from_freetds.conf
48
44
 
49
45
  production:
50
- adapter: sqlserver
51
- encoding: utf8
52
- reconnect: false
46
+ <<: *default
53
47
  database: <%= app_name %>_production
54
- username: <%= app_name %>
55
- password:
56
- timeout: 25
57
- dataserver: from_freetds.conf
@@ -2,4 +2,4 @@
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
4
  # Initialize the Rails application.
5
- <%= app_const %>.initialize!
5
+ Rails.application.initialize!