rails 0.13.1 → 0.14.1
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 +105 -0
- data/Rakefile +39 -17
- data/bin/breakpointer +2 -2
- data/bin/console +2 -22
- data/bin/destroy +2 -6
- data/bin/generate +2 -6
- data/bin/performance/benchmarker +3 -0
- data/bin/performance/profiler +3 -0
- data/bin/process/reaper +3 -0
- data/bin/process/spawner +3 -0
- data/bin/process/spinner +3 -0
- data/bin/rails +4 -0
- data/bin/runner +2 -27
- data/bin/server +2 -48
- data/configs/apache.conf +8 -0
- data/configs/database.yml +8 -8
- data/environments/boot.rb +17 -0
- data/environments/development.rb +10 -7
- data/environments/environment.rb +37 -73
- data/environments/production.rb +15 -6
- data/environments/test.rb +12 -6
- data/fresh_rakefile +6 -198
- data/helpers/application.rb +2 -2
- data/helpers/application_helper.rb +1 -1
- data/helpers/test_helper.rb +6 -19
- data/html/javascripts/controls.js +427 -165
- data/html/javascripts/dragdrop.js +256 -277
- data/html/javascripts/effects.js +766 -277
- data/html/javascripts/prototype.js +903 -217
- data/html/javascripts/scriptaculous.js +47 -0
- data/html/javascripts/slider.js +258 -0
- data/html/robots.txt +1 -0
- data/lib/binding_of_caller.rb +3 -1
- data/lib/breakpoint.rb +5 -5
- data/lib/breakpoint_client.rb +1 -1
- data/lib/code_statistics.rb +7 -4
- data/lib/commands.rb +17 -0
- data/lib/commands/breakpointer.rb +1 -0
- data/lib/commands/console.rb +22 -0
- data/lib/commands/destroy.rb +6 -0
- data/lib/commands/generate.rb +6 -0
- data/{bin → lib/commands/ncgi}/listener +0 -0
- data/{bin → lib/commands/ncgi}/tracker +0 -0
- data/lib/commands/performance/benchmarker.rb +26 -0
- data/{bin/profiler → lib/commands/performance/profiler.rb} +3 -2
- data/lib/commands/process/reaper.rb +130 -0
- data/lib/commands/process/spawner.rb +52 -0
- data/lib/commands/process/spinner.rb +57 -0
- data/lib/commands/runner.rb +27 -0
- data/lib/commands/server.rb +59 -0
- data/{bin/update → lib/commands/update.rb} +1 -2
- data/lib/dispatcher.rb +20 -3
- data/lib/fcgi_handler.rb +59 -41
- data/lib/initializer.rb +479 -0
- data/lib/rails_generator/base.rb +2 -2
- data/lib/rails_generator/commands.rb +59 -7
- data/lib/rails_generator/generators/applications/app/app_generator.rb +26 -15
- data/lib/rails_generator/generators/components/controller/controller_generator.rb +3 -2
- data/lib/rails_generator/generators/components/controller/templates/view.rhtml +1 -1
- data/lib/rails_generator/generators/components/mailer/USAGE +2 -3
- data/lib/rails_generator/generators/components/mailer/templates/unit_test.rb +1 -1
- data/lib/rails_generator/generators/components/migration/migration_generator.rb +3 -1
- data/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +32 -31
- data/lib/rails_generator/generators/components/scaffold/templates/view_edit.rhtml +1 -1
- data/lib/rails_generator/generators/components/scaffold/templates/view_list.rhtml +1 -1
- data/lib/rails_generator/generators/components/scaffold/templates/view_new.rhtml +1 -1
- data/lib/rails_generator/lookup.rb +3 -3
- data/lib/rails_generator/options.rb +1 -0
- data/lib/rails_generator/scripts.rb +1 -1
- data/lib/rails_version.rb +9 -0
- data/lib/railties_path.rb +1 -0
- data/lib/rubyprof_ext.rb +1 -1
- data/lib/tasks/databases.rake +152 -0
- data/lib/tasks/documentation.rake +44 -0
- data/lib/tasks/framework.rake +33 -0
- data/lib/tasks/javascripts.rake +6 -0
- data/lib/tasks/misc.rake +15 -0
- data/lib/tasks/rails.rb +7 -0
- data/lib/tasks/statistics.rake +16 -0
- data/lib/tasks/testing.rake +37 -0
- data/lib/test_help.rb +13 -0
- data/lib/webrick_server.rb +31 -9
- metadata +121 -85
- data/bin/benchmarker +0 -19
- data/bin/breakpointer_for_gem +0 -4
- data/bin/console_sandbox +0 -0
data/CHANGELOG
CHANGED
@@ -1,5 +1,110 @@
|
|
1
|
+
*0.14.1* (October 19th, 2005)
|
2
|
+
|
3
|
+
* Don't clean RAILS_ROOT on windows
|
4
|
+
|
5
|
+
* Remove trailing '/' from RAILS_ROOT [Nicholas Seckar]
|
6
|
+
|
7
|
+
* Upgraded to Active Record 1.12.1 and Action Pack 1.10.1
|
8
|
+
|
9
|
+
|
10
|
+
*0.14.0* (October 16th, 2005)
|
11
|
+
|
12
|
+
* Moved generator folder from RAILS_ROOT/generators to RAILS_ROOT/lib/generators [Tobias Luetke]
|
13
|
+
|
14
|
+
* Fix rake dev and related commands [Nicholas Seckar]
|
15
|
+
|
16
|
+
* The rails command tries to deduce your MySQL socket by running `mysql_config
|
17
|
+
--socket`. If it fails, default to /path/to/your/mysql.sock
|
18
|
+
|
19
|
+
* 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]
|
20
|
+
|
21
|
+
* 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)
|
22
|
+
|
23
|
+
* Added update_javascripts task which will fetch all the latest js files from your current rails install. Use after updating rails. [Tobias Luetke]
|
24
|
+
|
25
|
+
* Added cleaning of RAILS_ROOT to useless elements such as '../non-dot-dot/'. Provides cleaner backtraces and error messages. [Nicholas Seckar]
|
26
|
+
|
27
|
+
* Made the instantiated/transactional fixtures settings be controlled through Rails::Initializer. Transactional and non-instantiated fixtures are default from now on. [Florian Weber]
|
28
|
+
|
29
|
+
* Support using different database adapters for development and test with ActiveRecord::Base.schema_format = :ruby [Sam Stephenson]
|
30
|
+
|
31
|
+
* Make webrick work with session(:off)
|
32
|
+
|
33
|
+
* Add --version, -v option to the Rails command. Closes #1840. [stancell]
|
34
|
+
|
35
|
+
* 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]
|
36
|
+
|
37
|
+
* Make the generator skip a file if it already exists and is identical to the new file.
|
38
|
+
|
39
|
+
* Add experimental plugin support #2335
|
40
|
+
|
41
|
+
* Made Rakefile aware of new .js files in script.aculo.us [Thomas Fuchs]
|
42
|
+
|
43
|
+
* Make table_name and controller_name in generators honor AR::Base.pluralize_table_names. #1216 #2213 [kazuhiko@fdiary.net]
|
44
|
+
|
45
|
+
* Clearly label functional and unit tests in rake stats output. #2297 [lasse.koskela@gmail.com]
|
46
|
+
|
47
|
+
* Make the migration generator only check files ending in *.rb when calculating the next file name #2317 [Chad Fowler]
|
48
|
+
|
49
|
+
* Added prevention of duplicate migrations from the generator #2240 [fbeausoleil@ftml.net]
|
50
|
+
|
51
|
+
* 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).
|
52
|
+
|
53
|
+
* Reformed all the config/environments/* files to conform to the new Rails::Configuration approach. Fully backwards compatible.
|
54
|
+
|
55
|
+
* 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
|
56
|
+
|
57
|
+
* Added dump of schema version to the db_structure_dump task for databases that support migrations #1835 [Rick Olson]
|
58
|
+
|
59
|
+
* Fixed script/profiler for Ruby 1.8.2 #1863 [Rick Olson]
|
60
|
+
|
61
|
+
* Fixed clone_structure_to_test task for SQLite #1864 [jon@burningbush.us]
|
62
|
+
|
63
|
+
* Added -m/--mime-types option to the WEBrick server, so you can specify a Apache-style mime.types file to load #2059 [ask@develooper.com]
|
64
|
+
|
65
|
+
* Added -c/--svn option to the generator that'll add new files and remove destroyed files using svn add/revert/remove as appropriate #2064 [kevin.clark@gmail.com]
|
66
|
+
|
67
|
+
* Added -c/--charset option to WEBrick server, so you can specify a default charset (which without changes is UTF-8) #2084 [wejn@box.cz]
|
68
|
+
|
69
|
+
* Make the default stats task extendable by modifying the STATS_DIRECTORIES constant
|
70
|
+
|
71
|
+
* Allow the selected environment to define RAILS_DEFAULT_LOGGER, and have Rails::Initializer use it if it exists.
|
72
|
+
|
73
|
+
* Moved all the shared tasks from Rakefile into Rails, so that the Rakefile is empty and doesn't require updating.
|
74
|
+
|
75
|
+
* 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)
|
76
|
+
|
77
|
+
* Fixed the scaffold generator to fail right away if the database isn't accessible instead of in mid-air #1169 [Chad Fowler]
|
78
|
+
|
79
|
+
* Corrected project-local generator location in scripts.rb #2010 [Michael Schuerig]
|
80
|
+
|
81
|
+
* Don't require the environment just to clear the logs #2093 [Scott Barron]
|
82
|
+
|
83
|
+
* Make the default rakefile read *.rake files from config/tasks (for easy extension of the rakefile by e.g. generators)
|
84
|
+
|
85
|
+
* Only load breakpoint in development mode and when BREAKPOINT_SERVER_PORT is defined.
|
86
|
+
|
87
|
+
* Allow the --toggle-spin switch on process/reaper to be negated
|
88
|
+
|
89
|
+
* Replace render_partial with render :partial in scaffold generator [Nicholas Seckar]
|
90
|
+
|
91
|
+
* Added -w flag to ps in process/reaper #1934 [Scott Barron]
|
92
|
+
|
93
|
+
* 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]
|
94
|
+
|
95
|
+
* 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.
|
96
|
+
|
97
|
+
* Added load_fixtures task to the Rakefile, which will load all the fixtures into the database for the current environment #1791 [Marcel Molina]
|
98
|
+
|
99
|
+
* 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]
|
100
|
+
|
101
|
+
* 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).
|
102
|
+
|
103
|
+
|
1
104
|
*0.13.1* (11 July, 2005)
|
2
105
|
|
106
|
+
* 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.
|
107
|
+
|
3
108
|
* Fixed that each request with the WEBrick adapter would open a new database connection #1685 [Sam Stephenson]
|
4
109
|
|
5
110
|
* Added support for SQL Server in the database rake tasks #1652 [ken.barker@gmail.com] 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.
|
data/Rakefile
CHANGED
@@ -7,9 +7,11 @@ require 'rake/contrib/rubyforgepublisher'
|
|
7
7
|
require 'date'
|
8
8
|
require 'rbconfig'
|
9
9
|
|
10
|
+
require File.join(File.dirname(__FILE__), 'lib', 'rails_version')
|
11
|
+
|
10
12
|
PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
|
11
13
|
PKG_NAME = 'rails'
|
12
|
-
PKG_VERSION =
|
14
|
+
PKG_VERSION = Rails::Version::STRING + PKG_BUILD
|
13
15
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
14
16
|
PKG_DESTINATION = ENV["RAILS_PKG_DESTINATION"] || "../#{PKG_NAME}"
|
15
17
|
|
@@ -19,21 +21,28 @@ RUBY_FORGE_PROJECT = "rails"
|
|
19
21
|
RUBY_FORGE_USER = "webster132"
|
20
22
|
|
21
23
|
|
22
|
-
|
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 )
|
23
32
|
APP_DIRS = %w( apis models controllers helpers views views/layouts )
|
24
33
|
PUBLIC_DIRS = %w( images javascripts stylesheets )
|
25
34
|
TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
|
26
35
|
|
27
36
|
LOG_FILES = %w( server.log development.log test.log production.log )
|
28
|
-
HTML_FILES = %w( 404.html 500.html index.html favicon.ico
|
29
|
-
|
37
|
+
HTML_FILES = %w( 404.html 500.html index.html robots.txt favicon.ico
|
38
|
+
javascripts/prototype.js javascripts/scriptaculous.js
|
39
|
+
javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js
|
40
|
+
javascripts/slider.js )
|
41
|
+
BIN_FILES = %w( breakpointer console destroy generate performance/benchmarker performance/profiler process/reaper process/spawner process/spinner runner server )
|
30
42
|
|
31
43
|
VENDOR_LIBS = %w( actionpack activerecord actionmailer activesupport actionwebservice railties )
|
32
44
|
|
33
45
|
|
34
|
-
desc "Default Task"
|
35
|
-
task :default => [ :fresh_rails ]
|
36
|
-
|
37
46
|
desc "Generates a fresh Rails package with documentation"
|
38
47
|
task :fresh_rails => [ :clean, :make_dir_structure, :initialize_file_stubs, :copy_vendor_libraries, :copy_ties_content, :generate_documentation ]
|
39
48
|
|
@@ -63,7 +72,7 @@ end
|
|
63
72
|
|
64
73
|
desc "Updates railties to the latest version of the javascript spinoffs"
|
65
74
|
task :update_js do
|
66
|
-
for js in %w( prototype controls dragdrop effects )
|
75
|
+
for js in %w( prototype controls dragdrop effects slider )
|
67
76
|
rm "html/javascripts/#{js}.js"
|
68
77
|
cp "./../actionpack/lib/action_view/helpers/javascripts/#{js}.js", "html/javascripts"
|
69
78
|
end
|
@@ -147,11 +156,16 @@ task :copy_application do
|
|
147
156
|
end
|
148
157
|
|
149
158
|
task :copy_configs do
|
150
|
-
|
159
|
+
app_name = "rails"
|
160
|
+
socket = nil
|
161
|
+
require 'erb'
|
162
|
+
File.open("#{PKG_DESTINATION}/config/database.yml", 'w') {|f| f.write ERB.new(IO.read("configs/database.yml")).result(binding)}
|
163
|
+
|
151
164
|
cp "configs/routes.rb", "#{PKG_DESTINATION}/config/routes.rb"
|
152
165
|
|
153
166
|
cp "configs/apache.conf", "#{PKG_DESTINATION}/public/.htaccess"
|
154
167
|
|
168
|
+
cp "environments/boot.rb", "#{PKG_DESTINATION}/config/boot.rb"
|
155
169
|
cp "environments/environment.rb", "#{PKG_DESTINATION}/config/environment.rb"
|
156
170
|
cp "environments/production.rb", "#{PKG_DESTINATION}/config/environments/production.rb"
|
157
171
|
cp "environments/development.rb", "#{PKG_DESTINATION}/config/environments/development.rb"
|
@@ -217,13 +231,21 @@ task :generate_app_doc do
|
|
217
231
|
system %{cd #{PKG_DESTINATION}; rake appdoc}
|
218
232
|
end
|
219
233
|
|
234
|
+
Rake::RDocTask.new { |rdoc|
|
235
|
+
rdoc.rdoc_dir = 'doc'
|
236
|
+
rdoc.title = "Railties -- Gluing the Engine to the Rails"
|
237
|
+
rdoc.options << '--line-numbers --inline-source --accessor cattr_accessor=object'
|
238
|
+
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
239
|
+
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
240
|
+
rdoc.rdoc_files.include('lib/*.rb')
|
241
|
+
rdoc.rdoc_files.include('lib/rails_generator/*.rb')
|
242
|
+
rdoc.rdoc_files.include('lib/commands/**/*.rb')
|
243
|
+
}
|
220
244
|
|
221
245
|
# Generate GEM ----------------------------------------------------------------------------
|
222
246
|
|
223
247
|
task :copy_gem_environment do
|
224
248
|
cp "environments/environment.rb", "#{PKG_DESTINATION}/config/environment.rb"
|
225
|
-
dest_file = File.join(PKG_DESTINATION, 'script', 'breakpointer')
|
226
|
-
copy_with_rewritten_ruby_path(File.join('bin', 'breakpointer_for_gem'), dest_file)
|
227
249
|
chmod 0755, dest_file
|
228
250
|
end
|
229
251
|
|
@@ -250,12 +272,12 @@ spec = Gem::Specification.new do |s|
|
|
250
272
|
on top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates.
|
251
273
|
EOF
|
252
274
|
|
253
|
-
s.add_dependency('rake', '>= 0.
|
254
|
-
s.add_dependency('activesupport', '= 1.
|
255
|
-
s.add_dependency('activerecord', '= 1.
|
256
|
-
s.add_dependency('actionpack', '= 1.
|
257
|
-
s.add_dependency('actionmailer', '= 1.
|
258
|
-
s.add_dependency('actionwebservice', '= 0.
|
275
|
+
s.add_dependency('rake', '>= 0.6.2')
|
276
|
+
s.add_dependency('activesupport', '= 1.2.1' + PKG_BUILD)
|
277
|
+
s.add_dependency('activerecord', '= 1.12.1' + PKG_BUILD)
|
278
|
+
s.add_dependency('actionpack', '= 1.10.1' + PKG_BUILD)
|
279
|
+
s.add_dependency('actionmailer', '= 1.1.1' + PKG_BUILD)
|
280
|
+
s.add_dependency('actionwebservice', '= 0.9.1' + PKG_BUILD)
|
259
281
|
|
260
282
|
s.rdoc_options << '--exclude' << '.'
|
261
283
|
s.has_rdoc = false
|
data/bin/breakpointer
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
#!/usr/local/bin/ruby
|
2
|
-
|
3
|
-
require '
|
2
|
+
require File.dirname(__FILE__) + '/../config/boot'
|
3
|
+
require 'commands/breakpointer'
|
data/bin/console
CHANGED
@@ -1,23 +1,3 @@
|
|
1
1
|
#!/usr/local/bin/ruby
|
2
|
-
|
3
|
-
|
4
|
-
require 'optparse'
|
5
|
-
options = { :sandbox => false, :irb => irb }
|
6
|
-
OptionParser.new do |opt|
|
7
|
-
opt.on('-s', '--sandbox', 'Rollback database modifications on exit.') { |options[:sandbox]| }
|
8
|
-
opt.on("--irb=[#{irb}]", 'Invoke a different irb.') { |options[:irb]| }
|
9
|
-
opt.parse!(ARGV)
|
10
|
-
end
|
11
|
-
|
12
|
-
libs = " -r irb/completion"
|
13
|
-
libs << " -r #{File.dirname(__FILE__)}/../config/environment"
|
14
|
-
libs << " -r console_sandbox" if options[:sandbox]
|
15
|
-
|
16
|
-
ENV['RAILS_ENV'] = ARGV.first || 'development'
|
17
|
-
if options[:sandbox]
|
18
|
-
puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
|
19
|
-
puts "Any modifications you make will be rolled back on exit."
|
20
|
-
else
|
21
|
-
puts "Loading #{ENV['RAILS_ENV']} environment."
|
22
|
-
end
|
23
|
-
exec "#{options[:irb]} #{libs} --prompt-mode simple"
|
2
|
+
require File.dirname(__FILE__) + '/../config/boot'
|
3
|
+
require 'commands/console'
|
data/bin/destroy
CHANGED
@@ -1,7 +1,3 @@
|
|
1
1
|
#!/usr/local/bin/ruby
|
2
|
-
require File.dirname(__FILE__) + '/../config/
|
3
|
-
require '
|
4
|
-
require 'rails_generator/scripts/destroy'
|
5
|
-
|
6
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
7
|
-
Rails::Generator::Scripts::Destroy.new.run(ARGV)
|
2
|
+
require File.dirname(__FILE__) + '/../config/boot'
|
3
|
+
require 'commands/destroy'
|
data/bin/generate
CHANGED
@@ -1,7 +1,3 @@
|
|
1
1
|
#!/usr/local/bin/ruby
|
2
|
-
require File.dirname(__FILE__) + '/../config/
|
3
|
-
require '
|
4
|
-
require 'rails_generator/scripts/generate'
|
5
|
-
|
6
|
-
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
7
|
-
Rails::Generator::Scripts::Generate.new.run(ARGV)
|
2
|
+
require File.dirname(__FILE__) + '/../config/boot'
|
3
|
+
require 'commands/generate'
|
data/bin/process/reaper
ADDED
data/bin/process/spawner
ADDED
data/bin/process/spinner
ADDED
data/bin/rails
CHANGED
@@ -11,7 +11,11 @@ end
|
|
11
11
|
|
12
12
|
Signal.trap("INT") { puts; exit }
|
13
13
|
|
14
|
+
require File.dirname(__FILE__) + '/../lib/rails_version'
|
15
|
+
abort "Rails #{Rails::Version::STRING}" if %w(--version -v).include? ARGV.first
|
16
|
+
|
14
17
|
require File.dirname(__FILE__) + '/../lib/rails_generator'
|
18
|
+
|
15
19
|
require 'rails_generator/scripts/generate'
|
16
20
|
Rails::Generator::Base.use_application_sources!
|
17
21
|
Rails::Generator::Scripts::Generate.new.run(ARGV, :generator => 'app')
|
data/bin/runner
CHANGED
@@ -1,28 +1,3 @@
|
|
1
|
-
require 'optparse'
|
2
|
-
|
3
|
-
options = { :environment => "development" }
|
4
|
-
|
5
|
-
ARGV.options do |opts|
|
6
|
-
script_name = File.basename($0)
|
7
|
-
opts.banner = "Usage: runner 'puts Person.find(1).name' [options]"
|
8
|
-
|
9
|
-
opts.separator ""
|
10
|
-
|
11
|
-
opts.on("-e", "--environment=name", String,
|
12
|
-
"Specifies the environment for the runner to operate under (test/development/production).",
|
13
|
-
"Default: development") { |options[:environment]| }
|
14
|
-
|
15
|
-
opts.separator ""
|
16
|
-
|
17
|
-
opts.on("-h", "--help",
|
18
|
-
"Show this help message.") { puts opts; exit }
|
19
|
-
|
20
|
-
opts.parse!
|
21
|
-
end
|
22
|
-
|
23
|
-
ENV["RAILS_ENV"] = options[:environment]
|
24
|
-
|
25
1
|
#!/usr/local/bin/ruby
|
26
|
-
|
27
|
-
require
|
28
|
-
eval(ARGV.first)
|
2
|
+
require File.dirname(__FILE__) + '/../config/boot'
|
3
|
+
require 'commands/runner'
|
data/bin/server
CHANGED
@@ -1,49 +1,3 @@
|
|
1
1
|
#!/usr/local/bin/ruby
|
2
|
-
|
3
|
-
require '
|
4
|
-
require 'optparse'
|
5
|
-
|
6
|
-
OPTIONS = {
|
7
|
-
:port => 3000,
|
8
|
-
:ip => "0.0.0.0",
|
9
|
-
:environment => "development",
|
10
|
-
:server_root => File.expand_path(File.dirname(__FILE__) + "/../public/"),
|
11
|
-
:server_type => WEBrick::SimpleServer
|
12
|
-
}
|
13
|
-
|
14
|
-
ARGV.options do |opts|
|
15
|
-
script_name = File.basename($0)
|
16
|
-
opts.banner = "Usage: ruby #{script_name} [options]"
|
17
|
-
|
18
|
-
opts.separator ""
|
19
|
-
|
20
|
-
opts.on("-p", "--port=port", Integer,
|
21
|
-
"Runs Rails on the specified port.",
|
22
|
-
"Default: 3000") { |OPTIONS[:port]| }
|
23
|
-
opts.on("-b", "--binding=ip", String,
|
24
|
-
"Binds Rails to the specified ip.",
|
25
|
-
"Default: 0.0.0.0") { |OPTIONS[:ip]| }
|
26
|
-
opts.on("-e", "--environment=name", String,
|
27
|
-
"Specifies the environment to run this server under (test/development/production).",
|
28
|
-
"Default: development") { |OPTIONS[:environment]| }
|
29
|
-
opts.on("-d", "--daemon",
|
30
|
-
"Make Rails run as a Daemon (only works if fork is available -- meaning on *nix)."
|
31
|
-
) { OPTIONS[:server_type] = WEBrick::Daemon }
|
32
|
-
|
33
|
-
opts.separator ""
|
34
|
-
|
35
|
-
opts.on("-h", "--help",
|
36
|
-
"Show this help message.") { puts opts; exit }
|
37
|
-
|
38
|
-
opts.parse!
|
39
|
-
end
|
40
|
-
|
41
|
-
ENV["RAILS_ENV"] = OPTIONS[:environment]
|
42
|
-
require File.dirname(__FILE__) + "/../config/environment"
|
43
|
-
require 'webrick_server'
|
44
|
-
|
45
|
-
OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT)
|
46
|
-
|
47
|
-
puts "=> Rails application started on http://#{OPTIONS[:ip]}:#{OPTIONS[:port]}"
|
48
|
-
puts "=> Ctrl-C to shutdown server; call with --help for options" if OPTIONS[:server_type] == WEBrick::SimpleServer
|
49
|
-
DispatchServlet.dispatch(OPTIONS)
|
2
|
+
require File.dirname(__FILE__) + '/../config/boot'
|
3
|
+
require 'commands/server'
|
data/configs/apache.conf
CHANGED
@@ -18,6 +18,14 @@ Options +FollowSymLinks +ExecCGI
|
|
18
18
|
# Example:
|
19
19
|
# RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
|
20
20
|
RewriteEngine On
|
21
|
+
|
22
|
+
# If your Rails application is accessed via an Alias directive,
|
23
|
+
# then you MUST also set the RewriteBase in this htaccess file.
|
24
|
+
#
|
25
|
+
# Example:
|
26
|
+
# Alias /myrailsapp /path/to/myrailsapp/public
|
27
|
+
# RewriteBase /myrailsapp
|
28
|
+
|
21
29
|
RewriteRule ^$ index.html [QSA]
|
22
30
|
RewriteRule ^([^.]+)$ $1.html [QSA]
|
23
31
|
RewriteCond %{REQUEST_FILENAME} !-f
|
data/configs/database.yml
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
development:
|
2
2
|
adapter: mysql
|
3
|
-
database:
|
4
|
-
|
3
|
+
database: <%= app_name %>_development
|
4
|
+
<%= "socket: #{socket}" if socket %>
|
5
5
|
username: root
|
6
|
-
password:
|
7
|
-
|
6
|
+
password:
|
7
|
+
|
8
8
|
# Warning: The database defined as 'test' will be erased and
|
9
9
|
# re-generated from your development database when you run 'rake'.
|
10
10
|
# Do not set this db to the same as development or production.
|
11
11
|
test:
|
12
12
|
adapter: mysql
|
13
|
-
database:
|
14
|
-
|
13
|
+
database: <%= app_name %>_test
|
14
|
+
<%= "socket: #{socket}" if socket %>
|
15
15
|
username: root
|
16
16
|
password:
|
17
17
|
|
18
18
|
production:
|
19
19
|
adapter: mysql
|
20
|
-
database:
|
21
|
-
|
20
|
+
database: <%= app_name %>_production
|
21
|
+
<%= "socket: #{socket}" if socket %>
|
22
22
|
username: root
|
23
23
|
password:
|