Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit dbbf9d1

Browse files
author
ben
committed
r807@c01: ben | 2005-11-08 21:19:29 -0800
Update site to Rails 0.14.3. Tests run, but who knows if the site will :P git-svn-id: http://svn.pdxruby.org/repos/www/trunk@153 f0fbaf97-c700-0410-a5eb-8ea856f8537e
1 parent 9d0763f commit dbbf9d1

33 files changed

+2980
-1392
lines changed

CHANGELOG

+114
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,119 @@
1+
*0.14.2 (RC3)* (October 26th, 2005)
2+
3+
* Constants set in the development/test/production environment file are set in Object
4+
5+
* Scaffold generator pays attention to the controller name. #2562 [[email protected]]
6+
7+
* Include tasks from vendor/plugins/*/tasks in the Rakefile #2545 [Rick Olson]
8+
9+
10+
*0.14.1 (RC2)* (October 19th, 2005)
11+
12+
* Don't clean RAILS_ROOT on windows
13+
14+
* Remove trailing '/' from RAILS_ROOT [Nicholas Seckar]
15+
16+
* Upgraded to Active Record 1.12.1 and Action Pack 1.10.1
17+
18+
19+
*0.14.0 (RC1)* (October 16th, 2005)
20+
21+
* Moved generator folder from RAILS_ROOT/generators to RAILS_ROOT/lib/generators [Tobias Luetke]
22+
23+
* Fix rake dev and related commands [Nicholas Seckar]
24+
25+
* The rails command tries to deduce your MySQL socket by running `mysql_config
26+
--socket`. If it fails, default to /path/to/your/mysql.sock
27+
28+
* Made the rails command use the application name for database names in the tailored database.yml file. Example: "rails ~/projects/blog" will use "blog_development" instead of "rails_development". [Florian Weber]
29+
30+
* Added Rails framework freezing tasks: freeze_gems (freeze to current gems), freeze_edge (freeze to Rails SVN trunk), unfreeze_rails (float with newest gems on system)
31+
32+
* Added update_javascripts task which will fetch all the latest js files from your current rails install. Use after updating rails. [Tobias Luetke]
33+
34+
* Added cleaning of RAILS_ROOT to useless elements such as '../non-dot-dot/'. Provides cleaner backtraces and error messages. [Nicholas Seckar]
35+
36+
* Made the instantiated/transactional fixtures settings be controlled through Rails::Initializer. Transactional and non-instantiated fixtures are default from now on. [Florian Weber]
37+
38+
* Support using different database adapters for development and test with ActiveRecord::Base.schema_format = :ruby [Sam Stephenson]
39+
40+
* Make webrick work with session(:off)
41+
42+
* Add --version, -v option to the Rails command. Closes #1840. [stancell]
43+
44+
* Update Prototype to V1.4.0_pre11, script.aculo.us to V1.5_rc3 [2504] and fix the rails generator to include the new .js files [Thomas Fuchs]
45+
46+
* Make the generator skip a file if it already exists and is identical to the new file.
47+
48+
* Add experimental plugin support #2335
49+
50+
* Made Rakefile aware of new .js files in script.aculo.us [Thomas Fuchs]
51+
52+
* Make table_name and controller_name in generators honor AR::Base.pluralize_table_names. #1216 #2213 [[email protected]]
53+
54+
* Clearly label functional and unit tests in rake stats output. #2297 [[email protected]]
55+
56+
* Make the migration generator only check files ending in *.rb when calculating the next file name #2317 [Chad Fowler]
57+
58+
* Added prevention of duplicate migrations from the generator #2240 [[email protected]]
59+
60+
* Add db_schema_dump and db_schema_import rake tasks to work with the new ActiveRecord::SchemaDumper (for dumping a schema to and reading a schema from a ruby file).
61+
62+
* Reformed all the config/environments/* files to conform to the new Rails::Configuration approach. Fully backwards compatible.
63+
64+
* Added create_sessions_table, drop_sessions_table, and purge_sessions_table as rake tasks for databases that supports migrations (MySQL, PostgreSQL, SQLite) to get a table for use with CGI::Session::ActiveRecordStore
65+
66+
* Added dump of schema version to the db_structure_dump task for databases that support migrations #1835 [Rick Olson]
67+
68+
* Fixed script/profiler for Ruby 1.8.2 #1863 [Rick Olson]
69+
70+
* Fixed clone_structure_to_test task for SQLite #1864 [[email protected]]
71+
72+
* Added -m/--mime-types option to the WEBrick server, so you can specify a Apache-style mime.types file to load #2059 [[email protected]]
73+
74+
* Added -c/--svn option to the generator that'll add new files and remove destroyed files using svn add/revert/remove as appropriate #2064 [[email protected]]
75+
76+
* Added -c/--charset option to WEBrick server, so you can specify a default charset (which without changes is UTF-8) #2084 [[email protected]]
77+
78+
* Make the default stats task extendable by modifying the STATS_DIRECTORIES constant
79+
80+
* Allow the selected environment to define RAILS_DEFAULT_LOGGER, and have Rails::Initializer use it if it exists.
81+
82+
* Moved all the shared tasks from Rakefile into Rails, so that the Rakefile is empty and doesn't require updating.
83+
84+
* Added Rails::Initializer and Rails::Configuration to abstract all of the common setup out of config/environment.rb (uses config/boot.rb to bootstrap the initializer and paths)
85+
86+
* Fixed the scaffold generator to fail right away if the database isn't accessible instead of in mid-air #1169 [Chad Fowler]
87+
88+
* Corrected project-local generator location in scripts.rb #2010 [Michael Schuerig]
89+
90+
* Don't require the environment just to clear the logs #2093 [Scott Barron]
91+
92+
* Make the default rakefile read *.rake files from config/tasks (for easy extension of the rakefile by e.g. generators)
93+
94+
* Only load breakpoint in development mode and when BREAKPOINT_SERVER_PORT is defined.
95+
96+
* Allow the --toggle-spin switch on process/reaper to be negated
97+
98+
* Replace render_partial with render :partial in scaffold generator [Nicholas Seckar]
99+
100+
* Added -w flag to ps in process/reaper #1934 [Scott Barron]
101+
102+
* Allow ERb in the database.yml file (just like with fixtures), so you can pull out the database configuration in environment variables #1822 [Duane Johnson]
103+
104+
* Added convenience controls for FCGI processes (especially when managed remotely): spinner, spawner, and reaper. They reside in script/process. More details can be had by calling them with -h/--help.
105+
106+
* Added load_fixtures task to the Rakefile, which will load all the fixtures into the database for the current environment #1791 [Marcel Molina]
107+
108+
* Added an empty robots.txt to public/, so that web servers asking for it won't trigger a dynamic call, like favicon.ico #1738 [michael@schubert]
109+
110+
* Dropped the 'immediate close-down' of FCGI processes since it didn't work consistently and produced bad responses when it didn't. So now a TERM ensures exit after the next request (just as if the process is handling a request when it receives the signal). This means that you'll have to 'nudge' all FCGI processes with a request in order to ensure that they have all reloaded. This can be done by something like ./script/process/repear --nudge 'http://www.myapp.com' --instances 10, which will load the myapp site 10 times (and thus hit all of the 10 FCGI processes once, enough to shut down).
111+
112+
1113
*0.13.1* (11 July, 2005)
2114

115+
* Look for app-specific generators in RAILS_ROOT/generators rather than the clunky old RAILS_ROOT/script/generators. Nobody really uses this feature except for the unit tests, so it's a negligible-impact change. If you want to work with third-party generators, drop them in ~/.rails/generators or simply install gems.
116+
3117
* Fixed that each request with the WEBrick adapter would open a new database connection #1685 [Sam Stephenson]
4118

5119
* Added support for SQL Server in the database rake tasks #1652 [[email protected]] Note: osql and scptxfr may need to be installed on your development environment. This involves getting the .exes and a .rll (scptxfr) from a production SQL Server (not developer level SQL Server). Add their location to your Environment PATH and you are all set.

Rakefile

+6-213
Original file line numberDiff line numberDiff line change
@@ -1,217 +1,10 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/switchtower.rake, and they will automatically be available to Rake.
3+
4+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5+
16
require 'rake'
27
require 'rake/testtask'
38
require 'rake/rdoctask'
49

5-
$VERBOSE = nil
6-
TEST_CHANGES_SINCE = Time.now - 600
7-
8-
desc "Run all the tests on a fresh test database"
9-
task :default => [ :test_units, :test_functional ]
10-
11-
12-
desc 'Require application environment.'
13-
task :environment do
14-
unless defined? RAILS_ROOT
15-
require File.dirname(__FILE__) + '/config/environment'
16-
end
17-
end
18-
19-
desc "Generate API documentation, show coding stats"
20-
task :doc => [ :appdoc, :stats ]
21-
22-
23-
# Look up tests for recently modified sources.
24-
def recent_tests(source_pattern, test_path, touched_since = 10.minutes.ago)
25-
FileList[source_pattern].map do |path|
26-
if File.mtime(path) > touched_since
27-
test = "#{test_path}/#{File.basename(path, '.rb')}_test.rb"
28-
test if File.exists?(test)
29-
end
30-
end.compact
31-
end
32-
33-
desc 'Test recent changes.'
34-
Rake::TestTask.new(:recent => [ :clone_structure_to_test ]) do |t|
35-
since = TEST_CHANGES_SINCE
36-
touched = FileList['test/**/*_test.rb'].select { |path| File.mtime(path) > since } +
37-
recent_tests('app/models/*.rb', 'test/unit', since) +
38-
recent_tests('app/controllers/*.rb', 'test/functional', since)
39-
40-
t.libs << 'test'
41-
t.verbose = true
42-
t.test_files = touched.uniq
43-
end
44-
task :test_recent => [ :clone_structure_to_test ]
45-
46-
desc "Run the unit tests in test/unit"
47-
Rake::TestTask.new("test_units") { |t|
48-
t.libs << "test"
49-
t.pattern = 'test/unit/**/*_test.rb'
50-
t.verbose = true
51-
}
52-
task :test_units => [ :clone_structure_to_test ]
53-
54-
desc "Run the functional tests in test/functional"
55-
Rake::TestTask.new("test_functional") { |t|
56-
t.libs << "test"
57-
t.pattern = 'test/functional/**/*_test.rb'
58-
t.verbose = true
59-
}
60-
task :test_functional => [ :clone_structure_to_test ]
61-
62-
desc "Generate documentation for the application"
63-
Rake::RDocTask.new("appdoc") { |rdoc|
64-
rdoc.rdoc_dir = 'doc/app'
65-
rdoc.title = "Rails Application Documentation"
66-
rdoc.options << '--line-numbers --inline-source'
67-
rdoc.rdoc_files.include('doc/README_FOR_APP')
68-
rdoc.rdoc_files.include('app/**/*.rb')
69-
}
70-
71-
desc "Generate documentation for the Rails framework"
72-
Rake::RDocTask.new("apidoc") { |rdoc|
73-
rdoc.rdoc_dir = 'doc/api'
74-
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
75-
rdoc.title = "Rails Framework Documentation"
76-
rdoc.options << '--line-numbers --inline-source'
77-
rdoc.rdoc_files.include('README')
78-
rdoc.rdoc_files.include('CHANGELOG')
79-
rdoc.rdoc_files.include('vendor/rails/railties/CHANGELOG')
80-
rdoc.rdoc_files.include('vendor/rails/railties/MIT-LICENSE')
81-
rdoc.rdoc_files.include('vendor/rails/activerecord/README')
82-
rdoc.rdoc_files.include('vendor/rails/activerecord/CHANGELOG')
83-
rdoc.rdoc_files.include('vendor/rails/activerecord/lib/active_record/**/*.rb')
84-
rdoc.rdoc_files.exclude('vendor/rails/activerecord/lib/active_record/vendor/*')
85-
rdoc.rdoc_files.include('vendor/rails/actionpack/README')
86-
rdoc.rdoc_files.include('vendor/rails/actionpack/CHANGELOG')
87-
rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_controller/**/*.rb')
88-
rdoc.rdoc_files.include('vendor/rails/actionpack/lib/action_view/**/*.rb')
89-
rdoc.rdoc_files.include('vendor/rails/actionmailer/README')
90-
rdoc.rdoc_files.include('vendor/rails/actionmailer/CHANGELOG')
91-
rdoc.rdoc_files.include('vendor/rails/actionmailer/lib/action_mailer/base.rb')
92-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/README')
93-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/CHANGELOG')
94-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service.rb')
95-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/*.rb')
96-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/api/*.rb')
97-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/client/*.rb')
98-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/container/*.rb')
99-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/dispatcher/*.rb')
100-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/protocol/*.rb')
101-
rdoc.rdoc_files.include('vendor/rails/actionwebservice/lib/action_web_service/support/*.rb')
102-
rdoc.rdoc_files.include('vendor/rails/activesupport/README')
103-
rdoc.rdoc_files.include('vendor/rails/activesupport/CHANGELOG')
104-
rdoc.rdoc_files.include('vendor/rails/activesupport/lib/active_support/**/*.rb')
105-
}
106-
107-
desc "Report code statistics (KLOCs, etc) from the application"
108-
task :stats => [ :environment ] do
109-
require 'code_statistics'
110-
CodeStatistics.new(
111-
["Helpers", "app/helpers"],
112-
["Controllers", "app/controllers"],
113-
["APIs", "app/apis"],
114-
["Components", "components"],
115-
["Functionals", "test/functional"],
116-
["Models", "app/models"],
117-
["Units", "test/unit"]
118-
).to_s
119-
end
120-
121-
desc "Recreate the test databases from the development structure"
122-
task :clone_structure_to_test => [ :db_structure_dump, :purge_test_database ] do
123-
abcs = ActiveRecord::Base.configurations
124-
case abcs["test"]["adapter"]
125-
when "mysql"
126-
ActiveRecord::Base.establish_connection(:test)
127-
ActiveRecord::Base.connection.execute('SET foreign_key_checks = 0')
128-
IO.readlines("db/#{RAILS_ENV}_structure.sql").join.split("\n\n").each do |table|
129-
ActiveRecord::Base.connection.execute(table)
130-
end
131-
when "postgresql"
132-
ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"]
133-
ENV['PGPORT'] = abcs["test"]["port"].to_s if abcs["test"]["port"]
134-
ENV['PGPASSWORD'] = abcs["test"]["password"].to_s if abcs["test"]["password"]
135-
`psql -U "#{abcs["test"]["username"]}" -f db/#{RAILS_ENV}_structure.sql #{abcs["test"]["database"]}`
136-
when "sqlite", "sqlite3"
137-
`#{abcs[RAILS_ENV]["adapter"]} #{abcs["test"]["dbfile"]} < db/#{RAILS_ENV}_structure.sql`
138-
when "sqlserver"
139-
`osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{RAILS_ENV}_structure.sql`
140-
else
141-
raise "Unknown database adapter '#{abcs["test"]["adapter"]}'"
142-
end
143-
end
144-
145-
desc "Dump the database structure to a SQL file"
146-
task :db_structure_dump => :environment do
147-
abcs = ActiveRecord::Base.configurations
148-
case abcs[RAILS_ENV]["adapter"]
149-
when "mysql"
150-
ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
151-
File.open("db/#{RAILS_ENV}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
152-
when "postgresql"
153-
ENV['PGHOST'] = abcs[RAILS_ENV]["host"] if abcs[RAILS_ENV]["host"]
154-
ENV['PGPORT'] = abcs[RAILS_ENV]["port"].to_s if abcs[RAILS_ENV]["port"]
155-
ENV['PGPASSWORD'] = abcs[RAILS_ENV]["password"].to_s if abcs[RAILS_ENV]["password"]
156-
`pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -O -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}`
157-
when "sqlite", "sqlite3"
158-
`#{abcs[RAILS_ENV]["adapter"]} #{abcs[RAILS_ENV]["dbfile"]} .schema > db/#{RAILS_ENV}_structure.sql`
159-
when "sqlserver"
160-
`scptxfr /s #{abcs[RAILS_ENV]["host"]} /d #{abcs[RAILS_ENV]["database"]} /I /f db\\#{RAILS_ENV}_structure.sql /q /A /r`
161-
`scptxfr /s #{abcs[RAILS_ENV]["host"]} /d #{abcs[RAILS_ENV]["database"]} /I /F db\ /q /A /r`
162-
else
163-
raise "Unknown database adapter '#{abcs["test"]["adapter"]}'"
164-
end
165-
end
166-
167-
desc "Empty the test database"
168-
task :purge_test_database => :environment do
169-
abcs = ActiveRecord::Base.configurations
170-
case abcs["test"]["adapter"]
171-
when "mysql"
172-
ActiveRecord::Base.establish_connection(:test)
173-
ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"])
174-
when "postgresql"
175-
ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"]
176-
ENV['PGPORT'] = abcs["test"]["port"].to_s if abcs["test"]["port"]
177-
ENV['PGPASSWORD'] = abcs["test"]["password"].to_s if abcs["test"]["password"]
178-
`dropdb -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
179-
`createdb -T template0 -U "#{abcs["test"]["username"]}" #{abcs["test"]["database"]}`
180-
when "sqlite","sqlite3"
181-
File.delete(abcs["test"]["dbfile"]) if File.exist?(abcs["test"]["dbfile"])
182-
when "sqlserver"
183-
dropfkscript = "#{abcs["test"]["host"]}.#{abcs["test"]["database"]}.DP1".gsub(/\\/,'-')
184-
`osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{dropfkscript}`
185-
`osql -E -S #{abcs["test"]["host"]} -d #{abcs["test"]["database"]} -i db\\#{RAILS_ENV}_structure.sql`
186-
else
187-
raise "Unknown database adapter '#{abcs["test"]["adapter"]}'"
188-
end
189-
end
190-
191-
desc "Clears all *.log files in log/"
192-
task :clear_logs => :environment do
193-
FileList["log/*.log"].each do |log_file|
194-
f = File.open(log_file, "w")
195-
f.close
196-
end
197-
end
198-
199-
desc "Migrate the database according to the migrate scripts in db/migrate (only supported on PG/MySQL). A specific version can be targetted with VERSION=x"
200-
task :migrate => :environment do
201-
ActiveRecord::Migrator.migrate(File.dirname(__FILE__) + '/db/migrate/', ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
202-
end
203-
204-
desc "Show what tests will do"
205-
task :agiledox do
206-
tests = FileList['test/**/*_test.rb']
207-
tests.each do |file|
208-
m = %r".*/([^/].*)_test.rb".match(file)
209-
puts m[1]+" should:\n"
210-
test_definitions = File::readlines(file).select {|line| line =~ /.*def test.*/}
211-
test_definitions.each do |definition|
212-
m = %r"test_(should_)?(.*)".match(definition)
213-
puts " - "+m[2].gsub(/_/," ")
214-
end
215-
puts "\n"
216-
end
217-
end
10+
require 'tasks/rails'

app/helpers/application_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# The methods added to this helper will be available to all templates in the application.
1+
# Methods added to this helper will be available to all templates in the application.
22
module ApplicationHelper
33
end

config/boot.rb

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
unless defined?(RAILS_ROOT)
2+
root_path = File.join(File.dirname(__FILE__), '..')
3+
unless RUBY_PLATFORM =~ /mswin32/
4+
require 'pathname'
5+
root_path = Pathname.new(root_path).cleanpath.to_s
6+
end
7+
RAILS_ROOT = root_path
8+
end
9+
10+
if File.directory?("#{RAILS_ROOT}/vendor/rails")
11+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
12+
else
13+
require 'rubygems'
14+
require 'initializer'
15+
end
16+
17+
Rails::Initializer.run(:set_load_path)

0 commit comments

Comments
 (0)