aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/xml_mini
Commit message (Collapse)AuthorAgeFilesLines
* Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-296-8/+8
| | | | | | | | | | | | | | | | | | | | | Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'
* Enable `Performance/UnfreezeString` copyuuji.yaginuma2018-09-236-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`. ```ruby # frozen_string_literal: true require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "benchmark-ips" end Benchmark.ips do |x| x.report('+@') { +"" } x.report('dup') { "".dup } x.compare! end ``` ``` $ ruby -v benchmark.rb ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] Warming up -------------------------------------- +@ 282.289k i/100ms dup 187.638k i/100ms Calculating ------------------------------------- +@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s Comparison: +@: 6775299.3 i/s dup: 3320400.7 i/s - 2.04x slower ```
* [Active Support] require_relative => requireAkira Matsuda2017-10-216-7/+7
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* Fix `can't modify frozen String` error in `XmlMini_JDOM`yuuji.yaginuma2017-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Without this, `XmlMini_JDOM` raises an error as follwing: ``` RuntimeError: can't modify frozen String org/jruby/RubyString.java:2264:in `concat' activesupport/lib/active_support/xml_mini/jdom.rb:177:in `block in empty_content?' org/jruby/RubyRange.java:485:in `each' activesupport/lib/active_support/xml_mini/jdom.rb:174:in `empty_content?' activesupport/lib/active_support/xml_mini/jdom.rb:86:in `collapse' activesupport/lib/active_support/xml_mini/jdom.rb:66:in `merge_element!' activesupport/lib/active_support/xml_mini/jdom.rb:84:in `block in collapse' org/jruby/RubyRange.java:485:in `each' activesupport/lib/active_support/xml_mini/jdom.rb:82:in `collapse' activesupport/lib/active_support/xml_mini/jdom.rb:66:in `merge_element!' activesupport/lib/active_support/xml_mini/jdom.rb:51:in `parse' activesupport/lib/active_support/xml_mini.rb:101:in `parse' ``` We already have tests about `XmlMini_JDOM`. But it is not running in CI. https://github.com/rails/rails/blob/master/activesupport/test/xml_mini/jdom_engine_test.rb
* Fix broken link for Java xml [ci skip]Yoshiyuki Hirano2017-08-241-1/+1
|
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-116-0/+6
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-096-0/+6
|
* Merge branch 'master' into require_relative_2017Xavier Noria2017-07-025-6/+6
|\
| * Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-026-6/+0
| | | | | | | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
| * Merge pull request #29540 from kirs/rubocop-frozen-stringMatthew Draper2017-07-026-0/+6
| |\ | | | | | | | | | Enforce frozen string in Rubocop
| | * Enforce frozen string in RubocopKir Shatrov2017-07-016-0/+6
| | |
| * | Make ActiveSupport frozen string literal friendly.Pat Allan2017-06-205-6/+6
| |/ | | | | | | | | | | | | The ActiveSupport test suite only passes currently if it uses the latest unreleased commits for dalli, and a patch for Builder: https://github.com/tenderlove/builder/pull/6 Beyond that, all external dependencies (at least, to the extent they’re used by ActiveSupport) are happy, including Nokogiri as of 1.8.0.
* / [Active Support] require => require_relativeAkira Matsuda2017-07-016-7/+7
|/
* Fixes Hash.from_xml with frozen strings for all backendsJosh Nussbaum2017-04-204-13/+4
|
* Avoid documenting private or external classesRobin Dupret2017-02-071-0/+2
| | | | | | | | | | | | | | | | There are a lot of monkey patches inside the code base but there's no need to document external constants so let's remove them from the documentation Also, since there are monkey patches for some test cases classes, there were sometimes both documented and sneaked under the wrong section in the sidebar. Finally, for future references, the `active_support/vendor` folder has been originally ignored in https://git.io/vDqfA but no longer exists. [ci skip]
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-052-2/+2
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-294-4/+4
|
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-40/+40
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Add three new rubocop rulesRafael Mendonça França2016-08-162-2/+2
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-064-15/+12
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-67/+67
|
* applies new string literal convention in activesupport/libXavier Noria2016-08-066-45/+45
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* systematic revision of =~ usage in ASXavier Noria2016-07-221-1/+1
| | | | | Where appropriate prefer the more concise Regexp#match?, String#include?, String#start_with?, and String#end_with?
* Fix Hash#from_xml with frozen strings (#24718)Marek Kirejczyk2016-05-211-3/+1
| | | | | | | | | * Hash#from_xml works with frozen strings Fixes #24647 * Fix rexml engine test [Marek Kirejczyk + Rafael Mendonça França]
* enforce a depth limit on XML documentsAaron Patterson2015-06-162-10/+12
| | | | | | | XML documents that are too deep can cause an stack overflow, which in turn will cause a potential DoS attack. CVE-2015-3227
* Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846robertomiranda2015-01-312-4/+4
| | | | ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
* fixed indent of end in jdom.rbbigtone12842014-11-281-1/+1
|
* change merge to merge! in AS on new hashesVipul A M2013-04-022-2/+2
|
* JDOM XXE Protection [CVE-2013-1856]Ben Murphy2013-03-151-0/+6
|
* update AS/values and AS/xml_mini docs [ci skip]Francesco Rodriguez2012-09-143-3/+3
|
* Clean up module docs [ci skip]Vijay Dev2012-03-076-8/+2
| | | | Removed some useless docstrings and no-doc'ed some.
* Replaced all 'for' loops with Enumerable#eachNathan Broadbent2012-01-301-4/+4
|
* Revert "Used any? instead of length call"Xavier Noria2011-11-282-2/+2
| | | | | | | | | Reason: This is slower, and any? is not equivalent in the general case. See discussion in https://github.com/rails/rails/pull/3779 This reverts commit 20cbf8eddc3844126d20f1218f068889d17b0dcf.
* Used any? instead of length callRahul P. Chaudhari2011-11-282-2/+2
|
* Adding __content__ into XmlMini_JDOMArun Agrawal2011-05-271-1/+8
|
* Using java_import instead of import. Need to do this with rake 0.9.0 #jrubyArun Agrawal2011-05-241-6/+6
|
* fixed a missing require that causes trouble when using AS in a non-rails env.Nick Sutterer2011-01-185-1/+6
|
* using a merge with a Hash[] rather than a loop to add SAX parsed attributesAaron Patterson2010-11-161-2/+1
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* AS gem doesn't depend on nokogiri so shows a nicer error if users haven't ↵Santiago Pastorino2010-07-302-3/+13
| | | | installed
* Change returning with tapSantiago Pastorino2010-07-251-1/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* edit pass: the names of Rails components have a space, ie, "Active Record", ↵Xavier Noria2010-06-141-1/+1
| | | | not "ActiveRecord"
* Provide a better error if the parsed REXML document has no root [#3803 ↵wycats2010-03-281-1/+7
| | | | state:resolved]
* adds missing requires for Object#blank? and Object#present?Xavier Noria2010-03-282-0/+2
|
* nokogiri.rb needs active_support/core_ext/object/blankXavier Noria2010-01-011-0/+1
|
* libxml.rb needs active_support/core_ext/object/blankXavier Noria2010-01-011-0/+1
|
* jdom.rb needs active_support/core_ext/object/blankXavier Noria2010-01-011-0/+2
|
* make sure returning is available for the libxml extensionXavier Noria2010-01-011-0/+1
|
* Fixed some bugs and fixed some tests in new SAX-based XmlMini backends.Willem van Bergen2010-01-012-8/+8
| | | | | | [#3636 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Added SAX-based parser for XmlMini, using LibXMLWillem van Bergen2010-01-011-0/+84
| | | | Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>