rails 0.11.1 → 0.12.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 +26 -0
- data/README +2 -2
- data/Rakefile +11 -11
- data/bin/benchmarker +19 -0
- data/bin/{console_sandbox.rb → console_sandbox} +0 -0
- data/bin/profiler +17 -0
- data/configs/apache.conf +7 -0
- data/fresh_rakefile +10 -2
- data/html/javascripts/prototype.js +340 -30
- data/lib/rails_generator/generators/applications/app/app_generator.rb +1 -1
- data/lib/rails_generator/generators/components/scaffold/templates/controller.rb +1 -1
- data/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +3 -0
- data/lib/rails_generator/lookup.rb +9 -3
- data/lib/rails_generator/options.rb +1 -1
- data/lib/webrick_server.rb +2 -4
- metadata +11 -9
data/CHANGELOG
CHANGED
@@ -1,3 +1,29 @@
|
|
1
|
+
*0.12.0* (19th April, 2005)
|
2
|
+
|
3
|
+
* Fixed that purge_test_database would use database settings from the development environment when recreating the test database #1122 [rails@cogentdude.com]
|
4
|
+
|
5
|
+
* Added script/benchmarker to easily benchmark one or more statement a number of times from within the environment. Examples:
|
6
|
+
|
7
|
+
# runs the one statement 10 times
|
8
|
+
script/benchmarker 10 'Person.expensive_method(10)'
|
9
|
+
|
10
|
+
# pits the two statements against each other with 50 runs each
|
11
|
+
script/benchmarker 50 'Person.expensive_method(10)' 'Person.cheap_method(10)'
|
12
|
+
|
13
|
+
* Added script/profiler to easily profile a single statement from within the environment. Examples:
|
14
|
+
|
15
|
+
script/profiler 'Person.expensive_method(10)'
|
16
|
+
script/profiler 'Person.expensive_method(10)' 10 # runs the statement 10 times
|
17
|
+
|
18
|
+
* Added Rake target clear_logs that'll truncate all the *.log files in log/ to zero #1079 [Lucas Carlson]
|
19
|
+
|
20
|
+
* Added lazy typing for generate, such that ./script/generate cn == ./script/generate controller and the likes #1051 [k@v2studio.com]
|
21
|
+
|
22
|
+
* Fixed that ownership is brought over in pg_dump during tests for PostgreSQL #1060 [pburleson@gmail.com]
|
23
|
+
|
24
|
+
* Upgraded to Active Record 1.10.0, Action Pack 1.8.0, Action Mailer 0.9.0, Action Web Service 0.7.0, Active Support 1.0.4
|
25
|
+
|
26
|
+
|
1
27
|
*0.11.1* (27th March, 2005)
|
2
28
|
|
3
29
|
* Fixed the dispatch.fcgi use of a logger
|
data/README
CHANGED
@@ -14,7 +14,7 @@ In Rails, the model is handled by what's called a object-relational mapping
|
|
14
14
|
layer entitled Active Record. This layer allows you to present the data from
|
15
15
|
database rows as objects and embellish these data objects with business logic
|
16
16
|
methods. You can read more about Active Record in
|
17
|
-
link:files/vendor/activerecord/README.html.
|
17
|
+
link:files/vendor/rails/activerecord/README.html.
|
18
18
|
|
19
19
|
The controller and view is handled by the Action Pack, which handles both
|
20
20
|
layers by its two parts: Action View and Action Controller. These two layers
|
@@ -22,7 +22,7 @@ are bundled in a single package due to their heavy interdependence. This is
|
|
22
22
|
unlike the relationship between the Active Record and Action Pack that is much
|
23
23
|
more separate. Each of these packages can be used independently outside of
|
24
24
|
Rails. You can read more about Action Pack in
|
25
|
-
link:files/vendor/actionpack/README.html.
|
25
|
+
link:files/vendor/rails/actionpack/README.html.
|
26
26
|
|
27
27
|
|
28
28
|
== Requirements
|
data/Rakefile
CHANGED
@@ -9,7 +9,7 @@ require 'rbconfig'
|
|
9
9
|
|
10
10
|
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
11
11
|
PKG_NAME = 'rails'
|
12
|
-
PKG_VERSION = '0.
|
12
|
+
PKG_VERSION = '0.12.0' + PKG_BUILD
|
13
13
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
14
14
|
PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"
|
15
15
|
|
@@ -26,7 +26,7 @@ TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
|
|
26
26
|
|
27
27
|
LOG_FILES = %w( server.log development.log test.log production.log )
|
28
28
|
HTML_FILES = %w( 404.html 500.html index.html favicon.ico javascripts/prototype.js )
|
29
|
-
BIN_FILES = %w( generate destroy breakpointer console server update runner )
|
29
|
+
BIN_FILES = %w( generate destroy breakpointer console console_sandbox server update runner profiler benchmarker )
|
30
30
|
|
31
31
|
VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )
|
32
32
|
|
@@ -238,12 +238,12 @@ spec = Gem::Specification.new do |s|
|
|
238
238
|
on top of either MySQL, PostgreSQL, or SQLite with eRuby-based templates.
|
239
239
|
EOF
|
240
240
|
|
241
|
-
s.add_dependency('rake', '>= 0.5.
|
242
|
-
s.add_dependency('activesupport', '= 1.0.
|
243
|
-
s.add_dependency('activerecord', '= 1.
|
244
|
-
s.add_dependency('actionpack', '= 1.
|
245
|
-
s.add_dependency('actionmailer', '= 0.
|
246
|
-
s.add_dependency('actionwebservice', '= 0.
|
241
|
+
s.add_dependency('rake', '>= 0.5.3')
|
242
|
+
s.add_dependency('activesupport', '= 1.0.4' + PKG_BUILD)
|
243
|
+
s.add_dependency('activerecord', '= 1.10.0' + PKG_BUILD)
|
244
|
+
s.add_dependency('actionpack', '= 1.8.0' + PKG_BUILD)
|
245
|
+
s.add_dependency('actionmailer', '= 0.9.0' + PKG_BUILD)
|
246
|
+
s.add_dependency('actionwebservice', '= 0.7.0' + PKG_BUILD)
|
247
247
|
|
248
248
|
s.rdoc_options << '--exclude' << '.'
|
249
249
|
s.has_rdoc = false
|
@@ -268,12 +268,12 @@ end
|
|
268
268
|
# Publishing -------------------------------------------------------
|
269
269
|
desc "Publish the API documentation"
|
270
270
|
task :pgem => [:gem] do
|
271
|
-
Rake::SshFilePublisher.new("davidhh@
|
272
|
-
`ssh davidhh@
|
271
|
+
Rake::SshFilePublisher.new("davidhh@wrath.rubyonrails.com", "public_html/gems/gems", "pkg", "#{PKG_FILE_NAME}.gem").upload
|
272
|
+
`ssh davidhh@wrath.rubyonrails.com './gemupdate.sh'`
|
273
273
|
end
|
274
274
|
|
275
275
|
desc "Publish the release files to RubyForge."
|
276
|
-
task :release => [:
|
276
|
+
task :release => [:gem] do
|
277
277
|
files = ["gem"].map { |ext| "pkg/#{PKG_FILE_NAME}.#{ext}" }
|
278
278
|
|
279
279
|
if RUBY_FORGE_PROJECT then
|
data/bin/benchmarker
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/local/bin/ruby
|
2
|
+
|
3
|
+
if ARGV.empty?
|
4
|
+
puts "Usage: benchmarker times 'Person.expensive_way' 'Person.another_expensive_way' ..."
|
5
|
+
exit
|
6
|
+
end
|
7
|
+
|
8
|
+
require File.dirname(__FILE__) + '/../config/environment'
|
9
|
+
require 'benchmark'
|
10
|
+
include Benchmark
|
11
|
+
|
12
|
+
# Don't include compilation in the benchmark
|
13
|
+
ARGV[1..-1].each { |expression| eval(expression) }
|
14
|
+
|
15
|
+
bm(6) do |x|
|
16
|
+
ARGV[1..-1].each_with_index do |expression, idx|
|
17
|
+
x.report("##{idx + 1}") { ARGV[0].to_i.times { eval(expression) } }
|
18
|
+
end
|
19
|
+
end
|
File without changes
|
data/bin/profiler
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/local/bin/ruby
|
2
|
+
|
3
|
+
if ARGV.empty?
|
4
|
+
puts "Usage: profiler 'Person.expensive_method(10)' [times]"
|
5
|
+
exit
|
6
|
+
end
|
7
|
+
|
8
|
+
require File.dirname(__FILE__) + '/../config/environment'
|
9
|
+
require "profiler"
|
10
|
+
|
11
|
+
# Don't include compilation in the profile
|
12
|
+
eval(ARGV.first)
|
13
|
+
|
14
|
+
Profiler__::start_profile
|
15
|
+
(ARGV[1] || 1).to_i.times { eval(ARGV.first) }
|
16
|
+
Profiler__::stop_profile
|
17
|
+
Profiler__::print_profile($stdout)
|
data/configs/apache.conf
CHANGED
@@ -3,6 +3,13 @@ AddHandler fastcgi-script .fcgi
|
|
3
3
|
AddHandler cgi-script .cgi
|
4
4
|
Options +FollowSymLinks +ExecCGI
|
5
5
|
|
6
|
+
# If you don't want Rails to look in certain directories,
|
7
|
+
# use the following rewrite rules so that Apache won't rewrite certain requests
|
8
|
+
#
|
9
|
+
# Example:
|
10
|
+
# RewriteCond %{REQUEST_URI} ^/notrails.*
|
11
|
+
# RewriteRule .* - [L]
|
12
|
+
|
6
13
|
# Redirect all requests not available on the filesystem to Rails
|
7
14
|
# By default the cgi dispatcher is used which is very slow
|
8
15
|
#
|
data/fresh_rakefile
CHANGED
@@ -151,7 +151,7 @@ task :db_structure_dump => :environment do
|
|
151
151
|
ENV['PGHOST'] = abcs[RAILS_ENV]["host"] if abcs[RAILS_ENV]["host"]
|
152
152
|
ENV['PGPORT'] = abcs[RAILS_ENV]["port"].to_s if abcs[RAILS_ENV]["port"]
|
153
153
|
ENV['PGPASSWORD'] = abcs[RAILS_ENV]["password"]
|
154
|
-
`pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}`
|
154
|
+
`pg_dump -U "#{abcs[RAILS_ENV]["username"]}" -s -x -O -f db/#{RAILS_ENV}_structure.sql #{abcs[RAILS_ENV]["database"]}`
|
155
155
|
when "sqlite", "sqlite3"
|
156
156
|
`#{abcs[RAILS_ENV]["adapter"]} #{abcs[RAILS_ENV]["dbfile"]} .schema > db/#{RAILS_ENV}_structure.sql`
|
157
157
|
else
|
@@ -164,7 +164,7 @@ task :purge_test_database => :environment do
|
|
164
164
|
abcs = ActiveRecord::Base.configurations
|
165
165
|
case abcs["test"]["adapter"]
|
166
166
|
when "mysql"
|
167
|
-
ActiveRecord::Base.establish_connection(
|
167
|
+
ActiveRecord::Base.establish_connection(:test)
|
168
168
|
ActiveRecord::Base.connection.recreate_database(abcs["test"]["database"])
|
169
169
|
when "postgresql"
|
170
170
|
ENV['PGHOST'] = abcs["test"]["host"] if abcs["test"]["host"]
|
@@ -178,3 +178,11 @@ task :purge_test_database => :environment do
|
|
178
178
|
raise "Unknown database adapter '#{abcs["test"]["adapter"]}'"
|
179
179
|
end
|
180
180
|
end
|
181
|
+
|
182
|
+
desc "Clears all *.log files in log/"
|
183
|
+
task :clear_logs => :environment do
|
184
|
+
FileList["log/*.log"].each do |log_file|
|
185
|
+
f = File.open(log_file, "w")
|
186
|
+
f.close
|
187
|
+
end
|
188
|
+
end
|
@@ -1,12 +1,17 @@
|
|
1
|
-
/* Prototype: an object-oriented Javascript library, version 1.0
|
1
|
+
/* Prototype: an object-oriented Javascript library, version 1.2.0
|
2
2
|
* (c) 2005 Sam Stephenson <sam@conio.net>
|
3
3
|
*
|
4
|
-
*
|
5
|
-
*
|
6
|
-
|
4
|
+
* THIS FILE IS AUTOMATICALLY GENERATED. When sending patches, please diff
|
5
|
+
* against the source tree, available from the Prototype darcs repository.
|
6
|
+
*
|
7
|
+
* Prototype is freely distributable under the terms of an MIT-style license.
|
8
|
+
*
|
9
|
+
* For details, see the Prototype web site: http://prototype.conio.net/
|
10
|
+
*
|
11
|
+
/*--------------------------------------------------------------------------*/
|
7
12
|
|
8
13
|
var Prototype = {
|
9
|
-
Version: '1.
|
14
|
+
Version: '1.2.0'
|
10
15
|
}
|
11
16
|
|
12
17
|
var Class = {
|
@@ -62,13 +67,33 @@ var Try = {
|
|
62
67
|
}
|
63
68
|
}
|
64
69
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
70
|
+
/*--------------------------------------------------------------------------*/
|
71
|
+
|
72
|
+
var PeriodicalExecuter = Class.create();
|
73
|
+
PeriodicalExecuter.prototype = {
|
74
|
+
initialize: function(callback, frequency) {
|
75
|
+
this.callback = callback;
|
76
|
+
this.frequency = frequency;
|
77
|
+
this.currentlyExecuting = false;
|
78
|
+
|
79
|
+
this.registerCallback();
|
80
|
+
},
|
81
|
+
|
82
|
+
registerCallback: function() {
|
83
|
+
setTimeout(this.onTimerEvent.bind(this), this.frequency * 1000);
|
84
|
+
},
|
85
|
+
|
86
|
+
onTimerEvent: function() {
|
87
|
+
if (!this.currentlyExecuting) {
|
88
|
+
try {
|
89
|
+
this.currentlyExecuting = true;
|
90
|
+
this.callback();
|
91
|
+
} finally {
|
92
|
+
this.currentlyExecuting = false;
|
93
|
+
}
|
71
94
|
}
|
95
|
+
|
96
|
+
this.registerCallback();
|
72
97
|
}
|
73
98
|
}
|
74
99
|
|
@@ -91,22 +116,34 @@ function $() {
|
|
91
116
|
return elements;
|
92
117
|
}
|
93
118
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
119
|
+
/*--------------------------------------------------------------------------*/
|
120
|
+
|
121
|
+
if (!Array.prototype.push) {
|
122
|
+
Array.prototype.push = function() {
|
123
|
+
var startLength = this.length;
|
124
|
+
for (var i = 0; i < arguments.length; i++)
|
125
|
+
this[startLength + i] = arguments[i];
|
126
|
+
return this.length;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
if (!Function.prototype.apply) {
|
131
|
+
// Based on code from http://www.youngpup.net/
|
132
|
+
Function.prototype.apply = function(object, parameters) {
|
133
|
+
var parameterStrings = new Array();
|
134
|
+
if (!object) object = window;
|
135
|
+
if (!parameters) parameters = new Array();
|
136
|
+
|
137
|
+
for (var i = 0; i < parameters.length; i++)
|
138
|
+
parameterStrings[i] = 'x[' + i + ']';
|
139
|
+
|
140
|
+
object.__apply__ = this;
|
141
|
+
var result = eval('obj.__apply__(' +
|
142
|
+
parameterStrings[i].join(', ') + ')');
|
143
|
+
object.__apply__ = null;
|
144
|
+
|
145
|
+
return result;
|
107
146
|
}
|
108
|
-
|
109
|
-
return elements;
|
110
147
|
}
|
111
148
|
|
112
149
|
/*--------------------------------------------------------------------------*/
|
@@ -154,6 +191,9 @@ Ajax.Request.prototype = (new Ajax.Base()).extend({
|
|
154
191
|
setTimeout((function() {this.respondToReadyState(1)}).bind(this), 10);
|
155
192
|
}
|
156
193
|
|
194
|
+
this.transport.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
|
195
|
+
this.transport.setRequestHeader('X-Prototype-Version', Prototype.Version);
|
196
|
+
|
157
197
|
if (this.options.method == 'post') {
|
158
198
|
this.transport.setRequestHeader('Connection', 'close');
|
159
199
|
this.transport.setRequestHeader('Content-type',
|
@@ -197,11 +237,11 @@ Ajax.Updater.prototype = (new Ajax.Base()).extend({
|
|
197
237
|
},
|
198
238
|
|
199
239
|
updateContent: function() {
|
200
|
-
if (
|
201
|
-
this.container.innerHTML = this.request.transport.responseText;
|
202
|
-
} else {
|
240
|
+
if (this.options.insertion) {
|
203
241
|
new this.options.insertion(this.container,
|
204
242
|
this.request.transport.responseText);
|
243
|
+
} else {
|
244
|
+
this.container.innerHTML = this.request.transport.responseText;
|
205
245
|
}
|
206
246
|
|
207
247
|
if (this.onComplete) {
|
@@ -226,6 +266,15 @@ var Field = {
|
|
226
266
|
for (var i = 0; i < arguments.length; i++)
|
227
267
|
if ($(arguments[i]).value == '') return false;
|
228
268
|
return true;
|
269
|
+
},
|
270
|
+
|
271
|
+
select: function(element) {
|
272
|
+
$(element).select();
|
273
|
+
},
|
274
|
+
|
275
|
+
activate: function(element) {
|
276
|
+
$(element).focus();
|
277
|
+
$(element).select();
|
229
278
|
}
|
230
279
|
}
|
231
280
|
|
@@ -255,6 +304,31 @@ var Form = {
|
|
255
304
|
elements.push(tagElements[j]);
|
256
305
|
}
|
257
306
|
return elements;
|
307
|
+
},
|
308
|
+
|
309
|
+
disable: function(form) {
|
310
|
+
var elements = Form.getElements(form);
|
311
|
+
for (var i = 0; i < elements.length; i++) {
|
312
|
+
var element = elements[i];
|
313
|
+
element.blur();
|
314
|
+
element.disable = 'true';
|
315
|
+
}
|
316
|
+
},
|
317
|
+
|
318
|
+
focusFirstElement: function(form) {
|
319
|
+
form = $(form);
|
320
|
+
var elements = Form.getElements(form);
|
321
|
+
for (var i = 0; i < elements.length; i++) {
|
322
|
+
var element = elements[i];
|
323
|
+
if (element.type != 'hidden' && !element.disabled) {
|
324
|
+
Field.activate(element);
|
325
|
+
break;
|
326
|
+
}
|
327
|
+
}
|
328
|
+
},
|
329
|
+
|
330
|
+
reset: function(form) {
|
331
|
+
$(form).reset();
|
258
332
|
}
|
259
333
|
}
|
260
334
|
|
@@ -304,12 +378,17 @@ Form.Element.Serializers = {
|
|
304
378
|
|
305
379
|
select: function(element) {
|
306
380
|
var index = element.selectedIndex;
|
307
|
-
|
381
|
+
var value = element.options[index].value || element.options[index].text;
|
382
|
+
return [element.name, (index >= 0) ? value : ''];
|
308
383
|
}
|
309
384
|
}
|
310
385
|
|
311
386
|
/*--------------------------------------------------------------------------*/
|
312
387
|
|
388
|
+
var $F = Form.Element.getValue;
|
389
|
+
|
390
|
+
/*--------------------------------------------------------------------------*/
|
391
|
+
|
313
392
|
Abstract.TimedObserver = function() {}
|
314
393
|
Abstract.TimedObserver.prototype = {
|
315
394
|
initialize: function(element, frequency, callback) {
|
@@ -351,6 +430,65 @@ Form.Observer.prototype = (new Abstract.TimedObserver()).extend({
|
|
351
430
|
});
|
352
431
|
|
353
432
|
|
433
|
+
/*--------------------------------------------------------------------------*/
|
434
|
+
|
435
|
+
document.getElementsByClassName = function(className) {
|
436
|
+
var children = document.getElementsByTagName('*') || document.all;
|
437
|
+
var elements = new Array();
|
438
|
+
|
439
|
+
for (var i = 0; i < children.length; i++) {
|
440
|
+
var child = children[i];
|
441
|
+
var classNames = child.className.split(' ');
|
442
|
+
for (var j = 0; j < classNames.length; j++) {
|
443
|
+
if (classNames[j] == className) {
|
444
|
+
elements.push(child);
|
445
|
+
break;
|
446
|
+
}
|
447
|
+
}
|
448
|
+
}
|
449
|
+
|
450
|
+
return elements;
|
451
|
+
}
|
452
|
+
|
453
|
+
/*--------------------------------------------------------------------------*/
|
454
|
+
|
455
|
+
var Element = {
|
456
|
+
toggle: function() {
|
457
|
+
for (var i = 0; i < arguments.length; i++) {
|
458
|
+
var element = $(arguments[i]);
|
459
|
+
element.style.display =
|
460
|
+
(element.style.display == 'none' ? '' : 'none');
|
461
|
+
}
|
462
|
+
},
|
463
|
+
|
464
|
+
hide: function() {
|
465
|
+
for (var i = 0; i < arguments.length; i++) {
|
466
|
+
var element = $(arguments[i]);
|
467
|
+
element.style.display = 'none';
|
468
|
+
}
|
469
|
+
},
|
470
|
+
|
471
|
+
show: function() {
|
472
|
+
for (var i = 0; i < arguments.length; i++) {
|
473
|
+
var element = $(arguments[i]);
|
474
|
+
element.style.display = '';
|
475
|
+
}
|
476
|
+
},
|
477
|
+
|
478
|
+
remove: function(element) {
|
479
|
+
element = $(element);
|
480
|
+
element.parentNode.removeChild(element);
|
481
|
+
},
|
482
|
+
|
483
|
+
getHeight: function(element) {
|
484
|
+
element = $(element);
|
485
|
+
return element.offsetHeight;
|
486
|
+
}
|
487
|
+
}
|
488
|
+
|
489
|
+
var Toggle = new Object();
|
490
|
+
Toggle.display = Element.toggle;
|
491
|
+
|
354
492
|
/*--------------------------------------------------------------------------*/
|
355
493
|
|
356
494
|
Abstract.Insertion = function(adjacency) {
|
@@ -452,3 +590,175 @@ Effect.Highlight.prototype = {
|
|
452
590
|
element.style.backgroundColor = "#ffff" + current.toColorPart();
|
453
591
|
}
|
454
592
|
}
|
593
|
+
|
594
|
+
|
595
|
+
Effect.Fade = Class.create();
|
596
|
+
Effect.Fade.prototype = {
|
597
|
+
initialize: function(element) {
|
598
|
+
this.element = $(element);
|
599
|
+
this.start = 100;
|
600
|
+
this.finish = 0;
|
601
|
+
this.current = this.start;
|
602
|
+
this.fade();
|
603
|
+
},
|
604
|
+
|
605
|
+
fade: function() {
|
606
|
+
if (this.isFinished()) { this.element.style.display = 'none'; return; }
|
607
|
+
if (this.timer) clearTimeout(this.timer);
|
608
|
+
this.setOpacity(this.element, this.current);
|
609
|
+
this.current -= 10;
|
610
|
+
this.timer = setTimeout(this.fade.bind(this), 50);
|
611
|
+
},
|
612
|
+
|
613
|
+
isFinished: function() {
|
614
|
+
return this.current <= this.finish;
|
615
|
+
},
|
616
|
+
|
617
|
+
setOpacity: function(element, opacity) {
|
618
|
+
opacity = (opacity == 100) ? 99.999 : opacity;
|
619
|
+
element.style.filter = "alpha(opacity:"+opacity+")";
|
620
|
+
element.style.opacity = opacity/100 /*//*/;
|
621
|
+
}
|
622
|
+
}
|
623
|
+
|
624
|
+
Effect.Scale = Class.create();
|
625
|
+
Effect.Scale.prototype = {
|
626
|
+
initialize: function(element, percent) {
|
627
|
+
this.element = $(element);
|
628
|
+
this.startScale = 1.0;
|
629
|
+
this.startHeight = this.element.offsetHeight;
|
630
|
+
this.startWidth = this.element.offsetWidth;
|
631
|
+
this.currentHeight = this.startHeight;
|
632
|
+
this.currentWidth = this.startWidth;
|
633
|
+
this.finishScale = (percent/100) /*//*/;
|
634
|
+
if (this.element.style.fontSize=="") this.sizeEm = 1.0;
|
635
|
+
if (this.element.style.fontSize.indexOf("em")>0)
|
636
|
+
this.sizeEm = parseFloat(this.element.style.fontSize);
|
637
|
+
if(this.element.effect_scale) {
|
638
|
+
clearTimeout(this.element.effect_scale.timer);
|
639
|
+
this.startScale = this.element.effect_scale.currentScale;
|
640
|
+
this.startHeight = this.element.effect_scale.startHeight;
|
641
|
+
this.startWidth = this.element.effect_scale.startWidth;
|
642
|
+
if(this.element.effect_scale.sizeEm)
|
643
|
+
this.sizeEm = this.element.effect_scale.sizeEm;
|
644
|
+
}
|
645
|
+
this.element.effect_scale = this;
|
646
|
+
this.currentScale = this.startScale;
|
647
|
+
this.factor = this.finishScale - this.startScale;
|
648
|
+
this.options = arguments[2] || {};
|
649
|
+
this.scale();
|
650
|
+
},
|
651
|
+
|
652
|
+
scale: function() {
|
653
|
+
if (this.isFinished()) {
|
654
|
+
this.setDimensions(this.element, this.startWidth*this.finishScale, this.startHeight*this.finishScale);
|
655
|
+
if(this.sizeEm) this.element.style.fontSize = this.sizeEm*this.finishScale + "em";
|
656
|
+
if(this.options.complete) this.options.complete(this);
|
657
|
+
return;
|
658
|
+
}
|
659
|
+
if (this.timer) clearTimeout(this.timer);
|
660
|
+
if (this.options.step) this.options.step(this);
|
661
|
+
this.setDimensions(this.element, this.currentWidth, this.currentHeight);
|
662
|
+
if(this.sizeEm) this.element.style.fontSize = this.sizeEm*this.currentScale + "em";
|
663
|
+
this.currentScale += (this.factor/10) /*//*/;
|
664
|
+
this.currentWidth = this.startWidth * this.currentScale;
|
665
|
+
this.currentHeight = this.startHeight * this.currentScale;
|
666
|
+
this.timer = setTimeout(this.scale.bind(this), 50);
|
667
|
+
},
|
668
|
+
|
669
|
+
isFinished: function() {
|
670
|
+
return (this.factor < 0) ?
|
671
|
+
this.currentScale <= this.finishScale : this.currentScale >= this.finishScale;
|
672
|
+
},
|
673
|
+
|
674
|
+
setDimensions: function(element, width, height) {
|
675
|
+
element.style.width = width + 'px';
|
676
|
+
element.style.height = height + 'px';
|
677
|
+
}
|
678
|
+
}
|
679
|
+
|
680
|
+
Effect.Squish = Class.create();
|
681
|
+
Effect.Squish.prototype = {
|
682
|
+
initialize: function(element) {
|
683
|
+
this.element = $(element);
|
684
|
+
new Effect.Scale(this.element, 1, { complete: this.hide.bind(this) } );
|
685
|
+
},
|
686
|
+
hide: function() {
|
687
|
+
this.element.style.display = 'none';
|
688
|
+
}
|
689
|
+
}
|
690
|
+
|
691
|
+
Effect.Puff = Class.create();
|
692
|
+
Effect.Puff.prototype = {
|
693
|
+
initialize: function(element) {
|
694
|
+
this.element = $(element);
|
695
|
+
this.opacity = 100;
|
696
|
+
this.startTop = this.element.top || this.element.offsetTop;
|
697
|
+
this.startLeft = this.element.left || this.element.offsetLeft;
|
698
|
+
new Effect.Scale(this.element, 200, { step: this.fade.bind(this), complete: this.hide.bind(this) } );
|
699
|
+
},
|
700
|
+
fade: function(effect) {
|
701
|
+
topd = (((effect.currentScale)*effect.startHeight) - effect.startHeight)/2;
|
702
|
+
leftd = (((effect.currentScale)*effect.startWidth) - effect.startWidth)/2;
|
703
|
+
this.element.style.position='absolute';
|
704
|
+
this.element.style.top = this.startTop-topd + "px";
|
705
|
+
this.element.style.left = this.startLeft-leftd + "px";
|
706
|
+
this.opacity -= 10;
|
707
|
+
this.setOpacity(this.element, this.opacity);
|
708
|
+
if(navigator.appVersion.indexOf('AppleWebKit')>0) this.element.innerHTML += ''; //force redraw on safari
|
709
|
+
},
|
710
|
+
hide: function() {
|
711
|
+
this.element.style.display = 'none';
|
712
|
+
},
|
713
|
+
setOpacity: function(element, opacity) {
|
714
|
+
opacity = (opacity == 100) ? 99.999 : opacity;
|
715
|
+
element.style.filter = "alpha(opacity:"+opacity+")";
|
716
|
+
element.style.opacity = opacity/100 /*//*/;
|
717
|
+
}
|
718
|
+
}
|
719
|
+
|
720
|
+
Effect.Appear = Class.create();
|
721
|
+
Effect.Appear.prototype = {
|
722
|
+
initialize: function(element) {
|
723
|
+
this.element = $(element);
|
724
|
+
this.start = 0;
|
725
|
+
this.finish = 100;
|
726
|
+
this.current = this.start;
|
727
|
+
this.fade();
|
728
|
+
},
|
729
|
+
|
730
|
+
fade: function() {
|
731
|
+
if (this.isFinished()) return;
|
732
|
+
if (this.timer) clearTimeout(this.timer);
|
733
|
+
this.setOpacity(this.element, this.current);
|
734
|
+
this.current += 10;
|
735
|
+
this.timer = setTimeout(this.fade.bind(this), 50);
|
736
|
+
},
|
737
|
+
|
738
|
+
isFinished: function() {
|
739
|
+
return this.current > this.finish;
|
740
|
+
},
|
741
|
+
|
742
|
+
setOpacity: function(element, opacity) {
|
743
|
+
opacity = (opacity == 100) ? 99.999 : opacity;
|
744
|
+
element.style.filter = "alpha(opacity:"+opacity+")";
|
745
|
+
element.style.opacity = opacity/100 /*//*/;
|
746
|
+
element.style.display = '';
|
747
|
+
}
|
748
|
+
}
|
749
|
+
|
750
|
+
Effect.ContentZoom = Class.create();
|
751
|
+
Effect.ContentZoom.prototype = {
|
752
|
+
initialize: function(element, percent) {
|
753
|
+
this.element = $(element);
|
754
|
+
if (this.element.style.fontSize=="") this.sizeEm = 1.0;
|
755
|
+
if (this.element.style.fontSize.indexOf("em")>0)
|
756
|
+
this.sizeEm = parseFloat(this.element.style.fontSize);
|
757
|
+
if(this.element.effect_contentzoom) {
|
758
|
+
this.sizeEm = this.element.effect_contentzoom.sizeEm;
|
759
|
+
}
|
760
|
+
this.element.effect_contentzoom = this;
|
761
|
+
this.element.style.fontSize = this.sizeEm*(percent/100) + "em" /*//*/;
|
762
|
+
if(navigator.appVersion.indexOf('AppleWebKit')>0) { this.element.scrollTop -= 1; };
|
763
|
+
}
|
764
|
+
}
|
@@ -43,7 +43,7 @@ class AppGenerator < Rails::Generator::Base
|
|
43
43
|
m.file "environments/test.rb", "config/environments/test.rb"
|
44
44
|
|
45
45
|
# Scripts
|
46
|
-
%w(console console_sandbox
|
46
|
+
%w(console console_sandbox destroy generate server runner benchmarker profiler).each do |file|
|
47
47
|
m.file "bin/#{file}", "script/#{file}", script_options
|
48
48
|
end
|
49
49
|
if options[:gem]
|
@@ -12,7 +12,7 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
12
12
|
|
13
13
|
<% end -%>
|
14
14
|
def list<%= suffix %>
|
15
|
-
@<%= plural_name %> =
|
15
|
+
@<%= singular_name %>_pages, @<%= plural_name %> = paginate :<%= singular_name %>, :per_page => 10
|
16
16
|
end
|
17
17
|
|
18
18
|
def show<%= suffix %>
|
@@ -19,6 +19,9 @@
|
|
19
19
|
<%% end %>
|
20
20
|
</table>
|
21
21
|
|
22
|
+
<%%= link_to "Previous page", { :page => @<%= singular_name %>_pages.current.previous } if @<%= singular_name %>_pages.current.previous %>
|
23
|
+
<%%= link_to "Next page", { :page => @<%= singular_name %>_pages.current.next } if @<%= singular_name %>_pages.current.next %>
|
24
|
+
|
22
25
|
<br />
|
23
26
|
|
24
27
|
<%%= link_to 'New <%= singular_name %>', :action => 'new<%= suffix %>' %>
|
@@ -109,9 +109,15 @@ module Rails
|
|
109
109
|
def lookup(generator_name)
|
110
110
|
@found ||= {}
|
111
111
|
generator_name = generator_name.to_s.downcase
|
112
|
-
@found[generator_name] ||= cache.find { |spec|
|
113
|
-
|
114
|
-
|
112
|
+
@found[generator_name] ||= cache.find { |spec| spec.name == generator_name }
|
113
|
+
unless @found[generator_name]
|
114
|
+
chars = generator_name.scan(/./).map{|c|"#{c}.*?"}
|
115
|
+
rx = /^#{chars}$/
|
116
|
+
gns = cache.select{|spec| spec.name =~ rx }
|
117
|
+
@found[generator_name] ||= gns.first if gns.length == 1
|
118
|
+
raise GeneratorError, "Pattern '#{generator_name}' matches more than one generator: #{gns.map{|sp|sp.name}.join(', ')}" if gns.length > 1
|
119
|
+
end
|
120
|
+
@found[generator_name] or raise GeneratorError, "Couldn't find '#{generator_name}' generator"
|
115
121
|
end
|
116
122
|
|
117
123
|
# Convenience method to lookup and instantiate a generator.
|
@@ -124,7 +124,7 @@ module Rails
|
|
124
124
|
opt.on('-p', '--pretend', 'Run but do not make any changes.') { |options[:pretend]| }
|
125
125
|
opt.on('-f', '--force', 'Overwrite files that already exist.') { options[:collision] = :force }
|
126
126
|
opt.on('-s', '--skip', 'Skip files that already exist.') { options[:collision] = :skip }
|
127
|
-
opt.on('-q', '--quiet', '
|
127
|
+
opt.on('-q', '--quiet', 'Suppress normal output.') { |options[:quiet]| }
|
128
128
|
opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |options[:backtrace]| }
|
129
129
|
opt.on('-h', '--help', 'Show this help message.') { |options[:help]| }
|
130
130
|
end
|
data/lib/webrick_server.rb
CHANGED
@@ -28,7 +28,7 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
|
|
28
28
|
super
|
29
29
|
end
|
30
30
|
|
31
|
-
def
|
31
|
+
def service(req, res)
|
32
32
|
begin
|
33
33
|
unless handle_file(req, res)
|
34
34
|
REQUEST_MUTEX.lock
|
@@ -41,12 +41,10 @@ class DispatchServlet < WEBrick::HTTPServlet::AbstractServlet
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
alias :do_POST :do_GET
|
45
|
-
|
46
44
|
def handle_file(req, res)
|
47
45
|
begin
|
48
46
|
add_dot_html(req)
|
49
|
-
@file_handler.send(:
|
47
|
+
@file_handler.send(:service, req, res)
|
50
48
|
remove_dot_html(req)
|
51
49
|
return true
|
52
50
|
rescue HTTPStatus::PartialContent, HTTPStatus::NotModified => err
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.8
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rails
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2005-
|
6
|
+
version: 0.12.0
|
7
|
+
date: 2005-04-19
|
8
8
|
summary: "Web-application framework with template engine, control-flow layer, and ORM."
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -43,12 +43,14 @@ files:
|
|
43
43
|
- Rakefile
|
44
44
|
- README
|
45
45
|
- test
|
46
|
+
- bin/benchmarker
|
46
47
|
- bin/breakpointer
|
47
48
|
- bin/breakpointer_for_gem
|
48
49
|
- bin/console
|
49
|
-
- bin/console_sandbox
|
50
|
+
- bin/console_sandbox
|
50
51
|
- bin/destroy
|
51
52
|
- bin/generate
|
53
|
+
- bin/profiler
|
52
54
|
- bin/rails
|
53
55
|
- bin/runner
|
54
56
|
- bin/server
|
@@ -162,7 +164,7 @@ dependencies:
|
|
162
164
|
-
|
163
165
|
- ">="
|
164
166
|
- !ruby/object:Gem::Version
|
165
|
-
version: 0.5.
|
167
|
+
version: 0.5.3
|
166
168
|
version:
|
167
169
|
- !ruby/object:Gem::Dependency
|
168
170
|
name: activesupport
|
@@ -172,7 +174,7 @@ dependencies:
|
|
172
174
|
-
|
173
175
|
- "="
|
174
176
|
- !ruby/object:Gem::Version
|
175
|
-
version: 1.0.
|
177
|
+
version: 1.0.4
|
176
178
|
version:
|
177
179
|
- !ruby/object:Gem::Dependency
|
178
180
|
name: activerecord
|
@@ -182,7 +184,7 @@ dependencies:
|
|
182
184
|
-
|
183
185
|
- "="
|
184
186
|
- !ruby/object:Gem::Version
|
185
|
-
version: 1.
|
187
|
+
version: 1.10.0
|
186
188
|
version:
|
187
189
|
- !ruby/object:Gem::Dependency
|
188
190
|
name: actionpack
|
@@ -192,7 +194,7 @@ dependencies:
|
|
192
194
|
-
|
193
195
|
- "="
|
194
196
|
- !ruby/object:Gem::Version
|
195
|
-
version: 1.
|
197
|
+
version: 1.8.0
|
196
198
|
version:
|
197
199
|
- !ruby/object:Gem::Dependency
|
198
200
|
name: actionmailer
|
@@ -202,7 +204,7 @@ dependencies:
|
|
202
204
|
-
|
203
205
|
- "="
|
204
206
|
- !ruby/object:Gem::Version
|
205
|
-
version: 0.
|
207
|
+
version: 0.9.0
|
206
208
|
version:
|
207
209
|
- !ruby/object:Gem::Dependency
|
208
210
|
name: actionwebservice
|
@@ -212,5 +214,5 @@ dependencies:
|
|
212
214
|
-
|
213
215
|
- "="
|
214
216
|
- !ruby/object:Gem::Version
|
215
|
-
version: 0.
|
217
|
+
version: 0.7.0
|
216
218
|
version:
|