rails 1.0.0 → 7.0.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.
- checksums.yaml +7 -0
- data/README.md +103 -0
- metadata +228 -294
- data/CHANGELOG +0 -865
- data/MIT-LICENSE +0 -20
- data/README +0 -153
- data/Rakefile +0 -422
- data/bin/about +0 -3
- data/bin/breakpointer +0 -3
- data/bin/console +0 -3
- data/bin/destroy +0 -3
- data/bin/generate +0 -3
- data/bin/performance/benchmarker +0 -3
- data/bin/performance/profiler +0 -3
- data/bin/plugin +0 -3
- data/bin/process/reaper +0 -3
- data/bin/process/spawner +0 -3
- data/bin/process/spinner +0 -3
- data/bin/rails +0 -21
- data/bin/runner +0 -3
- data/bin/server +0 -3
- data/builtin/controllers/rails_info_controller.rb +0 -11
- data/configs/apache.conf +0 -40
- data/configs/database.yml +0 -85
- data/configs/empty.log +0 -0
- data/configs/lighttpd.conf +0 -40
- data/configs/routes.rb +0 -19
- data/dispatches/dispatch.fcgi +0 -24
- data/dispatches/dispatch.rb +0 -10
- data/dispatches/gateway.cgi +0 -97
- data/doc/README_FOR_APP +0 -2
- data/environments/boot.rb +0 -19
- data/environments/development.rb +0 -19
- data/environments/environment.rb +0 -53
- data/environments/production.rb +0 -19
- data/environments/test.rb +0 -19
- data/fresh_rakefile +0 -10
- data/helpers/application.rb +0 -4
- data/helpers/application_helper.rb +0 -3
- data/helpers/test_helper.rb +0 -28
- data/html/404.html +0 -8
- data/html/500.html +0 -8
- data/html/favicon.ico +0 -0
- data/html/images/rails.png +0 -0
- data/html/index.html +0 -277
- data/html/javascripts/controls.js +0 -750
- data/html/javascripts/dragdrop.js +0 -584
- data/html/javascripts/effects.js +0 -854
- data/html/javascripts/prototype.js +0 -1785
- data/html/robots.txt +0 -1
- data/lib/binding_of_caller.rb +0 -85
- data/lib/breakpoint.rb +0 -523
- data/lib/breakpoint_client.rb +0 -196
- data/lib/code_statistics.rb +0 -107
- data/lib/commands/about.rb +0 -2
- data/lib/commands/breakpointer.rb +0 -1
- data/lib/commands/console.rb +0 -23
- data/lib/commands/destroy.rb +0 -6
- data/lib/commands/generate.rb +0 -6
- data/lib/commands/ncgi/listener +0 -86
- data/lib/commands/ncgi/tracker +0 -69
- data/lib/commands/performance/benchmarker.rb +0 -24
- data/lib/commands/performance/profiler.rb +0 -34
- data/lib/commands/plugin.rb +0 -823
- data/lib/commands/process/reaper.rb +0 -130
- data/lib/commands/process/spawner.rb +0 -52
- data/lib/commands/process/spinner.rb +0 -57
- data/lib/commands/runner.rb +0 -27
- data/lib/commands/server.rb +0 -28
- data/lib/commands/servers/lighttpd.rb +0 -60
- data/lib/commands/servers/webrick.rb +0 -59
- data/lib/commands/update.rb +0 -4
- data/lib/commands.rb +0 -17
- data/lib/console_sandbox.rb +0 -6
- data/lib/dispatcher.rb +0 -99
- data/lib/fcgi_handler.rb +0 -189
- data/lib/initializer.rb +0 -553
- data/lib/rails_generator/base.rb +0 -203
- data/lib/rails_generator/commands.rb +0 -509
- data/lib/rails_generator/generators/applications/app/USAGE +0 -16
- data/lib/rails_generator/generators/applications/app/app_generator.rb +0 -140
- data/lib/rails_generator/generators/components/controller/USAGE +0 -30
- data/lib/rails_generator/generators/components/controller/controller_generator.rb +0 -38
- data/lib/rails_generator/generators/components/controller/templates/controller.rb +0 -10
- data/lib/rails_generator/generators/components/controller/templates/functional_test.rb +0 -18
- data/lib/rails_generator/generators/components/controller/templates/helper.rb +0 -2
- data/lib/rails_generator/generators/components/controller/templates/view.rhtml +0 -2
- data/lib/rails_generator/generators/components/mailer/USAGE +0 -18
- data/lib/rails_generator/generators/components/mailer/mailer_generator.rb +0 -32
- data/lib/rails_generator/generators/components/mailer/templates/fixture.rhtml +0 -3
- data/lib/rails_generator/generators/components/mailer/templates/mailer.rb +0 -13
- data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +0 -37
- data/lib/rails_generator/generators/components/mailer/templates/view.rhtml +0 -3
- data/lib/rails_generator/generators/components/migration/USAGE +0 -14
- data/lib/rails_generator/generators/components/migration/migration_generator.rb +0 -7
- data/lib/rails_generator/generators/components/migration/templates/migration.rb +0 -7
- data/lib/rails_generator/generators/components/model/USAGE +0 -17
- data/lib/rails_generator/generators/components/model/model_generator.rb +0 -18
- data/lib/rails_generator/generators/components/model/templates/fixtures.yml +0 -5
- data/lib/rails_generator/generators/components/model/templates/model.rb +0 -2
- data/lib/rails_generator/generators/components/model/templates/unit_test.rb +0 -10
- data/lib/rails_generator/generators/components/plugin/USAGE +0 -33
- data/lib/rails_generator/generators/components/plugin/plugin_generator.rb +0 -33
- data/lib/rails_generator/generators/components/plugin/templates/README +0 -4
- data/lib/rails_generator/generators/components/plugin/templates/Rakefile +0 -22
- data/lib/rails_generator/generators/components/plugin/templates/USAGE +0 -8
- data/lib/rails_generator/generators/components/plugin/templates/generator.rb +0 -8
- data/lib/rails_generator/generators/components/plugin/templates/init.rb +0 -1
- data/lib/rails_generator/generators/components/plugin/templates/plugin.rb +0 -1
- data/lib/rails_generator/generators/components/plugin/templates/tasks.rake +0 -4
- data/lib/rails_generator/generators/components/plugin/templates/unit_test.rb +0 -8
- data/lib/rails_generator/generators/components/scaffold/USAGE +0 -32
- data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +0 -184
- data/lib/rails_generator/generators/components/scaffold/templates/controller.rb +0 -54
- data/lib/rails_generator/generators/components/scaffold/templates/form.rhtml +0 -3
- data/lib/rails_generator/generators/components/scaffold/templates/form_scaffolding.rhtml +0 -1
- data/lib/rails_generator/generators/components/scaffold/templates/functional_test.rb +0 -98
- data/lib/rails_generator/generators/components/scaffold/templates/helper.rb +0 -2
- data/lib/rails_generator/generators/components/scaffold/templates/layout.rhtml +0 -13
- data/lib/rails_generator/generators/components/scaffold/templates/style.css +0 -74
- data/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml +0 -9
- data/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +0 -27
- data/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml +0 -8
- data/lib/rails_generator/generators/components/scaffold/templates/view_show.rhtml +0 -8
- data/lib/rails_generator/generators/components/session_migration/USAGE +0 -15
- data/lib/rails_generator/generators/components/session_migration/session_migration_generator.rb +0 -12
- data/lib/rails_generator/generators/components/session_migration/templates/migration.rb +0 -15
- data/lib/rails_generator/generators/components/web_service/USAGE +0 -28
- data/lib/rails_generator/generators/components/web_service/templates/api_definition.rb +0 -5
- data/lib/rails_generator/generators/components/web_service/templates/controller.rb +0 -8
- data/lib/rails_generator/generators/components/web_service/templates/functional_test.rb +0 -19
- data/lib/rails_generator/generators/components/web_service/web_service_generator.rb +0 -29
- data/lib/rails_generator/lookup.rb +0 -210
- data/lib/rails_generator/manifest.rb +0 -53
- data/lib/rails_generator/options.rb +0 -140
- data/lib/rails_generator/scripts/destroy.rb +0 -7
- data/lib/rails_generator/scripts/generate.rb +0 -7
- data/lib/rails_generator/scripts/update.rb +0 -12
- data/lib/rails_generator/scripts.rb +0 -83
- data/lib/rails_generator/simple_logger.rb +0 -46
- data/lib/rails_generator/spec.rb +0 -44
- data/lib/rails_generator.rb +0 -43
- data/lib/rails_info.rb +0 -104
- data/lib/rails_version.rb +0 -9
- data/lib/railties_path.rb +0 -1
- data/lib/rubyprof_ext.rb +0 -35
- data/lib/tasks/databases.rake +0 -158
- data/lib/tasks/documentation.rake +0 -76
- data/lib/tasks/framework.rake +0 -71
- data/lib/tasks/javascripts.rake +0 -6
- data/lib/tasks/misc.rake +0 -19
- data/lib/tasks/rails.rb +0 -8
- data/lib/tasks/statistics.rake +0 -16
- data/lib/tasks/testing.rake +0 -50
- data/lib/test_help.rb +0 -17
- data/lib/webrick_server.rb +0 -170
data/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2004 David Heinemeier Hansson
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README
DELETED
@@ -1,153 +0,0 @@
|
|
1
|
-
== Welcome to Rails
|
2
|
-
|
3
|
-
Rails is a web-application and persistence framework that includes everything
|
4
|
-
needed to create database-backed web-applications according to the
|
5
|
-
Model-View-Control pattern of separation. This pattern splits the view (also
|
6
|
-
called the presentation) into "dumb" templates that are primarily responsible
|
7
|
-
for inserting pre-built data in between HTML tags. The model contains the
|
8
|
-
"smart" domain objects (such as Account, Product, Person, Post) that holds all
|
9
|
-
the business logic and knows how to persist themselves to a database. The
|
10
|
-
controller handles the incoming requests (such as Save New Account, Update
|
11
|
-
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. Run the WEBrick servlet: <tt>ruby script/server</tt> (run with --help for options)
|
31
|
-
...or if you have lighttpd installed: <tt>ruby script/lighttpd</tt> (it's faster)
|
32
|
-
2. Go to http://localhost:3000/ and get "Congratulations, you've put Ruby on Rails!"
|
33
|
-
3. Follow the guidelines on the "Congratulations, you've put Ruby on Rails!" screen
|
34
|
-
|
35
|
-
|
36
|
-
== Example for Apache conf
|
37
|
-
|
38
|
-
<VirtualHost *:80>
|
39
|
-
ServerName rails
|
40
|
-
DocumentRoot /path/application/public/
|
41
|
-
ErrorLog /path/application/log/server.log
|
42
|
-
|
43
|
-
<Directory /path/application/public/>
|
44
|
-
Options ExecCGI FollowSymLinks
|
45
|
-
AllowOverride all
|
46
|
-
Allow from all
|
47
|
-
Order allow,deny
|
48
|
-
</Directory>
|
49
|
-
</VirtualHost>
|
50
|
-
|
51
|
-
NOTE: Be sure that CGIs can be executed in that directory as well. So ExecCGI
|
52
|
-
should be on and ".cgi" should respond. All requests from 127.0.0.1 go
|
53
|
-
through CGI, so no Apache restart is necessary for changes. All other requests
|
54
|
-
go through FCGI (or mod_ruby), which requires a restart to show changes.
|
55
|
-
|
56
|
-
|
57
|
-
== Debugging Rails
|
58
|
-
|
59
|
-
Have "tail -f" commands running on both the server.log, production.log, and
|
60
|
-
test.log files. Rails will automatically display debugging and runtime
|
61
|
-
information to these files. Debugging info will also be shown in the browser
|
62
|
-
on requests from 127.0.0.1.
|
63
|
-
|
64
|
-
|
65
|
-
== Breakpoints
|
66
|
-
|
67
|
-
Breakpoint support is available through the script/breakpointer client. This
|
68
|
-
means that you can break out of execution at any point in the code, investigate
|
69
|
-
and change the model, AND then resume execution! Example:
|
70
|
-
|
71
|
-
class WeblogController < ActionController::Base
|
72
|
-
def index
|
73
|
-
@posts = Post.find_all
|
74
|
-
breakpoint "Breaking out from the list"
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
So the controller will accept the action, run the first line, then present you
|
79
|
-
with a IRB prompt in the breakpointer window. Here you can do things like:
|
80
|
-
|
81
|
-
Executing breakpoint "Breaking out from the list" at .../webrick_server.rb:16 in 'breakpoint'
|
82
|
-
|
83
|
-
>> @posts.inspect
|
84
|
-
=> "[#<Post:0x14a6be8 @attributes={\"title\"=>nil, \"body\"=>nil, \"id\"=>\"1\"}>,
|
85
|
-
#<Post:0x14a6620 @attributes={\"title\"=>\"Rails you know!\", \"body\"=>\"Only ten..\", \"id\"=>\"2\"}>]"
|
86
|
-
>> @posts.first.title = "hello from a breakpoint"
|
87
|
-
=> "hello from a breakpoint"
|
88
|
-
|
89
|
-
...and even better is that you can examine how your runtime objects actually work:
|
90
|
-
|
91
|
-
>> f = @posts.first
|
92
|
-
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
|
93
|
-
>> f.
|
94
|
-
Display all 152 possibilities? (y or n)
|
95
|
-
|
96
|
-
Finally, when you're ready to resume execution, you press CTRL-D
|
97
|
-
|
98
|
-
|
99
|
-
== Console
|
100
|
-
|
101
|
-
You can interact with the domain model by starting the console through script/console.
|
102
|
-
Here you'll have all parts of the application configured, just like it is when the
|
103
|
-
application is running. You can inspect domain models, change values, and save to the
|
104
|
-
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>.
|
106
|
-
|
107
|
-
|
108
|
-
== Description of contents
|
109
|
-
|
110
|
-
app
|
111
|
-
Holds all the code that's specific to this particular application.
|
112
|
-
|
113
|
-
app/controllers
|
114
|
-
Holds controllers that should be named like weblog_controller.rb for
|
115
|
-
automated URL mapping. All controllers should descend from
|
116
|
-
ActionController::Base.
|
117
|
-
|
118
|
-
app/models
|
119
|
-
Holds models that should be named like post.rb.
|
120
|
-
Most models will descend from ActiveRecord::Base.
|
121
|
-
|
122
|
-
app/views
|
123
|
-
Holds the template files for the view that should be named like
|
124
|
-
weblog/index.rhtml for the WeblogController#index action. All views use eRuby
|
125
|
-
syntax. This directory can also be used to keep stylesheets, images, and so on
|
126
|
-
that can be symlinked to public.
|
127
|
-
|
128
|
-
app/helpers
|
129
|
-
Holds view helpers that should be named like weblog_helper.rb.
|
130
|
-
|
131
|
-
config
|
132
|
-
Configuration files for the Rails environment, the routing map, the database, and other dependencies.
|
133
|
-
|
134
|
-
components
|
135
|
-
Self-contained mini-applications that can bundle together controllers, models, and views.
|
136
|
-
|
137
|
-
lib
|
138
|
-
Application specific libraries. Basically, any kind of custom code that doesn't
|
139
|
-
belong under controllers, models, or helpers. This directory is in the load path.
|
140
|
-
|
141
|
-
public
|
142
|
-
The directory available for the web server. Contains subdirectories for images, stylesheets,
|
143
|
-
and javascripts. Also contains the dispatchers and the default HTML files.
|
144
|
-
|
145
|
-
script
|
146
|
-
Helper scripts for automation and generation.
|
147
|
-
|
148
|
-
test
|
149
|
-
Unit and functional tests along with fixtures.
|
150
|
-
|
151
|
-
vendor
|
152
|
-
External libraries that the application depends on. Also includes the plugins subdirectory.
|
153
|
-
This directory is in the load path.
|
data/Rakefile
DELETED
@@ -1,422 +0,0 @@
|
|
1
|
-
require 'rake'
|
2
|
-
require 'rake/testtask'
|
3
|
-
require 'rake/rdoctask'
|
4
|
-
require 'rake/gempackagetask'
|
5
|
-
require 'rake/contrib/rubyforgepublisher'
|
6
|
-
|
7
|
-
require 'date'
|
8
|
-
require 'rbconfig'
|
9
|
-
|
10
|
-
require File.join(File.dirname(__FILE__), 'lib', 'rails_version')
|
11
|
-
|
12
|
-
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
13
|
-
PKG_NAME = 'rails'
|
14
|
-
PKG_VERSION = Rails::VERSION::STRING + PKG_BUILD
|
15
|
-
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
16
|
-
PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"
|
17
|
-
|
18
|
-
RELEASE_NAME = "REL #{PKG_VERSION}"
|
19
|
-
|
20
|
-
RUBY_FORGE_PROJECT = "rails"
|
21
|
-
RUBY_FORGE_USER = "webster132"
|
22
|
-
|
23
|
-
|
24
|
-
# Rake::TestTask.new("test") do |t|
|
25
|
-
# t.libs << 'test'
|
26
|
-
# t.pattern = 'test/*_test.rb'
|
27
|
-
# t.verbose = true
|
28
|
-
# end
|
29
|
-
|
30
|
-
|
31
|
-
BASE_DIRS = %w( app config/environments components db doc log lib lib/tasks public script script/performance script/process test vendor vendor/plugins )
|
32
|
-
APP_DIRS = %w( models controllers helpers views views/layouts )
|
33
|
-
PUBLIC_DIRS = %w( images javascripts stylesheets )
|
34
|
-
TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
|
35
|
-
|
36
|
-
LOG_FILES = %w( server.log development.log test.log production.log )
|
37
|
-
HTML_FILES = %w( 404.html 500.html index.html robots.txt favicon.ico images/rails.png
|
38
|
-
javascripts/prototype.js
|
39
|
-
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 process/spinner runner server plugin )
|
41
|
-
|
42
|
-
VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )
|
43
|
-
|
44
|
-
|
45
|
-
desc "Generates a fresh Rails package with documentation"
|
46
|
-
task :fresh_rails => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_vendor_libraries, :copy_ties_content, :generate_documentation ]
|
47
|
-
|
48
|
-
desc "Generates a fresh Rails package using GEMs with documentation"
|
49
|
-
task :fresh_gem_rails => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_ties_content, :copy_gem_environment ]
|
50
|
-
|
51
|
-
desc "Generates a fresh Rails package without documentation (faster)"
|
52
|
-
task :fresh_rails_without_docs => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_vendor_libraries, :copy_ties_content ]
|
53
|
-
|
54
|
-
desc "Generates a fresh Rails package without documentation (faster)"
|
55
|
-
task :fresh_rails_without_docs_using_links => [ :clean, :make_dir_structure, :initialize_file_stubs, :link_vendor_libraries, :copy_ties_content ]
|
56
|
-
|
57
|
-
desc "Generates minimal Rails package using symlinks"
|
58
|
-
task :dev => [ :clean, :make_dir_structure, :initialize_file_stubs, :link_vendor_libraries, :copy_ties_content ]
|
59
|
-
|
60
|
-
desc "Packages the fresh Rails package with documentation"
|
61
|
-
task :package => [ :clean, :fresh_rails ] do
|
62
|
-
system %{cd ..; tar -czvf #{PKG_NAME}-#{PKG_VERSION}.tgz #{PKG_NAME}}
|
63
|
-
system %{cd ..; zip -r #{PKG_NAME}-#{PKG_VERSION}.zip #{PKG_NAME}}
|
64
|
-
end
|
65
|
-
|
66
|
-
task :clean do
|
67
|
-
rm_rf PKG_DESTINATION
|
68
|
-
end
|
69
|
-
|
70
|
-
# Get external spinoffs -------------------------------------------------------------------
|
71
|
-
|
72
|
-
desc "Updates railties to the latest version of the javascript spinoffs"
|
73
|
-
task :update_js do
|
74
|
-
for js in %w( prototype controls dragdrop effects slider )
|
75
|
-
rm "html/javascripts/#{js}.js"
|
76
|
-
cp "./../actionpack/lib/action_view/helpers/javascripts/#{js}.js", "html/javascripts"
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# Make directory structure ----------------------------------------------------------------
|
81
|
-
|
82
|
-
def make_dest_dirs(dirs, path = nil)
|
83
|
-
mkdir_p dirs.map { |dir| File.join(PKG_DESTINATION, path, dir) }
|
84
|
-
end
|
85
|
-
|
86
|
-
desc "Make the directory structure for the new Rails application"
|
87
|
-
task :make_dir_structure => [ :make_base_dirs, :make_app_dirs, :make_public_dirs, :make_test_dirs ]
|
88
|
-
|
89
|
-
task(:make_base_dirs) { make_dest_dirs BASE_DIRS }
|
90
|
-
task(:make_app_dirs) { make_dest_dirs APP_DIRS, 'app' }
|
91
|
-
task(:make_public_dirs) { make_dest_dirs PUBLIC_DIRS, 'public' }
|
92
|
-
task(:make_test_dirs) { make_dest_dirs TEST_DIRS, 'test' }
|
93
|
-
|
94
|
-
|
95
|
-
# Initialize file stubs -------------------------------------------------------------------
|
96
|
-
|
97
|
-
desc "Initialize empty file stubs (such as for logging)"
|
98
|
-
task :initialize_file_stubs => [ :initialize_log_files ]
|
99
|
-
|
100
|
-
task :initialize_log_files do
|
101
|
-
log_dir = File.join(PKG_DESTINATION, 'log')
|
102
|
-
chmod 0777, log_dir
|
103
|
-
LOG_FILES.each do |log_file|
|
104
|
-
log_path = File.join(log_dir, log_file)
|
105
|
-
touch log_path
|
106
|
-
chmod 0666, log_path
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
|
111
|
-
# Copy Vendors ----------------------------------------------------------------------------
|
112
|
-
|
113
|
-
desc "Copy in all the Rails packages to vendor"
|
114
|
-
task :copy_vendor_libraries do
|
115
|
-
mkdir File.join(PKG_DESTINATION, 'vendor', 'rails')
|
116
|
-
VENDOR_LIBS.each { |dir| cp_r File.join('..', dir), File.join(PKG_DESTINATION, 'vendor', 'rails', dir) }
|
117
|
-
end
|
118
|
-
|
119
|
-
desc "Link in all the Rails packages to vendor"
|
120
|
-
task :link_vendor_libraries do
|
121
|
-
mkdir File.join(PKG_DESTINATION, 'vendor', 'rails')
|
122
|
-
VENDOR_LIBS.each { |dir| ln_s File.join('..', '..', '..', dir), File.join(PKG_DESTINATION, 'vendor', 'rails', dir) }
|
123
|
-
end
|
124
|
-
|
125
|
-
|
126
|
-
# Copy Ties Content -----------------------------------------------------------------------
|
127
|
-
|
128
|
-
# :link_apache_config
|
129
|
-
desc "Make copies of all the default content of ties"
|
130
|
-
task :copy_ties_content => [
|
131
|
-
:copy_rootfiles, :copy_dispatches, :copy_html_files, :copy_application,
|
132
|
-
:copy_configs, :copy_binfiles, :copy_test_helpers, :copy_app_doc_readme ]
|
133
|
-
|
134
|
-
task :copy_dispatches do
|
135
|
-
copy_with_rewritten_ruby_path("dispatches/dispatch.rb", "#{PKG_DESTINATION}/public/dispatch.rb")
|
136
|
-
chmod 0755, "#{PKG_DESTINATION}/public/dispatch.rb"
|
137
|
-
|
138
|
-
copy_with_rewritten_ruby_path("dispatches/dispatch.rb", "#{PKG_DESTINATION}/public/dispatch.cgi")
|
139
|
-
chmod 0755, "#{PKG_DESTINATION}/public/dispatch.cgi"
|
140
|
-
|
141
|
-
copy_with_rewritten_ruby_path("dispatches/dispatch.fcgi", "#{PKG_DESTINATION}/public/dispatch.fcgi")
|
142
|
-
chmod 0755, "#{PKG_DESTINATION}/public/dispatch.fcgi"
|
143
|
-
|
144
|
-
# copy_with_rewritten_ruby_path("dispatches/gateway.cgi", "#{PKG_DESTINATION}/public/gateway.cgi")
|
145
|
-
# chmod 0755, "#{PKG_DESTINATION}/public/gateway.cgi"
|
146
|
-
end
|
147
|
-
|
148
|
-
task :copy_html_files do
|
149
|
-
HTML_FILES.each { |file| cp File.join('html', file), File.join(PKG_DESTINATION, 'public', file) }
|
150
|
-
end
|
151
|
-
|
152
|
-
task :copy_application do
|
153
|
-
cp "helpers/application.rb", "#{PKG_DESTINATION}/app/controllers/application.rb"
|
154
|
-
cp "helpers/application_helper.rb", "#{PKG_DESTINATION}/app/helpers/application_helper.rb"
|
155
|
-
end
|
156
|
-
|
157
|
-
task :copy_configs do
|
158
|
-
app_name = "rails"
|
159
|
-
socket = nil
|
160
|
-
require 'erb'
|
161
|
-
File.open("#{PKG_DESTINATION}/config/database.yml", 'w') {|f| f.write ERB.new(IO.read("configs/database.yml"), nil, '-').result(binding)}
|
162
|
-
|
163
|
-
cp "configs/routes.rb", "#{PKG_DESTINATION}/config/routes.rb"
|
164
|
-
|
165
|
-
cp "configs/apache.conf", "#{PKG_DESTINATION}/public/.htaccess"
|
166
|
-
|
167
|
-
cp "environments/boot.rb", "#{PKG_DESTINATION}/config/boot.rb"
|
168
|
-
cp "environments/environment.rb", "#{PKG_DESTINATION}/config/environment.rb"
|
169
|
-
cp "environments/production.rb", "#{PKG_DESTINATION}/config/environments/production.rb"
|
170
|
-
cp "environments/development.rb", "#{PKG_DESTINATION}/config/environments/development.rb"
|
171
|
-
cp "environments/test.rb", "#{PKG_DESTINATION}/config/environments/test.rb"
|
172
|
-
end
|
173
|
-
|
174
|
-
task :copy_binfiles do
|
175
|
-
BIN_FILES.each do |file|
|
176
|
-
dest_file = File.join(PKG_DESTINATION, 'script', file)
|
177
|
-
copy_with_rewritten_ruby_path(File.join('bin', file), dest_file)
|
178
|
-
chmod 0755, dest_file
|
179
|
-
end
|
180
|
-
end
|
181
|
-
|
182
|
-
task :copy_rootfiles do
|
183
|
-
cp "fresh_rakefile", "#{PKG_DESTINATION}/Rakefile"
|
184
|
-
cp "README", "#{PKG_DESTINATION}/README"
|
185
|
-
cp "CHANGELOG", "#{PKG_DESTINATION}/CHANGELOG"
|
186
|
-
end
|
187
|
-
|
188
|
-
task :copy_test_helpers do
|
189
|
-
cp "helpers/test_helper.rb", "#{PKG_DESTINATION}/test/test_helper.rb"
|
190
|
-
end
|
191
|
-
|
192
|
-
task :copy_app_doc_readme do
|
193
|
-
cp "doc/README_FOR_APP", "#{PKG_DESTINATION}/doc/README_FOR_APP"
|
194
|
-
end
|
195
|
-
|
196
|
-
task :link_apache_config do
|
197
|
-
chdir(File.join(PKG_DESTINATION, 'config')) {
|
198
|
-
ln_s "../public/.htaccess", "apache.conf"
|
199
|
-
}
|
200
|
-
end
|
201
|
-
|
202
|
-
def copy_with_rewritten_ruby_path(src_file, dest_file)
|
203
|
-
ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
|
204
|
-
|
205
|
-
File.open(dest_file, 'w') do |df|
|
206
|
-
File.open(src_file) do |sf|
|
207
|
-
line = sf.gets
|
208
|
-
if (line =~ /#!.+ruby\s*/) != nil
|
209
|
-
df.puts("#!#{ruby}")
|
210
|
-
else
|
211
|
-
df.puts(line)
|
212
|
-
end
|
213
|
-
df.write(sf.read)
|
214
|
-
end
|
215
|
-
end
|
216
|
-
end
|
217
|
-
|
218
|
-
|
219
|
-
# Generate documentation ------------------------------------------------------------------
|
220
|
-
|
221
|
-
desc "Generate documentation for the framework and for the empty application"
|
222
|
-
task :generate_documentation => [ :generate_app_doc, :generate_rails_framework_doc ]
|
223
|
-
|
224
|
-
task :generate_rails_framework_doc do
|
225
|
-
system %{cd #{PKG_DESTINATION}; rake apidoc}
|
226
|
-
end
|
227
|
-
|
228
|
-
task :generate_app_doc do
|
229
|
-
File.cp "doc/README_FOR_APP", "#{PKG_DESTINATION}/doc/README_FOR_APP"
|
230
|
-
system %{cd #{PKG_DESTINATION}; rake appdoc}
|
231
|
-
end
|
232
|
-
|
233
|
-
Rake::RDocTask.new { |rdoc|
|
234
|
-
rdoc.rdoc_dir = 'doc'
|
235
|
-
rdoc.title = "Railties -- Gluing the Engine to the Rails"
|
236
|
-
rdoc.options << '--line-numbers --inline-source --accessor cattr_accessor=object'
|
237
|
-
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
238
|
-
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
239
|
-
rdoc.rdoc_files.include('lib/*.rb')
|
240
|
-
rdoc.rdoc_files.include('lib/rails_generator/*.rb')
|
241
|
-
rdoc.rdoc_files.include('lib/commands/**/*.rb')
|
242
|
-
}
|
243
|
-
|
244
|
-
# Generate GEM ----------------------------------------------------------------------------
|
245
|
-
|
246
|
-
task :copy_gem_environment do
|
247
|
-
cp "environments/environment.rb", "#{PKG_DESTINATION}/config/environment.rb"
|
248
|
-
chmod 0755, dest_file
|
249
|
-
end
|
250
|
-
|
251
|
-
|
252
|
-
PKG_FILES = FileList[
|
253
|
-
'[a-zA-Z]*',
|
254
|
-
'bin/**/*',
|
255
|
-
'builtin/**/*',
|
256
|
-
'configs/**/*',
|
257
|
-
'doc/**/*',
|
258
|
-
'dispatches/**/*',
|
259
|
-
'environments/**/*',
|
260
|
-
'helpers/**/*',
|
261
|
-
'generators/**/*',
|
262
|
-
'html/**/*',
|
263
|
-
'lib/**/*'
|
264
|
-
]
|
265
|
-
|
266
|
-
spec = Gem::Specification.new do |s|
|
267
|
-
s.name = 'rails'
|
268
|
-
s.version = PKG_VERSION
|
269
|
-
s.summary = "Web-application framework with template engine, control-flow layer, and ORM."
|
270
|
-
s.description = <<-EOF
|
271
|
-
Rails is a framework for building web-application using CGI, FCGI, mod_ruby, or WEBrick
|
272
|
-
on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.
|
273
|
-
EOF
|
274
|
-
|
275
|
-
s.add_dependency('rake', '>= 0.6.2')
|
276
|
-
s.add_dependency('activesupport', '= 1.2.5' + PKG_BUILD)
|
277
|
-
s.add_dependency('activerecord', '= 1.13.2' + PKG_BUILD)
|
278
|
-
s.add_dependency('actionpack', '= 1.11.2' + PKG_BUILD)
|
279
|
-
s.add_dependency('actionmailer', '= 1.1.5' + PKG_BUILD)
|
280
|
-
s.add_dependency('actionwebservice', '= 1.0.0' + PKG_BUILD)
|
281
|
-
|
282
|
-
s.rdoc_options << '--exclude' << '.'
|
283
|
-
s.has_rdoc = false
|
284
|
-
|
285
|
-
s.files = PKG_FILES.to_a.delete_if {|f| f.include?('.svn')}
|
286
|
-
s.require_path = 'lib'
|
287
|
-
|
288
|
-
s.bindir = "bin" # Use these for applications.
|
289
|
-
s.executables = ["rails"]
|
290
|
-
s.default_executable = "rails"
|
291
|
-
|
292
|
-
s.author = "David Heinemeier Hansson"
|
293
|
-
s.email = "david@loudthinking.com"
|
294
|
-
s.homepage = "http://www.rubyonrails.org"
|
295
|
-
s.rubyforge_project = "rails"
|
296
|
-
end
|
297
|
-
|
298
|
-
Rake::GemPackageTask.new(spec) do |pkg|
|
299
|
-
end
|
300
|
-
|
301
|
-
|
302
|
-
# Publishing -------------------------------------------------------
|
303
|
-
desc "Publish the API documentation"
|
304
|
-
task :pgem => [:gem] do
|
305
|
-
Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.org", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
|
306
|
-
`ssh davidhh@wrath.rubyonrails.org './gemupdate.sh'`
|
307
|
-
end
|
308
|
-
|
309
|
-
desc "Publish the release files to RubyForge."
|
310
|
-
task :release => [:gem] do
|
311
|
-
files = ["gem"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
|
312
|
-
|
313
|
-
if RUBY_FORGE_PROJECT then
|
314
|
-
require 'net/http'
|
315
|
-
require 'open-uri'
|
316
|
-
|
317
|
-
project_uri = "http://rubyforge.org/projects/#{RUBY_FORGE_PROJECT}/"
|
318
|
-
project_data = open(project_uri) { |data| data.read }
|
319
|
-
group_id = project_data[/[?&]group_id=(\d+)/, 1]
|
320
|
-
raise "Couldn't get group id" unless group_id
|
321
|
-
|
322
|
-
# This echos password to shell which is a bit sucky
|
323
|
-
if ENV["RUBY_FORGE_PASSWORD"]
|
324
|
-
password = ENV["RUBY_FORGE_PASSWORD"]
|
325
|
-
else
|
326
|
-
print "#{RUBY_FORGE_USER}@rubyforge.org's password: "
|
327
|
-
password = STDIN.gets.chomp
|
328
|
-
end
|
329
|
-
|
330
|
-
login_response = Net::HTTP.start("rubyforge.org", 80) do |http|
|
331
|
-
data = [
|
332
|
-
"login=1",
|
333
|
-
"form_loginname=#{RUBY_FORGE_USER}",
|
334
|
-
"form_pw=#{password}"
|
335
|
-
].join("&")
|
336
|
-
http.post("/account/login.php", data)
|
337
|
-
end
|
338
|
-
|
339
|
-
cookie = login_response["set-cookie"]
|
340
|
-
raise "Login failed" unless cookie
|
341
|
-
headers = { "Cookie" => cookie }
|
342
|
-
|
343
|
-
release_uri = "http://rubyforge.org/frs/admin/?group_id=#{group_id}"
|
344
|
-
release_data = open(release_uri, headers) { |data| data.read }
|
345
|
-
package_id = release_data[/[?&]package_id=(\d+)/, 1]
|
346
|
-
raise "Couldn't get package id" unless package_id
|
347
|
-
|
348
|
-
first_file = true
|
349
|
-
release_id = ""
|
350
|
-
|
351
|
-
files.each do |filename|
|
352
|
-
basename = File.basename(filename)
|
353
|
-
file_ext = File.extname(filename)
|
354
|
-
file_data = File.open(filename, "rb") { |file| file.read }
|
355
|
-
|
356
|
-
puts "Releasing #{basename}..."
|
357
|
-
|
358
|
-
release_response = Net::HTTP.start("rubyforge.org", 80) do |http|
|
359
|
-
release_date = Time.now.strftime("%Y-%m-%d %H:%M")
|
360
|
-
type_map = {
|
361
|
-
".zip" => "3000",
|
362
|
-
".tgz" => "3110",
|
363
|
-
".gz" => "3110",
|
364
|
-
".gem" => "1400"
|
365
|
-
}; type_map.default = "9999"
|
366
|
-
type = type_map[file_ext]
|
367
|
-
boundary = "rubyqMY6QN9bp6e4kS21H4y0zxcvoor"
|
368
|
-
|
369
|
-
query_hash = if first_file then
|
370
|
-
{
|
371
|
-
"group_id" => group_id,
|
372
|
-
"package_id" => package_id,
|
373
|
-
"release_name" => RELEASE_NAME,
|
374
|
-
"release_date" => release_date,
|
375
|
-
"type_id" => type,
|
376
|
-
"processor_id" => "8000", # Any
|
377
|
-
"release_notes" => "",
|
378
|
-
"release_changes" => "",
|
379
|
-
"preformatted" => "1",
|
380
|
-
"submit" => "1"
|
381
|
-
}
|
382
|
-
else
|
383
|
-
{
|
384
|
-
"group_id" => group_id,
|
385
|
-
"release_id" => release_id,
|
386
|
-
"package_id" => package_id,
|
387
|
-
"step2" => "1",
|
388
|
-
"type_id" => type,
|
389
|
-
"processor_id" => "8000", # Any
|
390
|
-
"submit" => "Add This File"
|
391
|
-
}
|
392
|
-
end
|
393
|
-
|
394
|
-
query = "?" + query_hash.map do |(name, value)|
|
395
|
-
[name, URI.encode(value)].join("=")
|
396
|
-
end.join("&")
|
397
|
-
|
398
|
-
data = [
|
399
|
-
"--" + boundary,
|
400
|
-
"Content-Disposition: form-data; name=\"userfile\"; filename=\"#{basename}\"",
|
401
|
-
"Content-Type: application/octet-stream",
|
402
|
-
"Content-Transfer-Encoding: binary",
|
403
|
-
"", file_data, ""
|
404
|
-
].join("\x0D\x0A")
|
405
|
-
|
406
|
-
release_headers = headers.merge(
|
407
|
-
"Content-Type" => "multipart/form-data; boundary=#{boundary}"
|
408
|
-
)
|
409
|
-
|
410
|
-
target = first_file ? "/frs/admin/qrs.php" : "/frs/admin/editrelease.php"
|
411
|
-
http.post(target + query, data, release_headers)
|
412
|
-
end
|
413
|
-
|
414
|
-
if first_file then
|
415
|
-
release_id = release_response.body[/release_id=(\d+)/, 1]
|
416
|
-
raise("Couldn't get release id") unless release_id
|
417
|
-
end
|
418
|
-
|
419
|
-
first_file = false
|
420
|
-
end
|
421
|
-
end
|
422
|
-
end
|
data/bin/about
DELETED
data/bin/breakpointer
DELETED
data/bin/console
DELETED
data/bin/destroy
DELETED
data/bin/generate
DELETED
data/bin/performance/benchmarker
DELETED
data/bin/performance/profiler
DELETED
data/bin/plugin
DELETED
data/bin/process/reaper
DELETED
data/bin/process/spawner
DELETED
data/bin/process/spinner
DELETED
data/bin/rails
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
min_release = "1.8.2 (2004-12-25)"
|
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
|
-
|
12
|
-
Signal.trap("INT") { puts; exit }
|
13
|
-
|
14
|
-
require File.dirname(__FILE__) + '/../lib/rails_version'
|
15
|
-
abort "Rails #{Rails::VERSION::STRING}" if %w(--version -v).include? ARGV.first
|
16
|
-
|
17
|
-
require File.dirname(__FILE__) + '/../lib/rails_generator'
|
18
|
-
|
19
|
-
require 'rails_generator/scripts/generate'
|
20
|
-
Rails::Generator::Base.use_application_sources!
|
21
|
-
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
|
data/bin/runner
DELETED