mirror of
https://github.com/github/rails.git
synced 2026-01-13 08:38:05 -05:00
Compare commits
18 Commits
github25
...
optimize-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbe129af02 | ||
|
|
bf71aa30d2 | ||
|
|
0928c2bf4f | ||
|
|
c96caaae9a | ||
|
|
050be61caf | ||
|
|
4baefa4de9 | ||
|
|
26fce88209 | ||
|
|
cb507570a1 | ||
|
|
9a2d6cad23 | ||
|
|
bf96f35248 | ||
|
|
21bae614ee | ||
|
|
1d6053f5bf | ||
|
|
f90bfeb930 | ||
|
|
bca938dae2 | ||
|
|
4579aa2767 | ||
|
|
0a522af512 | ||
|
|
ca6a64758b | ||
|
|
8573f7f86b |
6
README.md
Normal file
6
README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# GitHub Rails
|
||||
|
||||
This is GitHub's fork of Rails 2.3.
|
||||
|
||||
Please note that this fork is **unsupported**. It is not guaranteed to receive security patches or remain stable. **Use at your own risk.**
|
||||
|
||||
@@ -23,8 +23,6 @@ task :default => [ :test ]
|
||||
Rake::TestTask.new { |t|
|
||||
t.libs << "test"
|
||||
t.pattern = 'test/*_test.rb'
|
||||
t.verbose = true
|
||||
t.warning = false
|
||||
}
|
||||
|
||||
|
||||
|
||||
14
actionmailer/actionmailer.gemspec
Normal file
14
actionmailer/actionmailer.gemspec
Normal file
@@ -0,0 +1,14 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'actionmailer'
|
||||
s.version = '2.3.18'
|
||||
s.summary = 'Service layer for easy email delivery and testing.'
|
||||
s.description = 'Makes it trivial to test and deliver emails sent from a single service layer.'
|
||||
|
||||
s.author = 'David Heinemeier Hansson'
|
||||
s.email = 'david@loudthinking.com'
|
||||
s.homepage = 'http://www.rubyonrails.org'
|
||||
|
||||
s.require_path = 'lib'
|
||||
|
||||
s.add_dependency 'actionpack', '= 2.3.18'
|
||||
end
|
||||
@@ -30,16 +30,12 @@ Rake::TestTask.new(:test_action_pack) do |t|
|
||||
# make sure we include the tests in alphabetical order as on some systems
|
||||
# this will not happen automatically and the tests (as a whole) will error
|
||||
t.test_files = Dir.glob( "test/[cftv]*/**/*_test.rb" ).sort
|
||||
|
||||
t.verbose = true
|
||||
#t.warning = true
|
||||
end
|
||||
|
||||
desc 'ActiveRecord Integration Tests'
|
||||
Rake::TestTask.new(:test_active_record_integration) do |t|
|
||||
t.libs << "test"
|
||||
t.test_files = Dir.glob("test/activerecord/*_test.rb")
|
||||
t.verbose = true
|
||||
end
|
||||
|
||||
|
||||
|
||||
15
actionpack/actionpack.gemspec
Normal file
15
actionpack/actionpack.gemspec
Normal file
@@ -0,0 +1,15 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'actionpack'
|
||||
s.version = '2.3.18'
|
||||
s.summary = 'Web-flow and rendering framework putting the VC in MVC.'
|
||||
s.description = 'Eases web-request routing, handling, and response as a half-way front, half-way page controller. Implemented with specific emphasis on enabling easy unit/integration testing that doesn\'t require a browser.'
|
||||
|
||||
s.author = 'David Heinemeier Hansson'
|
||||
s.email = 'david@loudthinking.com'
|
||||
s.homepage = 'http://www.rubyonrails.org'
|
||||
|
||||
s.require_path = 'lib'
|
||||
|
||||
s.add_dependency 'activesupport', '= 2.3.18'
|
||||
s.add_dependency 'rack', '~> 1.4'
|
||||
end
|
||||
@@ -1332,10 +1332,7 @@ module ActionController #:nodoc:
|
||||
if action_methods.include?(action_name)
|
||||
send(action_name)
|
||||
default_render unless performed?
|
||||
elsif RUBY_VERSION == "1.9.3" && respond_to?(:method_missing)
|
||||
method_missing action_name.intern
|
||||
default_render unless performed?
|
||||
elsif RUBY_VERSION >= "2.0.0" && respond_to?(:method_missing, true) && !method(:method_missing).private?
|
||||
elsif defined?(self.method_missing) # returns "method" if method_missing is public or protected, but not if it's private
|
||||
method_missing action_name.intern
|
||||
default_render unless performed?
|
||||
else
|
||||
|
||||
@@ -138,8 +138,13 @@ module ActionController
|
||||
end
|
||||
end
|
||||
|
||||
def named_helper_module_eval(code, *args)
|
||||
@module.module_eval(code, *args)
|
||||
def named_helper_module_eval(code)
|
||||
file, line = caller.first.split(":")
|
||||
compile_option = RubyVM::InstructionSequence.compile_option
|
||||
RubyVM::InstructionSequence.compile_option = compile_option.merge(:trace_instruction => false)
|
||||
@module.module_eval(code, file, line.to_i + 1)
|
||||
ensure
|
||||
RubyVM::InstructionSequence.compile_option = compile_option
|
||||
end
|
||||
|
||||
def define_hash_access(route, name, kind, options)
|
||||
@@ -192,17 +197,44 @@ module ActionController
|
||||
url_for(#{hash_access_method}(opts)) # url_for(hash_for_users_url(opts))
|
||||
#
|
||||
end # end
|
||||
#Add an alias to support the now deprecated formatted_* URL. # #Add an alias to support the now deprecated formatted_* URL.
|
||||
def formatted_#{selector}(*args) # def formatted_users_url(*args)
|
||||
ActiveSupport::Deprecation.warn( # ActiveSupport::Deprecation.warn(
|
||||
"formatted_#{selector}() has been deprecated. " + # "formatted_users_url() has been deprecated. " +
|
||||
"Please pass format to the standard " + # "Please pass format to the standard " +
|
||||
"#{selector} method instead.", caller) # "users_url method instead.", caller)
|
||||
#{selector}(*args) # users_url(*args)
|
||||
end # end
|
||||
|
||||
protected :#{selector} # protected :users_url
|
||||
end_eval
|
||||
helpers << selector
|
||||
|
||||
if kind == :path
|
||||
define_fast_url_helper(selector, route, name)
|
||||
end
|
||||
end
|
||||
|
||||
def define_fast_url_helper(selector, route, name)
|
||||
dynamic_segments = route.segments.grep(DynamicSegment)
|
||||
|
||||
return if dynamic_segments.any?(&:optional?) # TODO - maybe exclude optional format
|
||||
|
||||
helper_arguments = dynamic_segments.map { |route_argument|
|
||||
"arg_#{route_argument.key}"
|
||||
}
|
||||
|
||||
route_segments = route.segments.dup
|
||||
|
||||
if route_segments.size > 1 && route_segments.last.is_a?(DividerSegment) && route_segments.last.optional?
|
||||
route_segments.pop
|
||||
end
|
||||
|
||||
string_segments = route_segments.map { |segment|
|
||||
if segment.is_a?(StaticSegment)
|
||||
segment.value.inspect
|
||||
else
|
||||
'"#{URI::DEFAULT_PARSER.escape(arg_%s.to_s, ActionController::Routing::Segment::UNSAFE_PCHAR)}"' % segment.key
|
||||
end
|
||||
}
|
||||
|
||||
named_helper_module_eval <<-"RUBY"
|
||||
def fast_#{selector}(#{helper_arguments.join(", ")})
|
||||
#{string_segments.join(" ")}
|
||||
end
|
||||
RUBY
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -357,24 +357,6 @@ class UrlWriterTests < ActionController::TestCase
|
||||
ActionController::Routing::Routes.load!
|
||||
end
|
||||
|
||||
def test_formatted_url_methods_are_deprecated
|
||||
ActionController::Routing::Routes.draw do |map|
|
||||
map.resources :posts
|
||||
end
|
||||
# We need to create a new class in order to install the new named route.
|
||||
kls = Class.new { include ActionController::UrlWriter }
|
||||
controller = kls.new
|
||||
params = {:id => 1, :format => :xml}
|
||||
assert_deprecated do
|
||||
assert_equal("/posts/1.xml", controller.send(:formatted_post_path, params))
|
||||
end
|
||||
assert_deprecated do
|
||||
assert_equal("/posts/1.xml", controller.send(:formatted_post_path, 1, :xml))
|
||||
end
|
||||
ensure
|
||||
ActionController::Routing::Routes.load!
|
||||
end
|
||||
|
||||
def test_multiple_includes_maintain_distinct_options
|
||||
first_class = Class.new { include ActionController::UrlWriter }
|
||||
second_class = Class.new { include ActionController::UrlWriter }
|
||||
|
||||
@@ -64,7 +64,6 @@ for adapter in %w( mysql postgresql sqlite sqlite3 firebird db2 oracle sybase op
|
||||
end
|
||||
adapter_short = adapter == 'db2' ? adapter : adapter[/^[a-z]+/]
|
||||
t.test_files=Dir.glob( "test/cases/**/*_test{,_#{adapter_short}}.rb" ).sort
|
||||
t.verbose = true
|
||||
}
|
||||
|
||||
namespace adapter do
|
||||
|
||||
17
activerecord/activerecord.gemspec
Normal file
17
activerecord/activerecord.gemspec
Normal file
@@ -0,0 +1,17 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'activerecord'
|
||||
s.version = '2.3.18'
|
||||
s.summary = 'Implements the ActiveRecord pattern for ORM.'
|
||||
s.description = 'Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database tables and classes together for business objects, like Customer or Subscription, that can find, save, and destroy themselves without resorting to manual SQL.'
|
||||
|
||||
s.author = 'David Heinemeier Hansson'
|
||||
s.email = 'david@loudthinking.com'
|
||||
s.homepage = 'http://www.rubyonrails.org'
|
||||
|
||||
s.require_path = 'lib'
|
||||
s.files = ['README']
|
||||
s.rdoc_options = ['--main', 'README']
|
||||
s.extra_rdoc_files = ['README']
|
||||
|
||||
s.add_dependency 'activesupport', '= 2.3.18'
|
||||
end
|
||||
@@ -2920,15 +2920,23 @@ module ActiveRecord #:nodoc:
|
||||
attributes.each do |k, v|
|
||||
if k.to_s.include?("(")
|
||||
multiparameter_attributes << [ k, v ]
|
||||
elsif RUBY_VERSION == "1.9.3"
|
||||
respond_to?(:"#{k}=") ? send(:"#{k}=", v) : raise(UnknownAttributeError, "unknown attribute: #{k}")
|
||||
else
|
||||
(respond_to?(:"#{k}=", true) && !method(:"#{k}=").private?) ? send(:"#{k}=", v) : raise(UnknownAttributeError, "unknown attribute: #{k}")
|
||||
_assign_attribute(k, v)
|
||||
end
|
||||
end
|
||||
|
||||
assign_multiparameter_attributes(multiparameter_attributes) unless multiparameter_attributes.empty?
|
||||
end
|
||||
|
||||
def _assign_attribute(k, v)
|
||||
public_send("#{k}=", v)
|
||||
rescue NoMethodError => e
|
||||
if respond_to?("#{k}=")
|
||||
raise e
|
||||
else
|
||||
raise UnknownAttributeError, "unknown attribute: #{k}"
|
||||
end
|
||||
end
|
||||
|
||||
def create_or_update
|
||||
raise ReadOnlyRecord if readonly?
|
||||
|
||||
@@ -31,8 +31,6 @@ Rake::TestTask.new { |t|
|
||||
t.libs << activesupport_path if File.directory?(activesupport_path)
|
||||
t.libs << "test"
|
||||
t.pattern = 'test/**/*_test.rb'
|
||||
t.verbose = true
|
||||
t.warning = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
17
activeresource/activeresource.gemspec
Normal file
17
activeresource/activeresource.gemspec
Normal file
@@ -0,0 +1,17 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'activeresource'
|
||||
s.version = '2.3.18'
|
||||
s.summary = 'Think Active Record for web resources.'
|
||||
s.description = 'Wraps web resources in model classes that can be manipulated through XML over REST.'
|
||||
|
||||
s.author = 'David Heinemeier Hansson'
|
||||
s.email = 'david@loudthinking.com'
|
||||
s.homepage = 'http://www.rubyonrails.org'
|
||||
|
||||
s.require_path = 'lib'
|
||||
s.files = ['README']
|
||||
s.rdoc_options = ['--main', 'README']
|
||||
s.extra_rdoc_files = ['README']
|
||||
|
||||
s.add_dependency 'activesupport', '= 2.3.18'
|
||||
end
|
||||
@@ -18,8 +18,6 @@ task :default => :test
|
||||
Rake::TestTask.new { |t|
|
||||
t.libs << "test"
|
||||
t.pattern = 'test/**/*_test.rb'
|
||||
t.verbose = true
|
||||
t.warning = true
|
||||
}
|
||||
|
||||
# Create compressed packages
|
||||
|
||||
12
activesupport/activesupport.gemspec
Normal file
12
activesupport/activesupport.gemspec
Normal file
@@ -0,0 +1,12 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'activesupport'
|
||||
s.version = '2.3.18'
|
||||
s.summary = 'Support and utility classes used by the Rails framework.'
|
||||
s.description = 'Utility library which carries commonly used classes and goodies from the Rails framework'
|
||||
|
||||
s.author = 'David Heinemeier Hansson'
|
||||
s.email = 'david@loudthinking.com'
|
||||
s.homepage = 'http://www.rubyonrails.org'
|
||||
|
||||
s.require_path = 'lib'
|
||||
end
|
||||
@@ -178,6 +178,8 @@ class MemoryStoreTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
uses_memcached 'memcached backed store' do
|
||||
next # these tests are broken on CI
|
||||
|
||||
class MemCacheStoreTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@cache = ActiveSupport::Cache.lookup_store(:mem_cache_store)
|
||||
|
||||
@@ -35,8 +35,6 @@ end
|
||||
Rake::TestTask.new("regular_test") do |t|
|
||||
t.libs << 'test'
|
||||
t.pattern = 'test/**/*_test.rb'
|
||||
t.warning = true
|
||||
t.verbose = true
|
||||
end
|
||||
|
||||
|
||||
|
||||
22
railties/railties.gemspec
Normal file
22
railties/railties.gemspec
Normal file
@@ -0,0 +1,22 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'rails'
|
||||
s.version = '2.3.18'
|
||||
s.summary = 'Web-application framework with template engine, control-flow layer, and ORM.'
|
||||
s.description = "Rails is a framework for building web-application using CGI, FCGI, mod_ruby, or WEBrick\non top of either MySQL, PostgreSQL, SQLite, DB2, SQL Server, or Oracle with eRuby- or Builder-based templates."
|
||||
|
||||
s.author = 'David Heinemeier Hansson'
|
||||
s.email = 'david@loudthinking.com'
|
||||
s.homepage = 'http://www.rubyonrails.org'
|
||||
|
||||
s.require_path = 'lib'
|
||||
s.files = ['bin/rails']
|
||||
s.executables = ['rails']
|
||||
s.rdoc_options = ['--exclude', '.']
|
||||
|
||||
s.add_dependency 'rake', '>= 0.8.3'
|
||||
s.add_dependency 'activesupport', '= 2.3.18'
|
||||
s.add_dependency 'activerecord', '= 2.3.18'
|
||||
s.add_dependency 'actionpack', '= 2.3.18'
|
||||
s.add_dependency 'actionmailer', '= 2.3.18'
|
||||
s.add_dependency 'activeresource', '= 2.3.18'
|
||||
end
|
||||
@@ -3,38 +3,5 @@
|
||||
set -x
|
||||
set -e
|
||||
|
||||
RUBY_VERSION="$(cat .ruby-version)"
|
||||
|
||||
# Use the right Ruby /without/ rbenv
|
||||
ruby_dir=$(dirname "$(RBENV_VERSION=$RUBY_VERSION rbenv which ruby)")
|
||||
export PATH=$ruby_dir:$PATH
|
||||
|
||||
# Announce who we are
|
||||
ruby -v
|
||||
|
||||
# Because Rails 2.3 doesn't use Bundler for its own tests,
|
||||
# we need to setup an isolated gem environment.
|
||||
|
||||
gem_environment_version="$(md5sum Gemfile.sh | cut -d' ' -f1)-$(ruby -e 'print RUBY_VERSION')"
|
||||
|
||||
gem_dir=`pwd`/.gem
|
||||
gem_pristine_dir=${gem_dir}-${gem_environment_version}
|
||||
|
||||
export GEM_HOME=$gem_dir
|
||||
export GEM_PATH=$gem_dir:$GEM_PATH
|
||||
export GEM_ROOT=$gem_dir
|
||||
|
||||
rm -rf $gem_dir
|
||||
|
||||
if [ ! -d $gem_pristine_dir ]; then
|
||||
mkdir $gem_dir
|
||||
|
||||
. Gemfile.sh
|
||||
|
||||
mv $gem_dir $gem_pristine_dir
|
||||
fi
|
||||
|
||||
cp -r $gem_pristine_dir $gem_dir
|
||||
|
||||
# Go ham
|
||||
rake
|
||||
script/cibuild-on 1.9.3-p231-tcs-github
|
||||
script/cibuild-on 2.0.0-github
|
||||
|
||||
40
script/cibuild-on
Executable file
40
script/cibuild-on
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
RUBY_VERSION="$1"
|
||||
|
||||
# Use the right Ruby /without/ rbenv
|
||||
ruby_dir=$(dirname "$(RBENV_VERSION=$RUBY_VERSION rbenv which ruby)")
|
||||
export PATH=$ruby_dir:$PATH
|
||||
|
||||
# Announce who we are
|
||||
ruby -v
|
||||
|
||||
# Because Rails 2.3 doesn't use Bundler for its own tests,
|
||||
# we need to setup an isolated gem environment.
|
||||
|
||||
gem_environment_version="$(md5sum Gemfile.sh | cut -d' ' -f1)-$(ruby -e 'print RUBY_VERSION')"
|
||||
|
||||
gem_dir=`pwd`/.gem
|
||||
gem_pristine_dir=${gem_dir}-${gem_environment_version}
|
||||
|
||||
export GEM_HOME=$gem_dir
|
||||
export GEM_PATH=$gem_dir:$GEM_PATH
|
||||
export GEM_ROOT=$gem_dir
|
||||
|
||||
rm -rf $gem_dir
|
||||
|
||||
if [ ! -d $gem_pristine_dir ]; then
|
||||
mkdir $gem_dir
|
||||
|
||||
. Gemfile.sh
|
||||
|
||||
mv $gem_dir $gem_pristine_dir
|
||||
fi
|
||||
|
||||
cp -r $gem_pristine_dir $gem_dir
|
||||
|
||||
# Go ham
|
||||
rake
|
||||
Reference in New Issue
Block a user