rails 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails might be problematic. Click here for more details.
- data/CHANGELOG +152 -10
- data/README +30 -5
- data/Rakefile +18 -13
- data/bin/rails +1 -11
- data/{lib/rails_info.rb → builtin/rails_info/rails/info.rb} +25 -8
- data/builtin/{controllers/rails_info_controller.rb → rails_info/rails/info_controller.rb} +2 -2
- data/configs/databases/mysql.yml +47 -0
- data/configs/databases/oracle.yml +30 -0
- data/configs/databases/postgresql.yml +44 -0
- data/configs/databases/sqlite2.yml +16 -0
- data/configs/databases/sqlite3.yml +16 -0
- data/configs/lighttpd.conf +11 -5
- data/configs/routes.rb +5 -2
- data/environments/development.rb +3 -2
- data/environments/environment.rb +5 -8
- data/environments/production.rb +1 -2
- data/environments/test.rb +1 -1
- data/fresh_rakefile +2 -2
- data/html/500.html +1 -1
- data/html/index.html +3 -3
- data/html/javascripts/application.js +2 -0
- data/html/javascripts/controls.js +95 -30
- data/html/javascripts/dragdrop.js +161 -21
- data/html/javascripts/effects.js +310 -211
- data/html/javascripts/prototype.js +228 -28
- data/lib/code_statistics.rb +1 -1
- data/lib/commands/console.rb +3 -1
- data/lib/commands/plugin.rb +113 -70
- data/lib/commands/process/reaper.rb +1 -1
- data/lib/commands/process/spawner.rb +33 -4
- data/lib/commands/runner.rb +1 -1
- data/lib/commands/server.rb +3 -1
- data/lib/commands/servers/lighttpd.rb +41 -9
- data/lib/console_app.rb +27 -0
- data/lib/console_with_helpers.rb +23 -0
- data/lib/dispatcher.rb +8 -8
- data/lib/fcgi_handler.rb +22 -4
- data/lib/initializer.rb +107 -38
- data/lib/rails_generator/commands.rb +17 -7
- data/lib/rails_generator/generators/applications/app/app_generator.rb +30 -18
- data/lib/rails_generator/generators/components/integration_test/USAGE +14 -0
- data/lib/rails_generator/generators/components/integration_test/integration_test_generator.rb +16 -0
- data/lib/rails_generator/generators/components/integration_test/templates/integration_test.rb +10 -0
- data/lib/rails_generator/generators/components/mailer/USAGE +1 -1
- data/lib/rails_generator/generators/components/migration/USAGE +1 -1
- data/lib/rails_generator/generators/components/model/USAGE +3 -1
- data/lib/rails_generator/generators/components/model/model_generator.rb +16 -0
- data/lib/rails_generator/generators/components/model/templates/migration.rb +11 -0
- data/lib/rails_generator/generators/components/model/templates/unit_test.rb +1 -1
- data/lib/rails_generator/generators/components/plugin/USAGE +3 -1
- data/lib/rails_generator/generators/components/plugin/plugin_generator.rb +1 -0
- data/lib/rails_generator/generators/components/plugin/templates/Rakefile +1 -1
- data/lib/rails_generator/generators/components/plugin/templates/install.rb +1 -0
- data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +1 -1
- data/lib/rails_generator/generators/components/scaffold/templates/controller.rb +4 -0
- data/lib/rails_generator/generators/components/scaffold/templates/style.css +4 -4
- data/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +1 -1
- data/lib/rails_generator/generators/components/session_migration/USAGE +1 -1
- data/lib/rails_generator/options.rb +2 -2
- data/lib/rails_version.rb +1 -1
- data/lib/ruby_version_check.rb +17 -0
- data/lib/tasks/databases.rake +141 -139
- data/lib/tasks/documentation.rake +73 -68
- data/lib/tasks/framework.rake +86 -58
- data/lib/tasks/log.rake +9 -0
- data/lib/tasks/misc.rake +2 -17
- data/lib/tasks/pre_namespace_aliases.rake +46 -0
- data/lib/tasks/statistics.rake +9 -8
- data/lib/tasks/testing.rake +81 -29
- data/lib/tasks/tmp.rake +30 -0
- data/lib/test_help.rb +1 -0
- data/lib/webrick_server.rb +6 -8
- metadata +284 -271
- data/bin/process/spinner +0 -3
- data/configs/database.yml +0 -85
- data/lib/tasks/javascripts.rake +0 -6
data/CHANGELOG
CHANGED
@@ -1,8 +1,145 @@
|
|
1
|
-
*1.
|
1
|
+
*1.1.0* (March 27th, 2005)
|
2
|
+
|
3
|
+
* Allow db:fixtures:load to load a subset of the applications fixtures. [Chad Fowler]
|
4
|
+
|
5
|
+
ex.
|
6
|
+
|
7
|
+
rake db:fixtures:load FIXTURES=customers,plans
|
8
|
+
|
9
|
+
* Update to Prototype 1.5.0_pre1 [Sam Stephenson]
|
10
|
+
|
11
|
+
* Update to script.aculo.us 1.6 [Thomas Fuchs]
|
12
|
+
|
13
|
+
* Add an integration_test generator [Jamis Buck]
|
14
|
+
|
15
|
+
* Make all ActionView helpers available in the console from the helper method for debugging purposes. n.b.: Only an 80% solution. Some stuff won't work, most will. [Marcel Molina Jr.]
|
16
|
+
|
17
|
+
ex.
|
18
|
+
|
19
|
+
>> puts helper.options_for_select([%w(a 1), %w(b 2), %w(c 3)])
|
20
|
+
<option value="1">a</option>
|
21
|
+
<option value="2">b</option>
|
22
|
+
<option value="3">c</option>
|
23
|
+
=> nil
|
24
|
+
|
25
|
+
* Replaced old session rake tasks with db:sessions:create to generate a migration, and db:sessions:clear to remove sessions. [Rick Olson]
|
26
|
+
|
27
|
+
* Reject Ruby 1.8.3 when loading Rails; extract version checking code. [Chad Fowler]
|
28
|
+
|
29
|
+
* Remove explicit loading of RailsInfo and RailsInfoController. [Nicholas Seckar]
|
30
|
+
|
31
|
+
* Move RailsInfo and RailsInfoController to Rails::Info and Rails::InfoController. [Nicholas Seckar]
|
32
|
+
|
33
|
+
* Extend load path with Railties' builtin directory to make adding support code easy. [Nicholas Seckar]
|
34
|
+
|
35
|
+
* Fix the rails_info controller by explicitly loading it, and marking it as not reloadable. [Nicholas Seckar]
|
36
|
+
|
37
|
+
* Fixed rails:freeze:gems for Windows #3274 [paul@paulbutcher.com]
|
38
|
+
|
39
|
+
* Added 'port open?' check to the spawner when running in repeat mode so we don't needlessly boot the dispatcher if the port is already in use anyway #4089 [guy.naor@famundo.com]
|
40
|
+
|
41
|
+
* Add verification to generated scaffolds, don't allow get for unsafe actions [Michael Koziarski]
|
42
|
+
|
43
|
+
* Don't replace application.js in public/javascripts if it already exists [Cody Fauser]
|
44
|
+
|
45
|
+
* Change test:uncommitted to delay execution of `svn status` by using internal Rake API's. [Nicholas Seckar]
|
46
|
+
|
47
|
+
* Use require_library_or_gem to load rake in commands/server.rb. Closes #4205. [rob.rasmussen@gmail.com]
|
48
|
+
|
49
|
+
* Use the Rake API instead of shelling out to create the tmp directory in commands/server.rb. [Chad Fowler]
|
50
|
+
|
51
|
+
* Added a backtrace to the evil WSOD (White Screen of Death). Closes #4073. TODO: Clearer exceptions [Rick Olson]
|
52
|
+
|
53
|
+
* Added tracking of database and framework versions in script/about #4088 [charles.gerungan@gmail.com/Rick Olson]
|
54
|
+
|
55
|
+
* Added public/javascripts/application.js as a sample since it'll automatically be included in javascript_include_tag :defaults [DHH]
|
56
|
+
|
57
|
+
* Added socket cleanup for lighttpd, both before and after [DHH]
|
58
|
+
|
59
|
+
* Added automatic creation of tmp/ when running script/server [DHH]
|
60
|
+
|
61
|
+
* Added silence_stream that'll work on both STDERR or STDOUT or any other stream and deprecated silence_stderr in the process [DHH]
|
62
|
+
|
63
|
+
* Added reload! method to script/console to reload all models and others that include Reloadable without quitting the console #4056 [esad@esse.at]
|
64
|
+
|
65
|
+
* Added that rake rails:freeze:edge will now just export all the contents of the frameworks instead of just lib, so stuff like rails:update:scripts, rails:update:javascripts, and script/server on lighttpd still just works #4047 [DHH]
|
66
|
+
|
67
|
+
* Added fix for upload problems with lighttpd from Safari/IE to config/lighttpd.conf #3999 [thijs@fngtps.com]
|
68
|
+
|
69
|
+
* Added test:uncommitted to test changes since last checkin to Subversion #4035 [technomancy@gmail.com]
|
70
|
+
|
71
|
+
* Help script/about print the correct svn revision when in a non-English locale. #4026 [babie7a0@ybb.ne.jp]
|
72
|
+
|
73
|
+
* Add 'app' accessor to script/console as an instance of Integration::Session [Jamis Buck]
|
74
|
+
|
75
|
+
* Generator::Base#usage takes an optional message argument which defaults to Generator::Base#usage_message. [Jeremy Kemper]
|
76
|
+
|
77
|
+
* Remove the extraneous AR::Base.threaded_connections setting from the webrick server. [Jeremy Kemper]
|
78
|
+
|
79
|
+
* Add integration test support to app generation and testing [Jamis Buck]
|
2
80
|
|
3
|
-
*
|
81
|
+
* Added namespaces to all tasks, so for example load_fixtures is now db:fixtures:load. All the old task names are still valid, they just point to the new namespaced names. "rake -T" will only show the namespaced ones, though [DHH]
|
4
82
|
|
5
|
-
*
|
83
|
+
* CHANGED DEFAULT: ActiveRecord::Base.schema_format is now :ruby by default instead of :sql. This means that we'll assume you want to live in the world of db/schema.rb where the grass is green and the girls are pretty. If your schema contains un-dumpable elements, such as constraints or database-specific column types, you just got an invitation to either 1) patch the dumper to include foreign key support, 2) stop being db specific, or 3) just change the default in config/environment.rb to config.active_record.schema_format = :sql -- we even include an example for that on new Rails skeletons now. Brought to you by the federation of opinionated framework builders! [DHH]
|
84
|
+
|
85
|
+
* Added -r/--repeat option to script/process/spawner that offers the same loop protection as the spinner did. This deprecates the script/process/spinner, so it's no longer included in the default Rails skeleton, but still available for backwards compatibility #3461 [ror@andreas-s.net]
|
86
|
+
|
87
|
+
* Added collision option to template generation in generators #3329 [anna@wota.jp]. Examples:
|
88
|
+
|
89
|
+
m.template "stuff.config" , "config/stuff.config" , :collision => :skip
|
90
|
+
m.template "auto-stamping", "config/generator.log", :collision => :force
|
91
|
+
|
92
|
+
* Added more information to script/plugin's doings to ease debugging #3755 [Rick Olson]
|
93
|
+
|
94
|
+
* Changed the default configuration for lighttpd to use tmp/sockets instead of log/ for the FastCGI sockets [DHH]
|
95
|
+
|
96
|
+
* Added a default configuration of the FileStore for fragment caching if tmp/cache is available, which makes action/fragment caching ready to use out of the box with no additional configuration [DHH]
|
97
|
+
|
98
|
+
* Changed the default session configuration to place sessions in tmp/sessions, if that directory is available, instead of /tmp (this essentially means a goodbye to 9/10 White Screen of Death errors and should have web hosting firms around the world cheering) [DHH]
|
99
|
+
|
100
|
+
* Added tmp/sessions, tmp/cache, and tmp/sockets as default directories in the Rails skeleton [DHH]
|
101
|
+
|
102
|
+
* Added that script/generate model will now automatically create a migration file for the model created. This can be turned off by calling the generator with --skip-migration [DHH]
|
103
|
+
|
104
|
+
* Added -d/--database option to the rails command, so you can do "rails --database=sqlite2 myapp" to start a new application preconfigured to use SQLite2 as the database. Removed the configuration examples from SQLite and PostgreSQL from the default MySQL configuration [DHH]
|
105
|
+
|
106
|
+
* Allow script/server -c /path/to/lighttpd.conf [Jeremy Kemper]
|
107
|
+
|
108
|
+
* Remove hardcoded path to reaper script in script/server [Jeremy Kemper]
|
109
|
+
|
110
|
+
* Update script.aculo.us to V1.5.3 [Thomas Fuchs]
|
111
|
+
|
112
|
+
* Added SIGTRAP signal handler to RailsFCGIHandler that'll force the process into a breakpoint after the next request. This breakpoint can then be caught with script/breakpointer and give you access to the Ruby image inside that process. Useful for debugging memory leaks among other things [DHH]
|
113
|
+
|
114
|
+
* Changed default lighttpd.conf to use CWD from lighttpd 1.4.10 that allows the same configuration to be used for both detach and not. Also ensured that auto-repeaping of FCGIs only happens when lighttpd is not detached. [DHH]
|
115
|
+
|
116
|
+
* Added Configuration#after_initialize for registering a block which gets called after the framework is fully initialized. Useful for things like per-environment configuration of plugins. [Michael Koziarski]
|
117
|
+
|
118
|
+
* Added check for RAILS_FRAMEWORK_ROOT constant that allows the Rails framework to be found in a different place than vendor/rails. Should be set in boot.rb. [DHH]
|
119
|
+
|
120
|
+
* Fixed that static requests could unlock the mutex guarding dynamic requests in the WEBrick servlet #3433 [tom@craz8.com]
|
121
|
+
|
122
|
+
* Fixed documentation tasks to work with Rake 0.7.0 #3563 [kazuhiko@fdiary.net]
|
123
|
+
|
124
|
+
* Update to Prototype 1.5.0_pre0 [Sam Stephenson]
|
125
|
+
|
126
|
+
* Sort the list of plugins so we load in a consistent order [Rick Olson]
|
127
|
+
|
128
|
+
* Show usage when script/plugin is called without arguments [tom@craz8.com]
|
129
|
+
|
130
|
+
* Corrected problems with plugin loader where plugins set 'name' incorrectly #3297 [anna@wota.jp]
|
131
|
+
|
132
|
+
* Make migration generator only report on exact duplicate names, not partial dupliate names. #3442 [jeremy@planetargon.com Marcel Molina Jr.]
|
133
|
+
|
134
|
+
* Fix typo in mailer generator USAGE. #3458 [chriztian.steinmeier@gmail.com]
|
135
|
+
|
136
|
+
* Ignore version mismatch between pg_dump and the database server. #3457 [simon.stapleton@gmail.com]
|
137
|
+
|
138
|
+
* Reap FCGI processes after lighttpd exits. [Sam Stephenson]
|
139
|
+
|
140
|
+
* Honor ActiveRecord::Base.pluralize_table_names when creating and destroying session store table. #3204. [rails@bencurtis.com, Marcel Molina Jr.]
|
141
|
+
|
142
|
+
*1.0.0* (December 13th, 2005)
|
6
143
|
|
7
144
|
* Update instructions on how to find and install generators. #3172. [Chad Fowler]
|
8
145
|
|
@@ -10,36 +147,41 @@
|
|
10
147
|
|
11
148
|
* Generator copies files in binary mode. #3156 [minimudboy@gmail.com]
|
12
149
|
|
13
|
-
|
14
|
-
*0.14.4 (RC5)* (December 7th, 2005)
|
15
|
-
|
16
150
|
* Add builtin/ to the gemspec. Closes #3047. [Nicholas Seckar, Sam Stephenson]
|
17
151
|
|
152
|
+
* Add install.rb file to plugin generation which is loaded, if it exists, when you install a plugin. [Marcel Molina Jr.]
|
153
|
+
|
18
154
|
* Run initialize_logger in script/lighttpd to ensure the log file exists before tailing it. [Sam Stephenson]
|
19
155
|
|
20
156
|
* Make load_fixtures include csv fixtures. #3053. [me@mdaines.com]
|
21
157
|
|
22
158
|
* Fix freeze_gems so that the latest rails version is dumped by default. [Nicholas Seckar]
|
23
159
|
|
160
|
+
* script/plugin: handle root paths and plugin names which contain spaces. #2995 [justin@aspect.net]
|
161
|
+
|
24
162
|
* Model generator: correct relative path to test_helper in unit test. [Jeremy Kemper]
|
25
163
|
|
26
164
|
* Make the db_schema_dump task honor the SCHEMA environment variable if present the way db_schema_import does. #2931. [Blair Zajac]
|
27
165
|
|
166
|
+
* Have the lighttpd server script report the actual ip to which the server is bound. #2903. [Adam]
|
167
|
+
|
168
|
+
* Add plugin library directories to the load path after the lib directory so that libraries in the lib directory get precedence. #2910. [james.adam@gmail.com]
|
169
|
+
|
28
170
|
* Make help for the console command more explicit about how to specify the desired environment in which to run the console. #2911. [anonymous]
|
29
171
|
|
30
172
|
* PostgreSQL: the purge_test_database Rake task shouldn't explicitly specify the template0 template when creating a fresh test database. #2964 [dreamer3@gmail.com]
|
31
173
|
|
32
174
|
* Introducing the session_migration generator. Creates an add_session_table migration. Allows generator to specify migrations directory. #2958, #2960 [Rick Olson]
|
33
175
|
|
34
|
-
*
|
176
|
+
* script/console uses RAILS_ENV environment variable if present. #2932 [Blair Zajac <blair@orcaware.com>
|
35
177
|
|
36
|
-
*
|
178
|
+
* Windows: eliminate the socket option in database.yml. #2924 [Wayne Vucenic <waynev@gmail.com>]
|
37
179
|
|
38
|
-
*
|
180
|
+
* Eliminate nil from newly generated logfiles. #2927 [Blair Zajac <blair@orcaware.com>]
|
39
181
|
|
40
182
|
* Rename Version constant to VERSION. #2802 [Marcel Molina Jr.]
|
41
183
|
|
42
|
-
*
|
184
|
+
* Eliminate Subversion dependencies in scripts/plugin. Correct install options. Introduce --force option to reinstall a plugin. Remove useless --long option for list. Use --quiet to quiet the download output and --revision to update to a specific svn revision. #2842 [Chad Fowler, Rick Olson]
|
43
185
|
|
44
186
|
* SQLite: the clone_structure_to_test and purge_test_database Rake tasks should always use the test environment. #2846 [Rick Olson]
|
45
187
|
|
data/README
CHANGED
@@ -27,12 +27,30 @@ link:files/vendor/rails/actionpack/README.html.
|
|
27
27
|
|
28
28
|
== Getting started
|
29
29
|
|
30
|
-
1.
|
31
|
-
|
32
|
-
|
33
|
-
3. Follow the guidelines on the "Congratulations, you've put Ruby on Rails!" screen
|
30
|
+
1. Start the web server: <tt>ruby script/server</tt> (run with --help for options)
|
31
|
+
2. Go to http://localhost:3000/ and get "Welcome aboard: You’re riding the Rails!"
|
32
|
+
3. Follow the guidelines to start developing your application
|
34
33
|
|
35
34
|
|
35
|
+
== Web servers
|
36
|
+
|
37
|
+
Rails uses the built-in web server in Ruby called WEBrick by default, so you don't
|
38
|
+
have to install or configure anything to play around.
|
39
|
+
|
40
|
+
If you have lighttpd installed, though, it'll be used instead when running script/server.
|
41
|
+
It's considerably faster than WEBrick and suited for production use, but requires additional
|
42
|
+
installation and currently only works well on OS X/Unix (Windows users are encouraged
|
43
|
+
to start with WEBrick). We recommend version 1.4.11 and higher. You can download it from
|
44
|
+
http://www.lighttpd.net.
|
45
|
+
|
46
|
+
If you want something that's halfway between WEBrick and lighttpd, we heartily recommend
|
47
|
+
Mongrel. It's a Ruby-based web server with a C-component (so it requires compilation) that
|
48
|
+
also works very well with Windows. See more at http://mongrel.rubyforge.org/.
|
49
|
+
|
50
|
+
But of course its also possible to run Rails with the premiere open source web server Apache.
|
51
|
+
To get decent performance, though, you'll need to install FastCGI. See
|
52
|
+
http://wiki.rubyonrails.com/rails/pages/FastCGI for more information on FastCGI.
|
53
|
+
|
36
54
|
== Example for Apache conf
|
37
55
|
|
38
56
|
<VirtualHost *:80>
|
@@ -102,7 +120,7 @@ You can interact with the domain model by starting the console through script/co
|
|
102
120
|
Here you'll have all parts of the application configured, just like it is when the
|
103
121
|
application is running. You can inspect domain models, change values, and save to the
|
104
122
|
database. Starting the script without arguments will launch it in the development environment.
|
105
|
-
Passing an argument will specify a different environment, like <tt>console production</tt>.
|
123
|
+
Passing an argument will specify a different environment, like <tt>script/console production</tt>.
|
106
124
|
|
107
125
|
|
108
126
|
== Description of contents
|
@@ -128,12 +146,19 @@ app/views
|
|
128
146
|
app/helpers
|
129
147
|
Holds view helpers that should be named like weblog_helper.rb.
|
130
148
|
|
149
|
+
app/apis
|
150
|
+
Holds API classes for web services.
|
151
|
+
|
131
152
|
config
|
132
153
|
Configuration files for the Rails environment, the routing map, the database, and other dependencies.
|
133
154
|
|
134
155
|
components
|
135
156
|
Self-contained mini-applications that can bundle together controllers, models, and views.
|
136
157
|
|
158
|
+
db
|
159
|
+
Contains the database schema in schema.rb. db/migrate contains all
|
160
|
+
the sequence of Migrations for your schema.
|
161
|
+
|
137
162
|
lib
|
138
163
|
Application specific libraries. Basically, any kind of custom code that doesn't
|
139
164
|
belong under controllers, models, or helpers. This directory is in the load path.
|
data/Rakefile
CHANGED
@@ -28,16 +28,20 @@ RUBY_FORGE_USER = "webster132"
|
|
28
28
|
# end
|
29
29
|
|
30
30
|
|
31
|
-
BASE_DIRS = %w(
|
31
|
+
BASE_DIRS = %w(
|
32
|
+
app config/environments components db doc log lib lib/tasks public script script/performance script/process test vendor vendor/plugins
|
33
|
+
tmp/sessions tmp/cache tmp/sockets
|
34
|
+
)
|
35
|
+
|
32
36
|
APP_DIRS = %w( models controllers helpers views views/layouts )
|
33
37
|
PUBLIC_DIRS = %w( images javascripts stylesheets )
|
34
38
|
TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
|
35
39
|
|
36
40
|
LOG_FILES = %w( server.log development.log test.log production.log )
|
37
41
|
HTML_FILES = %w( 404.html 500.html index.html robots.txt favicon.ico images/rails.png
|
38
|
-
javascripts/prototype.js
|
42
|
+
javascripts/prototype.js javascripts/application.js
|
39
43
|
javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js )
|
40
|
-
BIN_FILES = %w( about breakpointer console destroy generate performance/benchmarker performance/profiler process/reaper process/spawner
|
44
|
+
BIN_FILES = %w( about breakpointer console destroy generate performance/benchmarker performance/profiler process/reaper process/spawner runner server plugin )
|
41
45
|
|
42
46
|
VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )
|
43
47
|
|
@@ -71,7 +75,7 @@ end
|
|
71
75
|
|
72
76
|
desc "Updates railties to the latest version of the javascript spinoffs"
|
73
77
|
task :update_js do
|
74
|
-
for js in %w( prototype controls dragdrop effects
|
78
|
+
for js in %w( prototype controls dragdrop effects )
|
75
79
|
rm "html/javascripts/#{js}.js"
|
76
80
|
cp "./../actionpack/lib/action_view/helpers/javascripts/#{js}.js", "html/javascripts"
|
77
81
|
end
|
@@ -80,7 +84,7 @@ end
|
|
80
84
|
# Make directory structure ----------------------------------------------------------------
|
81
85
|
|
82
86
|
def make_dest_dirs(dirs, path = nil)
|
83
|
-
mkdir_p dirs.map { |dir| File.join(PKG_DESTINATION, path, dir) }
|
87
|
+
mkdir_p dirs.map { |dir| File.join(PKG_DESTINATION, path.to_s, dir) }
|
84
88
|
end
|
85
89
|
|
86
90
|
desc "Make the directory structure for the new Rails application"
|
@@ -114,6 +118,7 @@ desc "Copy in all the Rails packages to vendor"
|
|
114
118
|
task :copy_vendor_libraries do
|
115
119
|
mkdir File.join(PKG_DESTINATION, 'vendor', 'rails')
|
116
120
|
VENDOR_LIBS.each { |dir| cp_r File.join('..', dir), File.join(PKG_DESTINATION, 'vendor', 'rails', dir) }
|
121
|
+
FileUtils.rm_r(Dir.glob(File.join(PKG_DESTINATION, 'vendor', 'rails', "**", ".svn")))
|
117
122
|
end
|
118
123
|
|
119
124
|
desc "Link in all the Rails packages to vendor"
|
@@ -158,7 +163,7 @@ task :copy_configs do
|
|
158
163
|
app_name = "rails"
|
159
164
|
socket = nil
|
160
165
|
require 'erb'
|
161
|
-
File.open("#{PKG_DESTINATION}/config/database.yml", 'w') {|f| f.write ERB.new(IO.read("configs/
|
166
|
+
File.open("#{PKG_DESTINATION}/config/database.yml", 'w') {|f| f.write ERB.new(IO.read("configs/databases/mysql.yml"), nil, '-').result(binding)}
|
162
167
|
|
163
168
|
cp "configs/routes.rb", "#{PKG_DESTINATION}/config/routes.rb"
|
164
169
|
|
@@ -233,7 +238,7 @@ end
|
|
233
238
|
Rake::RDocTask.new { |rdoc|
|
234
239
|
rdoc.rdoc_dir = 'doc'
|
235
240
|
rdoc.title = "Railties -- Gluing the Engine to the Rails"
|
236
|
-
rdoc.options << '--line-numbers --inline-source --accessor cattr_accessor=object'
|
241
|
+
rdoc.options << '--line-numbers' << '--inline-source' << '--accessor' << 'cattr_accessor=object'
|
237
242
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
238
243
|
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
239
244
|
rdoc.rdoc_files.include('lib/*.rb')
|
@@ -272,12 +277,12 @@ spec = Gem::Specification.new do |s|
|
|
272
277
|
on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.
|
273
278
|
EOF
|
274
279
|
|
275
|
-
s.add_dependency('rake', '>= 0.
|
276
|
-
s.add_dependency('activesupport', '= 1.
|
277
|
-
s.add_dependency('activerecord', '= 1.
|
278
|
-
s.add_dependency('actionpack', '= 1.
|
279
|
-
s.add_dependency('actionmailer', '= 1.
|
280
|
-
s.add_dependency('actionwebservice', '= 1.
|
280
|
+
s.add_dependency('rake', '>= 0.7.0')
|
281
|
+
s.add_dependency('activesupport', '= 1.3.0' + PKG_BUILD)
|
282
|
+
s.add_dependency('activerecord', '= 1.14.0' + PKG_BUILD)
|
283
|
+
s.add_dependency('actionpack', '= 1.12.0' + PKG_BUILD)
|
284
|
+
s.add_dependency('actionmailer', '= 1.2.0' + PKG_BUILD)
|
285
|
+
s.add_dependency('actionwebservice', '= 1.1.0' + PKG_BUILD)
|
281
286
|
|
282
287
|
s.rdoc_options << '--exclude' << '.'
|
283
288
|
s.has_rdoc = false
|
data/bin/rails
CHANGED
@@ -1,14 +1,4 @@
|
|
1
|
-
|
2
|
-
ruby_release = "#{RUBY_VERSION} (#{RUBY_RELEASE_DATE})"
|
3
|
-
if ruby_release < min_release
|
4
|
-
abort <<-end_message
|
5
|
-
|
6
|
-
Rails requires Ruby version #{min_release} or later.
|
7
|
-
You're running #{ruby_release}; please upgrade to continue.
|
8
|
-
|
9
|
-
end_message
|
10
|
-
end
|
11
|
-
|
1
|
+
require File.dirname(__FILE__) + '/../lib/ruby_version_check'
|
12
2
|
Signal.trap("INT") { puts; exit }
|
13
3
|
|
14
4
|
require File.dirname(__FILE__) + '/../lib/rails_version'
|
@@ -30,9 +30,15 @@ module Rails
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def edge_rails_revision(info = svn_info)
|
33
|
-
info[/^Revision: (\d+)/, 1]
|
33
|
+
info[/^Revision: (\d+)/, 1] || freeze_edge_version
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
|
+
def freeze_edge_version
|
37
|
+
if File.exists?(rails_vendor_root)
|
38
|
+
Dir[File.join(rails_vendor_root, 'REVISION_*')].first.scan(/_(\d+)$/).first.first rescue 'unknown'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
36
42
|
def to_s
|
37
43
|
column_width = properties.names.map {|name| name.length}.max
|
38
44
|
["About your application's environment", *properties.map do |property|
|
@@ -51,13 +57,20 @@ module Rails
|
|
51
57
|
table << '</table>'
|
52
58
|
end
|
53
59
|
end
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
60
|
+
|
61
|
+
protected
|
62
|
+
def rails_vendor_root
|
63
|
+
@rails_vendor_root ||= "#{RAILS_ROOT}/vendor/rails"
|
64
|
+
end
|
65
|
+
|
66
|
+
def svn_info
|
67
|
+
env_lang, ENV['LC_ALL'] = ENV['LC_ALL'], 'C'
|
68
|
+
Dir.chdir(rails_vendor_root) do
|
69
|
+
silence_stderr { `svn info` }
|
70
|
+
end
|
71
|
+
ensure
|
72
|
+
ENV['LC_ALL'] = env_lang
|
59
73
|
end
|
60
|
-
end
|
61
74
|
end
|
62
75
|
|
63
76
|
# The Ruby version and platform, e.g. "1.8.2 (powerpc-darwin8.2.0)".
|
@@ -100,5 +113,9 @@ module Rails
|
|
100
113
|
property 'Database adapter' do
|
101
114
|
ActiveRecord::Base.configurations[RAILS_ENV]['adapter']
|
102
115
|
end
|
116
|
+
|
117
|
+
property 'Database schema version' do
|
118
|
+
ActiveRecord::Migrator.current_version rescue nil
|
119
|
+
end
|
103
120
|
end
|
104
121
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
|
2
|
+
#
|
3
|
+
# Install the MySQL driver:
|
4
|
+
# gem install mysql
|
5
|
+
# On MacOS X:
|
6
|
+
# gem install mysql -- --include=/usr/local/lib
|
7
|
+
# On Windows:
|
8
|
+
# There is no gem for Windows. Install mysql.so from RubyForApache.
|
9
|
+
# http://rubyforge.org/projects/rubyforapache
|
10
|
+
#
|
11
|
+
# And be sure to use new-style password hashing:
|
12
|
+
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
|
13
|
+
development:
|
14
|
+
adapter: mysql
|
15
|
+
database: <%= app_name %>_development
|
16
|
+
username: root
|
17
|
+
password:
|
18
|
+
<% if socket -%>
|
19
|
+
socket: <%= socket %>
|
20
|
+
<% else -%>
|
21
|
+
host: localhost
|
22
|
+
<% end -%>
|
23
|
+
|
24
|
+
# Warning: The database defined as 'test' will be erased and
|
25
|
+
# re-generated from your development database when you run 'rake'.
|
26
|
+
# Do not set this db to the same as development or production.
|
27
|
+
test:
|
28
|
+
adapter: mysql
|
29
|
+
database: <%= app_name %>_test
|
30
|
+
username: root
|
31
|
+
password:
|
32
|
+
<% if socket -%>
|
33
|
+
socket: <%= socket %>
|
34
|
+
<% else -%>
|
35
|
+
host: localhost
|
36
|
+
<% end -%>
|
37
|
+
|
38
|
+
production:
|
39
|
+
adapter: mysql
|
40
|
+
database: <%= app_name %>_production
|
41
|
+
username: root
|
42
|
+
password:
|
43
|
+
<% if socket -%>
|
44
|
+
socket: <%= socket %>
|
45
|
+
<% else -%>
|
46
|
+
host: localhost
|
47
|
+
<% end -%>
|