Permalink
Browse files

Merge branch 'master' of github.com:lifo/docrails

  • Loading branch information...
2 parents 2e4b741 + 767de13 commit 0f991786ee99f6793d2a9453422eeaf60f0c0464 @jaimeiniesta jaimeiniesta committed Jul 20, 2010
Showing with 792 additions and 4,488 deletions.
  1. +5 −6 Gemfile
  2. +1 −1 actionmailer/actionmailer.gemspec
  3. +2 −2 actionpack/actionpack.gemspec
  4. +3 −3 actionpack/lib/action_dispatch/routing.rb
  5. +1 −3 actionpack/lib/action_dispatch/routing/route_set.rb
  6. +0 −32 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount.rb
  7. +0 −60 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/analysis/frequency.rb
  8. +0 −74 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/analysis/histogram.rb
  9. +0 −159 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/analysis/splitting.rb
  10. +0 −113 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/code_generation.rb
  11. +0 −210 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/generatable_regexp.rb
  12. +0 −53 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/multimap.rb
  13. +0 −36 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/prefix.rb
  14. +0 −69 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/regexp_with_named_groups.rb
  15. +0 −130 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/route.rb
  16. +0 −409 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/route_set.rb
  17. +0 −68 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/strexp.rb
  18. +0 −160 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/strexp/parser.rb
  19. +0 −34 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/strexp/parser.y
  20. +0 −83 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/strexp/tokenizer.rb
  21. +0 −12 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/strexp/tokenizer.rex
  22. +0 −148 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/utils.rb
  23. +0 −569 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/multimap/multimap.rb
  24. +0 −185 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/multimap/multiset.rb
  25. +0 −158 ...ack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/multimap/nested_multimap.rb
  26. +0 −45 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin.rb
  27. +0 −40 ...pack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/alternation.rb
  28. +0 −4 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/anchor.rb
  29. +0 −59 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/atom.rb
  30. +0 −56 ...onpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/character.rb
  31. +0 −55 .../lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/character_class.rb
  32. +0 −83 ...npack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/collection.rb
  33. +0 −126 ...npack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/expression.rb
  34. +0 −90 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/group.rb
  35. +0 −55 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/options.rb
  36. +0 −415 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/parser.rb
  37. +0 −213 ...onpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/tokenizer.rb
  38. +0 −3 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/vendor/regin/regin/version.rb
  39. +0 −5 actionpack/lib/action_dispatch/vendor/rack-mount-0.6.6.pre/rack/mount/version.rb
  40. +1 −1 activemodel/lib/active_model/callbacks.rb
  41. +2 −2 activemodel/lib/active_model/serializers/json.rb
  42. +1 −1 activerecord/activerecord.gemspec
  43. +1 −1 activerecord/examples/performance.rb
  44. +1 −1 activerecord/lib/active_record/associations.rb
  45. +1 −1 activerecord/lib/active_record/base.rb
  46. +13 −22 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
  47. +9 −2 activerecord/lib/active_record/persistence.rb
  48. +20 −20 activerecord/lib/active_record/relation/query_methods.rb
  49. +7 −0 activerecord/test/cases/associations/cascaded_eager_loading_test.rb
  50. +1 −330 activerecord/test/cases/base_test.rb
  51. +25 −0 activerecord/test/cases/connection_management_test.rb
  52. +28 −22 activerecord/test/cases/connection_pool_test.rb
  53. +358 −0 activerecord/test/cases/persistence_test.rb
  54. +5 −4 activesupport/test/core_ext/class_test.rb
  55. +1 −1 ci/ci_build.rb
  56. +1 −1 rails.gemspec
  57. +46 −10 railties/guides/source/active_support_core_extensions.textile
  58. +187 −0 railties/guides/source/api_documentation_guidelines.textile
  59. +12 −4 railties/guides/source/index.html.erb
  60. +7 −6 railties/guides/source/initialization.textile
  61. +4 −1 railties/guides/source/layout.html.erb
  62. +1 −0 railties/lib/rails/generators/rails/app/app_generator.rb
  63. +8 −1 railties/lib/rails/generators/rails/app/templates/config/application.rb
  64. +12 −28 railties/lib/rails/paths.rb
  65. +6 −1 railties/test/generators/app_generator_test.rb
  66. +22 −2 railties/test/paths_test.rb
View
@@ -1,7 +1,6 @@
source 'http://rubygems.org'
gem "arel", :git => "git://github.com/rails/arel.git"
-#gem "rack-mount", :git => "git://github.com/rails/rack-mount.git"
gem "rails", :path => File.dirname(__FILE__)
gem "rake", ">= 0.8.7"
@@ -17,21 +16,21 @@ end
if mri || RUBY_ENGINE == "rbx"
gem 'json'
gem 'yajl-ruby'
- gem "nokogiri", ">= 1.4.0"
+ gem "nokogiri", ">= 1.4.2"
elsif RUBY_ENGINE == "jruby"
gem "ruby-debug"
gem "jruby-openssl"
end
# AS
-gem "memcache-client", ">= 1.7.5"
+gem "memcache-client", ">= 1.8.5"
# AM
gem "text-format", "~> 1.0.0"
# AR
if mri || RUBY_ENGINE == "rbx"
- gem "sqlite3-ruby", "~> 1.3.0", :require => 'sqlite3'
+ gem "sqlite3-ruby", "~> 1.3.1", :require => 'sqlite3'
group :db do
gem "pg", ">= 0.9.0"
@@ -47,8 +46,8 @@ elsif RUBY_ENGINE == "jruby"
end
if ENV['CI']
- gem "nokogiri", ">= 1.4.0"
+ gem "nokogiri", ">= 1.4.2"
# fcgi gem doesn't compile on 1.9
- gem "fcgi", ">= 0.8.7" if RUBY_VERSION < '1.9.0'
+ gem "fcgi", ">= 0.8.8" if RUBY_VERSION < '1.9.0'
end
@@ -20,5 +20,5 @@ Gem::Specification.new do |s|
s.has_rdoc = true
s.add_dependency('actionpack', version)
- s.add_dependency('mail', '~> 2.2.3')
+ s.add_dependency('mail', '~> 2.2.5')
end
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.add_dependency('i18n', '~> 0.4.1')
s.add_dependency('rack', '~> 1.2.1')
s.add_dependency('rack-test', '~> 0.5.4')
- #s.add_dependency('rack-mount', '~> 0.6.6')
- s.add_dependency('tzinfo', '~> 0.3.16')
+ s.add_dependency('rack-mount', '~> 0.6.9')
+ s.add_dependency('tzinfo', '~> 0.3.22')
s.add_dependency('erubis', '~> 2.6.6')
end
@@ -106,21 +106,21 @@ module ActionDispatch
# You can specify a regular expression to define a format for a parameter.
#
# controller 'geocode' do
- # match 'geocode/:postalcode' => :show', :constraints => {
+ # match 'geocode/:postalcode' => :show, :constraints => {
# :postalcode => /\d{5}(-\d{4})?/
# }
#
# Constraints can include the 'ignorecase' and 'extended syntax' regular
# expression modifiers:
#
# controller 'geocode' do
- # match 'geocode/:postalcode' => :show', :constraints => {
+ # match 'geocode/:postalcode' => :show, :constraints => {
# :postalcode => /hx\d\d\s\d[a-z]{2}/i
# }
# end
#
# controller 'geocode' do
- # match 'geocode/:postalcode' => :show', :constraints => {
+ # match 'geocode/:postalcode' => :show, :constraints => {
# :postalcode => /# Postcode format
# \d{5} #Prefix
# (-\d{4})? #Suffix
@@ -1,10 +1,8 @@
+require 'rack/mount'
require 'forwardable'
require 'active_support/core_ext/object/to_query'
require 'action_dispatch/routing/deprecated_mapper'
-$: << File.expand_path('../../vendor/rack-mount-0.6.6.pre', __FILE__)
-require 'rack/mount'
-
module ActionDispatch
module Routing
class RouteSet #:nodoc:
@@ -1,32 +0,0 @@
-require 'rack'
-
-module Rack #:nodoc:
- # A stackable dynamic tree based Rack router.
- #
- # Rack::Mount supports Rack's Cascade style of trying several routes until
- # it finds one that is not a 404. This allows multiple routes to be nested
- # or stacked on top of each other. Since the application endpoint can
- # trigger the router to continue matching, middleware can be used to add
- # arbitrary conditions to any route. This allows you to route based on
- # other request attributes, session information, or even data dynamically
- # pulled from a database.
- module Mount
- autoload :CodeGeneration, 'rack/mount/code_generation'
- autoload :GeneratableRegexp, 'rack/mount/generatable_regexp'
- autoload :Multimap, 'rack/mount/multimap'
- autoload :Prefix, 'rack/mount/prefix'
- autoload :RegexpWithNamedGroups, 'rack/mount/regexp_with_named_groups'
- autoload :Route, 'rack/mount/route'
- autoload :RouteSet, 'rack/mount/route_set'
- autoload :RoutingError, 'rack/mount/route_set'
- autoload :Strexp, 'rack/mount/strexp'
- autoload :Utils, 'rack/mount/utils'
- autoload :Version, 'rack/mount/version'
-
- module Analysis #:nodoc:
- autoload :Frequency, 'rack/mount/analysis/frequency'
- autoload :Histogram, 'rack/mount/analysis/histogram'
- autoload :Splitting, 'rack/mount/analysis/splitting'
- end
- end
-end
@@ -1,60 +0,0 @@
-require 'rack/mount/utils'
-
-module Rack::Mount
- module Analysis
- class Frequency #:nodoc:
- def initialize(*keys)
- clear
- keys.each { |key| self << key }
- end
-
- def clear
- @raw_keys = []
- @key_frequency = Analysis::Histogram.new
- self
- end
-
- def <<(key)
- raise ArgumentError unless key.is_a?(Hash)
- @raw_keys << key
- nil
- end
-
- def possible_keys
- @possible_keys ||= begin
- @raw_keys.map do |key|
- key.inject({}) { |requirements, (method, requirement)|
- process_key(requirements, method, requirement)
- requirements
- }
- end
- end
- end
-
- def process_key(requirements, method, requirement)
- if requirement.is_a?(Regexp)
- expression = Utils.parse_regexp(requirement)
-
- if expression.is_a?(Regin::Expression) && expression.anchored_to_line?
- expression = Regin::Expression.new(expression.reject { |e| e.is_a?(Regin::Anchor) })
- return requirements[method] = expression.to_s if expression.literal?
- end
- end
-
- requirements[method] = requirement
- end
-
- def report
- @report ||= begin
- possible_keys.each { |keys| keys.each_pair { |key, _| @key_frequency << key } }
- return [] if @key_frequency.count <= 1
- @key_frequency.keys_in_upper_quartile
- end
- end
-
- def expire!
- @possible_keys = @report = nil
- end
- end
- end
-end
@@ -1,74 +0,0 @@
-module Rack::Mount
- module Analysis
- class Histogram < Hash #:nodoc:
- attr_reader :count
-
- def initialize
- @count = 0
- super(0)
- expire_caches!
- end
-
- def <<(value)
- @count += 1
- self[value] += 1 if value
- expire_caches!
- self
- end
-
- def sorted_by_frequency
- sort_by { |_, value| value }.reverse!
- end
-
- def max
- @max ||= values.max || 0
- end
-
- def min
- @min ||= values.min || 0
- end
-
- def mean
- @mean ||= calculate_mean
- end
-
- def standard_deviation
- @standard_deviation ||= calculate_standard_deviation
- end
-
- def upper_quartile_limit
- @upper_quartile_limit ||= calculate_upper_quartile_limit
- end
-
- def keys_in_upper_quartile
- @keys_in_upper_quartile ||= compute_keys_in_upper_quartile
- end
-
- private
- def calculate_mean
- count / size
- end
-
- def calculate_variance
- values.inject(0) { |sum, e| sum + (e - mean) ** 2 } / count.to_f
- end
-
- def calculate_standard_deviation
- Math.sqrt(calculate_variance)
- end
-
- def calculate_upper_quartile_limit
- mean + standard_deviation
- end
-
- def compute_keys_in_upper_quartile
- sorted_by_frequency.select { |_, value| value >= upper_quartile_limit }.map! { |key, _| key }
- end
-
- def expire_caches!
- @max = @min = @mean = @standard_deviation = nil
- @keys_in_upper_quartile = nil
- end
- end
- end
-end
Oops, something went wrong.

0 comments on commit 0f99178

Please sign in to comment.