rails 2.3.18 → 7.1.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +2 -2
  3. data/README.md +97 -0
  4. metadata +207 -332
  5. data/CHANGELOG +0 -2193
  6. data/README +0 -243
  7. data/Rakefile +0 -365
  8. data/bin/about +0 -4
  9. data/bin/console +0 -3
  10. data/bin/dbconsole +0 -3
  11. data/bin/destroy +0 -3
  12. data/bin/generate +0 -3
  13. data/bin/performance/benchmarker +0 -3
  14. data/bin/performance/profiler +0 -3
  15. data/bin/plugin +0 -3
  16. data/bin/rails +0 -21
  17. data/bin/runner +0 -3
  18. data/bin/server +0 -3
  19. data/builtin/rails_info/rails/info.rb +0 -131
  20. data/builtin/rails_info/rails/info_controller.rb +0 -9
  21. data/builtin/rails_info/rails/info_helper.rb +0 -2
  22. data/builtin/rails_info/rails_info_controller.rb +0 -2
  23. data/configs/databases/frontbase.yml +0 -28
  24. data/configs/databases/ibm_db.yml +0 -62
  25. data/configs/databases/mysql.yml +0 -60
  26. data/configs/databases/oracle.yml +0 -39
  27. data/configs/databases/postgresql.yml +0 -51
  28. data/configs/databases/sqlite2.yml +0 -19
  29. data/configs/databases/sqlite3.yml +0 -22
  30. data/configs/empty.log +0 -0
  31. data/configs/initializers/backtrace_silencers.rb +0 -7
  32. data/configs/initializers/cookie_verification_secret.rb +0 -7
  33. data/configs/initializers/inflections.rb +0 -10
  34. data/configs/initializers/mime_types.rb +0 -5
  35. data/configs/initializers/new_rails_defaults.rb +0 -21
  36. data/configs/initializers/session_store.rb +0 -15
  37. data/configs/locales/en.yml +0 -5
  38. data/configs/routes.rb +0 -43
  39. data/configs/seeds.rb +0 -7
  40. data/dispatches/config.ru +0 -7
  41. data/dispatches/dispatch.fcgi +0 -24
  42. data/dispatches/dispatch.rb +0 -10
  43. data/dispatches/gateway.cgi +0 -97
  44. data/doc/README_FOR_APP +0 -2
  45. data/environments/boot.rb +0 -114
  46. data/environments/development.rb +0 -17
  47. data/environments/environment.rb +0 -41
  48. data/environments/production.rb +0 -28
  49. data/environments/test.rb +0 -28
  50. data/fresh_rakefile +0 -10
  51. data/helpers/application_controller.rb +0 -10
  52. data/helpers/application_helper.rb +0 -3
  53. data/helpers/performance_test.rb +0 -9
  54. data/helpers/test_helper.rb +0 -38
  55. data/html/404.html +0 -30
  56. data/html/422.html +0 -30
  57. data/html/500.html +0 -30
  58. data/html/favicon.ico +0 -0
  59. data/html/images/rails.png +0 -0
  60. data/html/index.html +0 -275
  61. data/html/javascripts/application.js +0 -2
  62. data/html/javascripts/controls.js +0 -963
  63. data/html/javascripts/dragdrop.js +0 -973
  64. data/html/javascripts/effects.js +0 -1128
  65. data/html/javascripts/prototype.js +0 -4320
  66. data/html/robots.txt +0 -5
  67. data/lib/code_statistics.rb +0 -107
  68. data/lib/commands/about.rb +0 -3
  69. data/lib/commands/console.rb +0 -45
  70. data/lib/commands/dbconsole.rb +0 -87
  71. data/lib/commands/destroy.rb +0 -6
  72. data/lib/commands/generate.rb +0 -6
  73. data/lib/commands/ncgi/listener +0 -86
  74. data/lib/commands/ncgi/tracker +0 -69
  75. data/lib/commands/performance/benchmarker.rb +0 -24
  76. data/lib/commands/performance/profiler.rb +0 -50
  77. data/lib/commands/plugin.rb +0 -968
  78. data/lib/commands/runner.rb +0 -54
  79. data/lib/commands/server.rb +0 -114
  80. data/lib/commands/update.rb +0 -4
  81. data/lib/commands.rb +0 -17
  82. data/lib/console_app.rb +0 -30
  83. data/lib/console_sandbox.rb +0 -6
  84. data/lib/console_with_helpers.rb +0 -5
  85. data/lib/dispatcher.rb +0 -24
  86. data/lib/fcgi_handler.rb +0 -239
  87. data/lib/initializer.rb +0 -1152
  88. data/lib/performance_test_help.rb +0 -5
  89. data/lib/rails/backtrace_cleaner.rb +0 -54
  90. data/lib/rails/gem_builder.rb +0 -21
  91. data/lib/rails/gem_dependency.rb +0 -317
  92. data/lib/rails/plugin/loader.rb +0 -198
  93. data/lib/rails/plugin/locator.rb +0 -100
  94. data/lib/rails/plugin.rb +0 -179
  95. data/lib/rails/rack/debugger.rb +0 -23
  96. data/lib/rails/rack/log_tailer.rb +0 -35
  97. data/lib/rails/rack/metal.rb +0 -51
  98. data/lib/rails/rack/static.rb +0 -46
  99. data/lib/rails/rack.rb +0 -8
  100. data/lib/rails/vendor_gem_source_index.rb +0 -140
  101. data/lib/rails/version.rb +0 -9
  102. data/lib/rails_generator/base.rb +0 -266
  103. data/lib/rails_generator/commands.rb +0 -621
  104. data/lib/rails_generator/generated_attribute.rb +0 -47
  105. data/lib/rails_generator/generators/applications/app/USAGE +0 -9
  106. data/lib/rails_generator/generators/applications/app/app_generator.rb +0 -266
  107. data/lib/rails_generator/generators/applications/app/scm/git.rb +0 -18
  108. data/lib/rails_generator/generators/applications/app/scm/scm.rb +0 -8
  109. data/lib/rails_generator/generators/applications/app/scm/svn.rb +0 -7
  110. data/lib/rails_generator/generators/applications/app/template_runner.rb +0 -401
  111. data/lib/rails_generator/generators/components/controller/USAGE +0 -30
  112. data/lib/rails_generator/generators/components/controller/controller_generator.rb +0 -43
  113. data/lib/rails_generator/generators/components/controller/templates/controller.rb +0 -7
  114. data/lib/rails_generator/generators/components/controller/templates/functional_test.rb +0 -8
  115. data/lib/rails_generator/generators/components/controller/templates/helper.rb +0 -2
  116. data/lib/rails_generator/generators/components/controller/templates/helper_test.rb +0 -4
  117. data/lib/rails_generator/generators/components/controller/templates/view.html.erb +0 -2
  118. data/lib/rails_generator/generators/components/helper/USAGE +0 -24
  119. data/lib/rails_generator/generators/components/helper/helper_generator.rb +0 -25
  120. data/lib/rails_generator/generators/components/helper/templates/helper.rb +0 -2
  121. data/lib/rails_generator/generators/components/helper/templates/helper_test.rb +0 -4
  122. data/lib/rails_generator/generators/components/integration_test/USAGE +0 -8
  123. data/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +0 -16
  124. data/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +0 -10
  125. data/lib/rails_generator/generators/components/mailer/USAGE +0 -16
  126. data/lib/rails_generator/generators/components/mailer/mailer_generator.rb +0 -30
  127. data/lib/rails_generator/generators/components/mailer/templates/fixture.erb +0 -3
  128. data/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -0
  129. data/lib/rails_generator/generators/components/mailer/templates/mailer.rb +0 -15
  130. data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +0 -20
  131. data/lib/rails_generator/generators/components/mailer/templates/view.erb +0 -3
  132. data/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -0
  133. data/lib/rails_generator/generators/components/metal/USAGE +0 -8
  134. data/lib/rails_generator/generators/components/metal/metal_generator.rb +0 -8
  135. data/lib/rails_generator/generators/components/metal/templates/metal.rb +0 -12
  136. data/lib/rails_generator/generators/components/migration/USAGE +0 -29
  137. data/lib/rails_generator/generators/components/migration/migration_generator.rb +0 -20
  138. data/lib/rails_generator/generators/components/migration/templates/migration.rb +0 -11
  139. data/lib/rails_generator/generators/components/model/USAGE +0 -27
  140. data/lib/rails_generator/generators/components/model/model_generator.rb +0 -52
  141. data/lib/rails_generator/generators/components/model/templates/fixtures.yml +0 -23
  142. data/lib/rails_generator/generators/components/model/templates/migration.rb +0 -16
  143. data/lib/rails_generator/generators/components/model/templates/model.rb +0 -5
  144. data/lib/rails_generator/generators/components/model/templates/unit_test.rb +0 -8
  145. data/lib/rails_generator/generators/components/observer/USAGE +0 -13
  146. data/lib/rails_generator/generators/components/observer/observer_generator.rb +0 -16
  147. data/lib/rails_generator/generators/components/observer/templates/observer.rb +0 -2
  148. data/lib/rails_generator/generators/components/observer/templates/unit_test.rb +0 -8
  149. data/lib/rails_generator/generators/components/performance_test/USAGE +0 -8
  150. data/lib/rails_generator/generators/components/performance_test/performance_test_generator.rb +0 -16
  151. data/lib/rails_generator/generators/components/performance_test/templates/performance_test.rb +0 -9
  152. data/lib/rails_generator/generators/components/plugin/USAGE +0 -25
  153. data/lib/rails_generator/generators/components/plugin/plugin_generator.rb +0 -39
  154. data/lib/rails_generator/generators/components/plugin/templates/MIT-LICENSE +0 -20
  155. data/lib/rails_generator/generators/components/plugin/templates/README +0 -13
  156. data/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -23
  157. data/lib/rails_generator/generators/components/plugin/templates/USAGE +0 -8
  158. data/lib/rails_generator/generators/components/plugin/templates/generator.rb +0 -8
  159. data/lib/rails_generator/generators/components/plugin/templates/init.rb +0 -1
  160. data/lib/rails_generator/generators/components/plugin/templates/install.rb +0 -1
  161. data/lib/rails_generator/generators/components/plugin/templates/plugin.rb +0 -1
  162. data/lib/rails_generator/generators/components/plugin/templates/tasks.rake +0 -4
  163. data/lib/rails_generator/generators/components/plugin/templates/test_helper.rb +0 -4
  164. data/lib/rails_generator/generators/components/plugin/templates/uninstall.rb +0 -1
  165. data/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +0 -8
  166. data/lib/rails_generator/generators/components/resource/USAGE +0 -23
  167. data/lib/rails_generator/generators/components/resource/resource_generator.rb +0 -76
  168. data/lib/rails_generator/generators/components/resource/templates/controller.rb +0 -2
  169. data/lib/rails_generator/generators/components/resource/templates/functional_test.rb +0 -8
  170. data/lib/rails_generator/generators/components/resource/templates/helper.rb +0 -2
  171. data/lib/rails_generator/generators/components/resource/templates/helper_test.rb +0 -4
  172. data/lib/rails_generator/generators/components/scaffold/USAGE +0 -29
  173. data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +0 -103
  174. data/lib/rails_generator/generators/components/scaffold/templates/controller.rb +0 -83
  175. data/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +0 -45
  176. data/lib/rails_generator/generators/components/scaffold/templates/helper.rb +0 -2
  177. data/lib/rails_generator/generators/components/scaffold/templates/helper_test.rb +0 -4
  178. data/lib/rails_generator/generators/components/scaffold/templates/layout.html.erb +0 -17
  179. data/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -54
  180. data/lib/rails_generator/generators/components/scaffold/templates/view_edit.html.erb +0 -18
  181. data/lib/rails_generator/generators/components/scaffold/templates/view_index.html.erb +0 -24
  182. data/lib/rails_generator/generators/components/scaffold/templates/view_new.html.erb +0 -17
  183. data/lib/rails_generator/generators/components/scaffold/templates/view_show.html.erb +0 -10
  184. data/lib/rails_generator/generators/components/session_migration/USAGE +0 -10
  185. data/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +0 -18
  186. data/lib/rails_generator/generators/components/session_migration/templates/migration.rb +0 -16
  187. data/lib/rails_generator/lookup.rb +0 -249
  188. data/lib/rails_generator/manifest.rb +0 -53
  189. data/lib/rails_generator/options.rb +0 -150
  190. data/lib/rails_generator/scripts/destroy.rb +0 -29
  191. data/lib/rails_generator/scripts/generate.rb +0 -7
  192. data/lib/rails_generator/scripts/update.rb +0 -12
  193. data/lib/rails_generator/scripts.rb +0 -89
  194. data/lib/rails_generator/secret_key_generator.rb +0 -24
  195. data/lib/rails_generator/simple_logger.rb +0 -46
  196. data/lib/rails_generator/spec.rb +0 -44
  197. data/lib/rails_generator.rb +0 -46
  198. data/lib/railties_path.rb +0 -1
  199. data/lib/ruby_version_check.rb +0 -17
  200. data/lib/rubyprof_ext.rb +0 -35
  201. data/lib/source_annotation_extractor.rb +0 -102
  202. data/lib/tasks/annotations.rake +0 -20
  203. data/lib/tasks/databases.rake +0 -436
  204. data/lib/tasks/documentation.rake +0 -93
  205. data/lib/tasks/framework.rake +0 -146
  206. data/lib/tasks/gems.rake +0 -78
  207. data/lib/tasks/log.rake +0 -9
  208. data/lib/tasks/middleware.rake +0 -7
  209. data/lib/tasks/misc.rake +0 -63
  210. data/lib/tasks/rails.rb +0 -14
  211. data/lib/tasks/routes.rake +0 -18
  212. data/lib/tasks/statistics.rake +0 -17
  213. data/lib/tasks/testing.rake +0 -139
  214. data/lib/tasks/tmp.rake +0 -37
  215. data/lib/test_help.rb +0 -38
  216. data/lib/webrick_server.rb +0 -156
  217. data/railties.gemspec +0 -22
data/README DELETED
@@ -1,243 +0,0 @@
1
- == Welcome to Rails
2
-
3
- Rails is a web-application framework that includes everything needed to create
4
- database-backed web applications according to the Model-View-Control pattern.
5
-
6
- This pattern splits the view (also called the presentation) into "dumb" templates
7
- that are primarily responsible for inserting pre-built data in between HTML tags.
8
- The model contains the "smart" domain objects (such as Account, Product, Person,
9
- Post) that holds all the business logic and knows how to persist themselves to
10
- a database. The controller handles the incoming requests (such as Save New Account,
11
- Update Product, Show Post) by manipulating the model and directing data to the view.
12
-
13
- In Rails, the model is handled by what's called an object-relational mapping
14
- layer entitled Active Record. This layer allows you to present the data from
15
- database rows as objects and embellish these data objects with business logic
16
- methods. You can read more about Active Record in
17
- link:files/vendor/rails/activerecord/README.html.
18
-
19
- The controller and view are handled by the Action Pack, which handles both
20
- layers by its two parts: Action View and Action Controller. These two layers
21
- are bundled in a single package due to their heavy interdependence. This is
22
- unlike the relationship between the Active Record and Action Pack that is much
23
- more separate. Each of these packages can be used independently outside of
24
- Rails. You can read more about Action Pack in
25
- link:files/vendor/rails/actionpack/README.html.
26
-
27
-
28
- == Getting Started
29
-
30
- 1. At the command prompt, start a new Rails application using the <tt>rails</tt> command
31
- and your application name. Ex: rails myapp
32
- 2. Change directory into myapp and start the web server: <tt>script/server</tt> (run with --help for options)
33
- 3. Go to http://localhost:3000/ and get "Welcome aboard: You're riding the Rails!"
34
- 4. Follow the guidelines to start developing your application
35
-
36
-
37
- == Web Servers
38
-
39
- By default, Rails will try to use Mongrel if it's are installed when started with script/server, otherwise Rails will use WEBrick, the webserver that ships with Ruby. But you can also use Rails
40
- with a variety of other web servers.
41
-
42
- Mongrel is a Ruby-based webserver with a C component (which requires compilation) that is
43
- suitable for development and deployment of Rails applications. If you have Ruby Gems installed,
44
- getting up and running with mongrel is as easy as: <tt>gem install mongrel</tt>.
45
- More info at: http://mongrel.rubyforge.org
46
-
47
- Say other Ruby web servers like Thin and Ebb or regular web servers like Apache or LiteSpeed or
48
- Lighttpd or IIS. The Ruby web servers are run through Rack and the latter can either be setup to use
49
- FCGI or proxy to a pack of Mongrels/Thin/Ebb servers.
50
-
51
- == Apache .htaccess example for FCGI/CGI
52
-
53
- # General Apache options
54
- AddHandler fastcgi-script .fcgi
55
- AddHandler cgi-script .cgi
56
- Options +FollowSymLinks +ExecCGI
57
-
58
- # If you don't want Rails to look in certain directories,
59
- # use the following rewrite rules so that Apache won't rewrite certain requests
60
- #
61
- # Example:
62
- # RewriteCond %{REQUEST_URI} ^/notrails.*
63
- # RewriteRule .* - [L]
64
-
65
- # Redirect all requests not available on the filesystem to Rails
66
- # By default the cgi dispatcher is used which is very slow
67
- #
68
- # For better performance replace the dispatcher with the fastcgi one
69
- #
70
- # Example:
71
- # RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
72
- RewriteEngine On
73
-
74
- # If your Rails application is accessed via an Alias directive,
75
- # then you MUST also set the RewriteBase in this htaccess file.
76
- #
77
- # Example:
78
- # Alias /myrailsapp /path/to/myrailsapp/public
79
- # RewriteBase /myrailsapp
80
-
81
- RewriteRule ^$ index.html [QSA]
82
- RewriteRule ^([^.]+)$ $1.html [QSA]
83
- RewriteCond %{REQUEST_FILENAME} !-f
84
- RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
85
-
86
- # In case Rails experiences terminal errors
87
- # Instead of displaying this message you can supply a file here which will be rendered instead
88
- #
89
- # Example:
90
- # ErrorDocument 500 /500.html
91
-
92
- ErrorDocument 500 "<h2>Application error</h2>Rails application failed to start properly"
93
-
94
-
95
- == Debugging Rails
96
-
97
- Sometimes your application goes wrong. Fortunately there are a lot of tools that
98
- will help you debug it and get it back on the rails.
99
-
100
- First area to check is the application log files. Have "tail -f" commands running
101
- on the server.log and development.log. Rails will automatically display debugging
102
- and runtime information to these files. Debugging info will also be shown in the
103
- browser on requests from 127.0.0.1.
104
-
105
- You can also log your own messages directly into the log file from your code using
106
- the Ruby logger class from inside your controllers. Example:
107
-
108
- class WeblogController < ActionController::Base
109
- def destroy
110
- @weblog = Weblog.find(params[:id])
111
- @weblog.destroy
112
- logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
113
- end
114
- end
115
-
116
- The result will be a message in your log file along the lines of:
117
-
118
- Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1
119
-
120
- More information on how to use the logger is at http://www.ruby-doc.org/core/
121
-
122
- Also, Ruby documentation can be found at http://www.ruby-lang.org/ including:
123
-
124
- * The Learning Ruby (Pickaxe) Book: http://www.ruby-doc.org/docs/ProgrammingRuby/
125
- * Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
126
-
127
- These two online (and free) books will bring you up to speed on the Ruby language
128
- and also on programming in general.
129
-
130
-
131
- == Debugger
132
-
133
- Debugger support is available through the debugger command when you start your Mongrel or
134
- Webrick server with --debugger. This means that you can break out of execution at any point
135
- in the code, investigate and change the model, AND then resume execution!
136
- You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
137
- Example:
138
-
139
- class WeblogController < ActionController::Base
140
- def index
141
- @posts = Post.find(:all)
142
- debugger
143
- end
144
- end
145
-
146
- So the controller will accept the action, run the first line, then present you
147
- with a IRB prompt in the server window. Here you can do things like:
148
-
149
- >> @posts.inspect
150
- => "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
151
- #<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
152
- >> @posts.first.title = "hello from a debugger"
153
- => "hello from a debugger"
154
-
155
- ...and even better is that you can examine how your runtime objects actually work:
156
-
157
- >> f = @posts.first
158
- => #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
159
- >> f.
160
- Display all 152 possibilities? (y or n)
161
-
162
- Finally, when you're ready to resume execution, you enter "cont"
163
-
164
-
165
- == Console
166
-
167
- You can interact with the domain model by starting the console through <tt>script/console</tt>.
168
- Here you'll have all parts of the application configured, just like it is when the
169
- application is running. You can inspect domain models, change values, and save to the
170
- database. Starting the script without arguments will launch it in the development environment.
171
- Passing an argument will specify a different environment, like <tt>script/console production</tt>.
172
-
173
- To reload your controllers and models after launching the console run <tt>reload!</tt>
174
-
175
- == dbconsole
176
-
177
- You can go to the command line of your database directly through <tt>script/dbconsole</tt>.
178
- You would be connected to the database with the credentials defined in database.yml.
179
- Starting the script without arguments will connect you to the development database. Passing an
180
- argument will connect you to a different database, like <tt>script/dbconsole production</tt>.
181
- Currently works for mysql, postgresql and sqlite.
182
-
183
- == Description of Contents
184
-
185
- app
186
- Holds all the code that's specific to this particular application.
187
-
188
- app/controllers
189
- Holds controllers that should be named like weblogs_controller.rb for
190
- automated URL mapping. All controllers should descend from ApplicationController
191
- which itself descends from ActionController::Base.
192
-
193
- app/models
194
- Holds models that should be named like post.rb.
195
- Most models will descend from ActiveRecord::Base.
196
-
197
- app/views
198
- Holds the template files for the view that should be named like
199
- weblogs/index.html.erb for the WeblogsController#index action. All views use eRuby
200
- syntax.
201
-
202
- app/views/layouts
203
- Holds the template files for layouts to be used with views. This models the common
204
- header/footer method of wrapping views. In your views, define a layout using the
205
- <tt>layout :default</tt> and create a file named default.html.erb. Inside default.html.erb,
206
- call <% yield %> to render the view using this layout.
207
-
208
- app/helpers
209
- Holds view helpers that should be named like weblogs_helper.rb. These are generated
210
- for you automatically when using script/generate for controllers. Helpers can be used to
211
- wrap functionality for your views into methods.
212
-
213
- config
214
- Configuration files for the Rails environment, the routing map, the database, and other dependencies.
215
-
216
- db
217
- Contains the database schema in schema.rb. db/migrate contains all
218
- the sequence of Migrations for your schema.
219
-
220
- doc
221
- This directory is where your application documentation will be stored when generated
222
- using <tt>rake doc:app</tt>
223
-
224
- lib
225
- Application specific libraries. Basically, any kind of custom code that doesn't
226
- belong under controllers, models, or helpers. This directory is in the load path.
227
-
228
- public
229
- The directory available for the web server. Contains subdirectories for images, stylesheets,
230
- and javascripts. Also contains the dispatchers and the default HTML files. This should be
231
- set as the DOCUMENT_ROOT of your web server.
232
-
233
- script
234
- Helper scripts for automation and generation.
235
-
236
- test
237
- Unit and functional tests along with fixtures. When using the script/generate scripts, template
238
- test files will be generated for you and placed in this directory.
239
-
240
- vendor
241
- External libraries that the application depends on. Also includes the plugins subdirectory.
242
- If the app has frozen rails, those gems also go here, under vendor/rails/.
243
- This directory is in the load path.
data/Rakefile DELETED
@@ -1,365 +0,0 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rdoc/task'
4
- require 'rubygems/package_task'
5
-
6
- require 'date'
7
- require 'rbconfig'
8
-
9
- require File.join(File.dirname(__FILE__), 'lib/rails', 'version')
10
-
11
- PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
12
- PKG_NAME = 'rails'
13
- PKG_VERSION = Rails::VERSION::STRING + PKG_BUILD
14
- PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
15
- PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"
16
-
17
- RELEASE_NAME = "REL #{PKG_VERSION}"
18
-
19
- RUBY_FORGE_PROJECT = "rails"
20
- RUBY_FORGE_USER = "webster132"
21
-
22
-
23
- task :default => :test
24
-
25
- ## This is required until the regular test task
26
- ## below passes. It's not ideal, but at least
27
- ## we can see the failures
28
- task :test do
29
- Dir['test/**/*_test.rb'].all? do |file|
30
- ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME'))
31
- system(ruby, '-Itest', file)
32
- end or raise "Failures"
33
- end
34
-
35
- Rake::TestTask.new("regular_test") do |t|
36
- t.libs << 'test'
37
- t.pattern = 'test/**/*_test.rb'
38
- t.warning = true
39
- t.verbose = true
40
- end
41
-
42
-
43
- BASE_DIRS = %w(
44
- app
45
- config/environments
46
- config/initializers
47
- config/locales
48
- db
49
- doc
50
- log
51
- lib
52
- lib/tasks
53
- public
54
- script
55
- script/performance
56
- test
57
- vendor
58
- vendor/plugins
59
- tmp/sessions
60
- tmp/cache
61
- tmp/sockets
62
- tmp/pids
63
- )
64
-
65
- APP_DIRS = %w( models controllers helpers views views/layouts )
66
- PUBLIC_DIRS = %w( images javascripts stylesheets )
67
- TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
68
-
69
- LOG_FILES = %w( server.log development.log test.log production.log )
70
- HTML_FILES = %w( 422.html 404.html 500.html index.html robots.txt favicon.ico images/rails.png
71
- javascripts/prototype.js javascripts/application.js
72
- javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js )
73
- BIN_FILES = %w( about console destroy generate performance/benchmarker performance/profiler runner server plugin )
74
-
75
- VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport activeresource railties )
76
-
77
-
78
- desc "Generates a fresh Rails package with documentation"
79
- task :fresh_rails => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_vendor_libraries, :copy_ties_content, :generate_documentation ]
80
-
81
- desc "Generates a fresh Rails package using GEMs with documentation"
82
- task :fresh_gem_rails => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_ties_content, :copy_gem_environment ]
83
-
84
- desc "Generates a fresh Rails package without documentation (faster)"
85
- task :fresh_rails_without_docs => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_vendor_libraries, :copy_ties_content ]
86
-
87
- desc "Generates a fresh Rails package without documentation (faster)"
88
- task :fresh_rails_without_docs_using_links => [ :clean, :make_dir_structure, :initialize_file_stubs, :link_vendor_libraries, :copy_ties_content ]
89
-
90
- desc "Generates minimal Rails package using symlinks"
91
- task :dev => [ :clean, :make_dir_structure, :initialize_file_stubs, :link_vendor_libraries, :copy_ties_content ]
92
-
93
- desc "Packages the fresh Rails package with documentation"
94
- task :package => [ :clean, :fresh_rails ] do
95
- system %{cd ..; tar -czvf #{PKG_NAME}-#{PKG_VERSION}.tgz #{PKG_NAME}}
96
- system %{cd ..; zip -r #{PKG_NAME}-#{PKG_VERSION}.zip #{PKG_NAME}}
97
- end
98
-
99
- task :clean do
100
- rm_rf PKG_DESTINATION
101
- end
102
-
103
- # Get external spinoffs -------------------------------------------------------------------
104
-
105
- desc "Updates railties to the latest version of the javascript spinoffs"
106
- task :update_js do
107
- for js in %w( prototype controls dragdrop effects )
108
- rm "html/javascripts/#{js}.js"
109
- cp "./../actionpack/lib/action_view/helpers/javascripts/#{js}.js", "html/javascripts"
110
- end
111
- end
112
-
113
- # Make directory structure ----------------------------------------------------------------
114
-
115
- def make_dest_dirs(dirs, path = '.')
116
- mkdir_p dirs.map { |dir| File.join(PKG_DESTINATION, path.to_s, dir) }
117
- end
118
-
119
- desc "Make the directory structure for the new Rails application"
120
- task :make_dir_structure => [ :make_base_dirs, :make_app_dirs, :make_public_dirs, :make_test_dirs ]
121
-
122
- task(:make_base_dirs) { make_dest_dirs BASE_DIRS }
123
- task(:make_app_dirs) { make_dest_dirs APP_DIRS, 'app' }
124
- task(:make_public_dirs) { make_dest_dirs PUBLIC_DIRS, 'public' }
125
- task(:make_test_dirs) { make_dest_dirs TEST_DIRS, 'test' }
126
-
127
-
128
- # Initialize file stubs -------------------------------------------------------------------
129
-
130
- desc "Initialize empty file stubs (such as for logging)"
131
- task :initialize_file_stubs => [ :initialize_log_files ]
132
-
133
- task :initialize_log_files do
134
- log_dir = File.join(PKG_DESTINATION, 'log')
135
- chmod 0777, log_dir
136
- LOG_FILES.each do |log_file|
137
- log_path = File.join(log_dir, log_file)
138
- touch log_path
139
- chmod 0666, log_path
140
- end
141
- end
142
-
143
-
144
- # Copy Vendors ----------------------------------------------------------------------------
145
-
146
- desc "Copy in all the Rails packages to vendor"
147
- task :copy_vendor_libraries do
148
- mkdir File.join(PKG_DESTINATION, 'vendor', 'rails')
149
- VENDOR_LIBS.each { |dir| cp_r File.join('..', dir), File.join(PKG_DESTINATION, 'vendor', 'rails', dir) }
150
- FileUtils.rm_r(Dir.glob(File.join(PKG_DESTINATION, 'vendor', 'rails', "**", ".svn")))
151
- end
152
-
153
- desc "Link in all the Rails packages to vendor"
154
- task :link_vendor_libraries do
155
- mkdir File.join(PKG_DESTINATION, 'vendor', 'rails')
156
- VENDOR_LIBS.each { |dir| ln_s File.join('..', '..', '..', dir), File.join(PKG_DESTINATION, 'vendor', 'rails', dir) }
157
- end
158
-
159
-
160
- # Copy Ties Content -----------------------------------------------------------------------
161
-
162
- desc "Make copies of all the default content of ties"
163
- task :copy_ties_content => [
164
- :copy_rootfiles, :copy_dispatches, :copy_html_files, :copy_application,
165
- :copy_configs, :copy_binfiles, :copy_test_helpers, :copy_app_doc_readme ]
166
-
167
- task :copy_dispatches do
168
- copy_with_rewritten_ruby_path("dispatches/dispatch.rb", "#{PKG_DESTINATION}/public/dispatch.rb")
169
- chmod 0755, "#{PKG_DESTINATION}/public/dispatch.rb"
170
-
171
- copy_with_rewritten_ruby_path("dispatches/dispatch.rb", "#{PKG_DESTINATION}/public/dispatch.cgi")
172
- chmod 0755, "#{PKG_DESTINATION}/public/dispatch.cgi"
173
-
174
- copy_with_rewritten_ruby_path("dispatches/dispatch.fcgi", "#{PKG_DESTINATION}/public/dispatch.fcgi")
175
- chmod 0755, "#{PKG_DESTINATION}/public/dispatch.fcgi"
176
- end
177
-
178
- task :copy_html_files do
179
- HTML_FILES.each { |file| cp File.join('html', file), File.join(PKG_DESTINATION, 'public', file) }
180
- end
181
-
182
- task :copy_application do
183
- cp "helpers/application_controller.rb", "#{PKG_DESTINATION}/app/controllers/application_controller.rb"
184
- cp "helpers/application_helper.rb", "#{PKG_DESTINATION}/app/helpers/application_helper.rb"
185
- end
186
-
187
- task :copy_configs do
188
- app_name = "rails"
189
- socket = nil
190
- require 'erb'
191
- File.open("#{PKG_DESTINATION}/config/database.yml", 'w') {|f| f.write ERB.new(IO.read("configs/databases/sqlite3.yml"), nil, '-').result(binding)}
192
-
193
- cp "configs/routes.rb", "#{PKG_DESTINATION}/config/routes.rb"
194
-
195
- cp "configs/initializers/backtrace_silencers.rb", "#{PKG_DESTINATION}/config/initializers/backtrace_silencers.rb"
196
- cp "configs/initializers/inflections.rb", "#{PKG_DESTINATION}/config/initializers/inflections.rb"
197
- cp "configs/initializers/mime_types.rb", "#{PKG_DESTINATION}/config/initializers/mime_types.rb"
198
- cp "configs/initializers/new_rails_defaults.rb", "#{PKG_DESTINATION}/config/initializers/new_rails_defaults.rb"
199
-
200
- cp "configs/locales/en.yml", "#{PKG_DESTINATION}/config/locales/en.yml"
201
-
202
- cp "configs/seeds.rb", "#{PKG_DESTINATION}/db/seeds.rb"
203
-
204
- cp "environments/boot.rb", "#{PKG_DESTINATION}/config/boot.rb"
205
- File.open("#{PKG_DESTINATION}/config/environment.rb", 'w') {|f| f.write ERB.new(IO.read("environments/environment.rb"), nil, '-').result(binding)}
206
- cp "environments/production.rb", "#{PKG_DESTINATION}/config/environments/production.rb"
207
- cp "environments/development.rb", "#{PKG_DESTINATION}/config/environments/development.rb"
208
- cp "environments/test.rb", "#{PKG_DESTINATION}/config/environments/test.rb"
209
-
210
- end
211
-
212
- task :copy_binfiles do
213
- BIN_FILES.each do |file|
214
- dest_file = File.join(PKG_DESTINATION, 'script', file)
215
- copy_with_rewritten_ruby_path(File.join('bin', file), dest_file)
216
- chmod 0755, dest_file
217
- end
218
- end
219
-
220
- task :copy_rootfiles do
221
- cp "fresh_rakefile", "#{PKG_DESTINATION}/Rakefile"
222
- cp "README", "#{PKG_DESTINATION}/README"
223
- cp "CHANGELOG", "#{PKG_DESTINATION}/CHANGELOG"
224
- end
225
-
226
- task :copy_test_helpers do
227
- cp "helpers/test_helper.rb", "#{PKG_DESTINATION}/test/test_helper.rb"
228
- end
229
-
230
- task :copy_app_doc_readme do
231
- cp "doc/README_FOR_APP", "#{PKG_DESTINATION}/doc/README_FOR_APP"
232
- end
233
-
234
- def copy_with_rewritten_ruby_path(src_file, dest_file)
235
- ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
236
-
237
- File.open(dest_file, 'w') do |df|
238
- File.open(src_file) do |sf|
239
- line = sf.gets
240
- if (line =~ /#!.+ruby\s*/) != nil
241
- df.puts("#!#{ruby}")
242
- else
243
- df.puts(line)
244
- end
245
- df.write(sf.read)
246
- end
247
- end
248
- end
249
-
250
- desc 'Generate guides (for authors), use ONLY=foo to process just "foo.textile"'
251
- task :generate_guides do
252
- ruby "guides/rails_guides.rb"
253
- end
254
-
255
-
256
- # Generate documentation ------------------------------------------------------------------
257
-
258
- desc "Generate documentation for the framework and for the empty application"
259
- task :generate_documentation => [ :generate_app_doc, :generate_rails_framework_doc ]
260
-
261
- task :generate_rails_framework_doc do
262
- system %{cd #{PKG_DESTINATION}; rake doc:rails}
263
- end
264
-
265
- task :generate_app_doc do
266
- cp "doc/README_FOR_APP", "#{PKG_DESTINATION}/doc/README_FOR_APP"
267
- system %{cd #{PKG_DESTINATION}; rake doc:app}
268
- end
269
-
270
- RDoc::Task.new { |rdoc|
271
- rdoc.rdoc_dir = 'doc'
272
- rdoc.title = "Railties -- Gluing the Engine to the Rails"
273
- rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object'
274
- rdoc.options << '--charset' << 'utf-8'
275
- rdoc.template = ENV['template'] ? "#{ENV['template']}.rb" : '../doc/template/horo'
276
- rdoc.rdoc_files.include('README', 'CHANGELOG')
277
- rdoc.rdoc_files.include('lib/*.rb')
278
- rdoc.rdoc_files.include('lib/rails/*.rb')
279
- rdoc.rdoc_files.include('lib/rails_generator/*.rb')
280
- rdoc.rdoc_files.include('lib/commands/**/*.rb')
281
- }
282
-
283
- # Generate GEM ----------------------------------------------------------------------------
284
-
285
- task :copy_gem_environment do
286
- cp "environments/environment.rb", "#{PKG_DESTINATION}/config/environment.rb"
287
- chmod 0755, dest_file
288
- end
289
-
290
-
291
- PKG_FILES = FileList[
292
- '[a-zA-Z]*',
293
- 'bin/**/*',
294
- 'builtin/**/*',
295
- 'configs/**/*',
296
- 'doc/**/*',
297
- 'dispatches/**/*',
298
- 'environments/**/*',
299
- 'helpers/**/*',
300
- 'generators/**/*',
301
- 'html/**/*',
302
- 'lib/**/*'
303
- ] - [ 'test' ]
304
-
305
- spec = Gem::Specification.new do |s|
306
- s.platform = Gem::Platform::RUBY
307
- s.name = 'rails'
308
- s.version = PKG_VERSION
309
- s.summary = "Web-application framework with template engine, control-flow layer, and ORM."
310
- s.description = <<-EOF
311
- Rails is a framework for building web-application using CGI, FCGI, mod_ruby, or WEBrick
312
- on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.
313
- EOF
314
-
315
- s.add_dependency('rake', '>= 0.8.3')
316
- s.add_dependency('activesupport', '= 2.3.18' + PKG_BUILD)
317
- s.add_dependency('activerecord', '= 2.3.18' + PKG_BUILD)
318
- s.add_dependency('actionpack', '= 2.3.18' + PKG_BUILD)
319
- s.add_dependency('actionmailer', '= 2.3.18' + PKG_BUILD)
320
- s.add_dependency('activeresource', '= 2.3.18' + PKG_BUILD)
321
-
322
- s.rdoc_options << '--exclude' << '.'
323
-
324
- s.files = PKG_FILES
325
- s.require_path = 'lib'
326
- s.bindir = "bin" # Use these for applications.
327
- s.executables = ["rails"]
328
-
329
- s.author = "David Heinemeier Hansson"
330
- s.email = "david@loudthinking.com"
331
- s.homepage = "http://www.rubyonrails.org"
332
- s.rubyforge_project = "rails"
333
- end
334
-
335
- Gem::PackageTask.new(spec) do |pkg|
336
- pkg.gem_spec = spec
337
- end
338
-
339
-
340
- # Publishing -------------------------------------------------------
341
- desc "Publish the rails gem"
342
- task :pgem => [:gem] do
343
- Rake::SshFilePublisher.new("gems.rubyonrails.org", "/u/sites/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
344
- `ssh gems.rubyonrails.org '/u/sites/gems/gemupdate.sh'`
345
- end
346
-
347
- desc "Publish the guides"
348
- task :pguides => :generate_guides do
349
- mkdir_p 'pkg'
350
- `tar -czf pkg/guides.gz guides/output`
351
- Rake::SshFilePublisher.new("web.rubyonrails.org", "/u/sites/guides.rubyonrails.org/public", "pkg", "guides.gz").upload
352
- `ssh web.rubyonrails.org 'cd /u/sites/guides.rubyonrails.org/public/ && tar -xvzf guides.gz && mv guides/output/* . && rm -rf guides*'`
353
- end
354
-
355
- desc "Publish the release files to RubyForge."
356
- task :release => [ :package ] do
357
- require 'rake/contrib/rubyforgepublisher'
358
- require 'rubyforge'
359
-
360
- packages = %w( gem ).collect{ |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
361
-
362
- rubyforge = RubyForge.new
363
- rubyforge.login
364
- rubyforge.add_release(PKG_NAME, PKG_NAME, "REL #{PKG_VERSION}", *packages)
365
- end
data/bin/about DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
- require 'commands/about'
data/bin/console DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- require 'commands/console'
data/bin/dbconsole DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- require 'commands/dbconsole'
data/bin/destroy DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- require 'commands/destroy'
data/bin/generate DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- require 'commands/generate'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../../config/boot', __FILE__)
3
- require 'commands/performance/benchmarker'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../../config/boot', __FILE__)
3
- require 'commands/performance/profiler'
data/bin/plugin DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- require 'commands/plugin'
data/bin/rails DELETED
@@ -1,21 +0,0 @@
1
- $:.unshift File.expand_path("../../lib", __FILE__)
2
-
3
- require 'ruby_version_check'
4
- Signal.trap("INT") { puts; exit }
5
-
6
- require 'rails/version'
7
- if %w(--version -v).include? ARGV.first
8
- puts "Rails #{Rails::VERSION::STRING}"
9
- exit(0)
10
- end
11
-
12
- freeze = ARGV.any? { |option| %w(--freeze -f).include?(option) }
13
- app_path = ARGV.first
14
-
15
- require 'rails_generator'
16
- require 'rails_generator/scripts/generate'
17
-
18
- Rails::Generator::Base.use_application_sources!
19
- Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
20
-
21
- Dir.chdir(app_path) { `rake rails:freeze:gems`; puts "froze" } if freeze
data/bin/runner DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- require 'commands/runner'
data/bin/server DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.expand_path('../../config/boot', __FILE__)
3
- require 'commands/server'