Commit Graph

9326 Commits

Author SHA1 Message Date
Timm
5f756e3ebe Added a proper substitution context class. Changed ArgumentFilter to be a selector. It is now called HTMLSelector. 2014-06-16 21:03:55 +02:00
Timm
8d6c92cecc Fixed nested assert_select bug. Trying to create a full document for a nested call that already had a document. 2014-06-16 21:03:55 +02:00
Timm
1e4f1ab95e Added implementation for substitution values via Nokogiri's custom pseudo classes. 2014-06-16 21:03:55 +02:00
Timm
9eada2daf8 Readded some documentation about substitution values. 2014-06-16 21:03:55 +02:00
Timm
bc1363eb56 Updated documentation to remove mention of HTML::Selector and clarify what is expected of a selector now. 2014-06-15 23:41:07 +02:00
Timm
63fc9f1f4f Readded html_document method since it is used integration tests. 2014-06-15 23:41:07 +02:00
Timm
6aea3bc149 Changed filter_matches to return a new NodeSet instead of Array. 2014-06-15 23:41:07 +02:00
Timm
11fc26b96f Initialized @css_selector_is_second_argument in determine_root_from. 2014-06-15 23:41:00 +02:00
Timm
9893a2896b Changed early return for filter_matches as well as reassigning matches. Meddled with initialize in ArgumentFilter. 2014-06-15 23:40:59 +02:00
Timm
7ef141a7fc Removed redundant comments from assert_select.
Cleaned up a comment.
2014-06-15 23:40:59 +02:00
Timm
332ccb35a1 Added assert_size_match! with the assertions for assert_select. 2014-06-15 23:40:59 +02:00
Timm
95afa79439 Changed some documentation for css_select. 2014-06-15 23:40:59 +02:00
Timm
b4258f8dfa Replaced fragment calls with document, since we assume the responses are complete documents. 2014-06-15 23:40:58 +02:00
Timm
ff0939a8f4 Added filter_matches to reduce line count in assert_select. 2014-06-15 23:40:58 +02:00
Timm
63938f670b Renamed Selector to ArgumentFilter. Put code from HTMLSelector to ArgumentFilter. 2014-06-15 23:40:58 +02:00
Timm
744cba7b21 Removed the custom selected proc. It's no longer needed. 2014-06-15 23:40:58 +02:00
Timm
afa4caf2bd Updated selector to not have reponse_from_page. 2014-06-15 23:40:57 +02:00
Timm
205bfe9af8 Changed css_select and pulled out response_from_page from Selector. 2014-06-15 23:40:57 +02:00
Timm
0538d26c15 Changed comparison from HTML::Node to Nokogiri::XML::Node in assert_select_encoded. 2014-06-15 23:40:57 +02:00
Timm
3b942d36bc Removed more redundant lines. Removed fix_content block that circumvented a bug in html-scanner. 2014-06-15 23:40:57 +02:00
Timm
6fa3af8876 Removed more lines of code in assert_select. 2014-06-15 23:40:57 +02:00
Timm
cb215c9f7d Simplified the first delete_if loop in assert_select to use Loofah's text method. 2014-06-15 23:40:56 +02:00
Timm
328512ea5f Removed argument and root variable in assert_select proc. 2014-06-15 23:40:56 +02:00
Timm
a38c759819 Changed name to selector. And a bunch of other things. 2014-06-15 23:40:56 +02:00
Timm
8c0536c997 The first attempt at abstracting argument parsing from selection methods. 2014-06-15 23:40:56 +02:00
Timm
2ff60e8648 Removed tag.rb since it has been deprecated. 2014-06-15 23:40:55 +02:00
Timm
8f5547f489 Corrected documentation bug. 2014-06-15 23:40:55 +02:00
Timm
c94e24fbe7 Added Loofah as a dependency in actionview.gemspec.
Implemented ActionView: FullSanitizer, LinkSanitizer and WhiteListSanitizer in sanitizers.rb.
Deprecated protocol_separator and bad_tags.
Added new tests in sanitizers_test.rb and reimplemented assert_dom_equal with Loofah.
2014-06-11 17:53:28 +02:00
Matthew Draper
6a89850dfe Handle client disconnect during live streaming
.. even when the producer is blocked for a write.
2014-06-08 07:21:14 +09:30
Xavier Noria
f84d081faf adds some details to the rationale of converted_arrays [ci skip] 2014-06-07 13:30:03 +02:00
Xavier Noria
1ecada20d1 Revert "Convert StrongParameters cache to a hash. This fixes an unbounded"
We cannot cache keys because arrays are mutable. We rather want to cache
the arrays. This behaviour is tailor-made for the usage pattern strongs
params is designed for.

In a forthcoming commit I am going to add a test that covers why we need
to cache by value.

Every strong params instance has a live span of a request, the cache goes
away with the object. Since strong params have such a concrete intention,
it would be interesting to see if there are actually any real-world use
cases that are an actual leak, one that practically may matter.

I am not convinced that the theoretical leak has any practical consequences,
but if it can be shown there are, then I believe we should either get rid of
the cache (which is an optimization), or else wipe it in the mutating API.

This reverts commit e63be2769c039e4e9ada523a8497ce3206cc8a9b.
2014-06-07 13:19:16 +02:00
Akshay Vishnoi
b6760d8f14 [ci skip] Fix capitalization 2014-06-07 14:23:27 +05:30
Aaron Patterson
092f74080c remove another wasteful AS::SafeBuffer allocation 2014-06-06 12:06:58 -07:00
Aaron Patterson
e9f215d9f2 eliminate wasteful AS::SafeBuffer allocation 2014-06-06 12:06:04 -07:00
Nathaniel Bibler
e7b0947afd Use a frozen Set instance for CGI_VARIABLES.
Also expand the CGI_VARIABLE name listing to multiple lines for cleaner diffs and legibility.
2014-06-05 22:05:02 -04:00
Corey Ward
a076b8cde9 Avoid misuse of underscore argument
Per convention, underscore-only argument names should be used for unused parameters.
2014-06-05 14:17:11 -05:00
Aaron Patterson
1ce0cc0d38 Merge branch 'master' of github.com:rails/rails
* 'master' of github.com:rails/rails:
  For our build, stick with mail 2.5.x for now
  Correct result, previously showing wrong result
  Collapse PG default extractoin of most types to single regex
  Change wording of explanation about precision & scale of decimal numbers [ci skip]
  Cleaned up duplicated CHANGELOG entry [ci skip]
  reuse available belongs_to? method
  Convert StrongParameters cache to a hash. This fixes an unbounded memory leak demonstrated on @tenderlove's latest blog post:
  Partially revert deprecation of *_filter
  Pluralize params
  Add default_i18n_subject to the guides
  Fix regression on eager loading association based on SQL query rather than existing column.
  Relax mail gem constraint from ~> 2.5.4 to ~> 2.5, >= 2.5.4
  Keep column defaults in type cast form
  Return a null column when no column exists for an attribute
  Refactor XML serializer to not depend on `serialized_attributes`
  Test the serialized types of virtual columns in XML
  implement ActiveRecord::Base#pretty_print + changelog
  Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
2014-06-04 11:45:53 -07:00
Guillermo Iguaran
4818bb36ac Merge pull request #15498 from zenspider/fix_memory_leak
Convert StrongParameters cache to a hash. This fixes an unbounded memory leak
2014-06-03 21:48:17 -05:00
Ryan Davis
e63be2769c Convert StrongParameters cache to a hash. This fixes an unbounded
memory leak demonstrated on @tenderlove's latest blog post:

http://tenderlovemaking.com/2014/06/02/yagni-methods-are-killing-me.html
2014-06-03 16:57:22 -07:00
Aaron Patterson
3f7e482aed push splitting "to" up the callstack 2014-06-03 16:23:39 -07:00
Rafael Mendonça França
489a8f2a44 Partially revert deprecation of *_filter
We are going to deprecate only on Rails 5 to make easier plugin
maintainers support different Rails versions. Right now we are only
discouraging their usage.

This reverts commit 6c5f43bab8206747a8591435b2aa0ff7051ad3de.

Conflicts:
	actionpack/CHANGELOG.md
2014-06-03 19:53:28 -03:00
Rafael Mendonça França
18d19bf2a4 Merge pull request #15349 from tgxworld/remove_duplicated_method_call
Remove duplicated HashWithIndifferentAccess#with_indifferent_access.
2014-06-03 19:10:33 -03:00
Aaron Patterson
cc26b6b7bc Routes specifying 'to:' must be a string that contains a "#" or a rack
application.  Use of a symbol should be replaced with `action: symbol`.
Use of a string without a "#" should be replaced with `controller: string`.
2014-06-03 14:05:42 -07:00
Aaron Patterson
af1c8665cd push some options munging to an alternate constructor 2014-06-03 11:33:54 -07:00
Aaron Patterson
522038aa9d move options_constraints tests next to each other 2014-06-03 11:33:53 -07:00
Aaron Patterson
5029c371fe only do is_a checks on formatted once 2014-06-03 11:33:53 -07:00
Aaron Patterson
10c1787b30 push options_constraints processing up
this lets us reduce is_a checks on the options_constraints and push
"callable constraints" verification to the right place.
2014-06-03 11:33:53 -07:00
Aaron Patterson
eaaf8995b1 remove options as an ivar 2014-06-03 11:33:53 -07:00
Aaron Patterson
981029b3ff only do Regexp === option once 2014-06-03 11:33:53 -07:00
Aaron Patterson
404feeb2e4 return early from add_request_method 2014-06-03 11:33:53 -07:00