aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* [ci skip] Fix docs and guide about 'Array.wrap'yui-knk2015-04-191-3/+4
|
* Fix typos and improve the documentationJon Atack2015-04-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a squash of the following commits, from first to last: - Fix minor, random things I’ve come across lately that individually did not seem worth making a PR for, so I saved them for one commit. One common error is using “it’s” (which is an abbreviation of “it is”) when the possessive “its” should be used for indicating possession. - Changes include the name of a test, so remove the `[skip ci]` (thanks @senny). - Line wrap the changes at 80 chars and add one more doc fix. - Add a missing line wrap in the Contributing to Ruby on Rails Guide. - Line wrap the `TIP` section in the Contributing to Ruby on Rails Guide as well. Rendering the guide locally with `bundle exec rake guides:generate` did not show any change in on-screen formatting after adding the line wrap. The HTML generated is (extra line added to illustrate where the line wrap takes place): <div class="info"><p>Please squash your commits into a single commit when appropriate. This simplifies future cherry picks and also keeps the git log clean.</p></div> - Squash commits.
* Use #prepend rather than using 2 aliasesYuki Nishijima2015-04-142-42/+36
|
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2015-04-141-1/+1
|\
| * [ci skip] Remove unnecessary `>`yui-knk2015-03-311-1/+1
| |
* | Speedup String#squishojab2015-04-121-2/+1
| |
* | Only coerce time when comparing if necessaryAaron Jensen2015-03-311-2/+4
| | | | | | | | | | | | In dev, ActiveSupport::FileUpdateChecker#max_mtime triggers many time comparisons. Time#to_time is quite a bit slower than not doing it, so we should avoid it if possible.
* | [ci skip] Replace `query methods` with `a predicate`yui-knk2015-03-311-1/+1
| |
* | Revert "Remove Array#inquiry"Rafael Mendonça França2015-03-302-0/+16
| | | | | | | | | | | | This reverts commit 9420de59f5b7f5ceac77e28e6c326ec145f71f80. Reason: Turns out we want to keep this method.
* | Remove circular requireRafael Mendonça França2015-03-272-4/+0
| |
* | Remove Array#inquiryRafael Mendonça França2015-03-272-16/+0
| | | | | | | | | | We are promoting too much a feature that will not be widler used. So for now lets keep just the ArrayInquirer constructor.
* | Merge pull request #18939 from georgeclaghorn/variant-inquiryRafael Mendonça França2015-03-272-0/+16
|\ \ | | | | | | | | | Provide friendlier access to request variants
| * | Add ActiveSupport::ArrayInquirer and Array#inquiryGeorge Claghorn2015-03-242-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its string-like contents. For example, `request.variant` returns an `ArrayInquirer` object. To check a request's variants, you can call: request.variant.phone? request.variant.any?(:phone, :tablet) ...instead of: request.variant.include?(:phone) request.variant.any? { |v| v.in?([:phone, :tablet]) } `Array#inquiry` is a shortcut for wrapping the receiving array in an `ArrayInquirer`: pets = [:cat, :dog] pets.cat? # => true pets.ferret? # => false pets.any?(:cat, :ferret} # => true
* | | Missing require 'active_support/deprecation'Akira Matsuda2015-03-272-0/+4
| |/ |/|
* | Merge branch 'master' of github.com:rails/docrailsVijay Dev2015-03-261-1/+1
|\ \ | |/ |/| | | | | Conflicts: guides/source/4_0_release_notes.md
| * [ci skip] Add space after erb block.yui-knk2015-03-121-1/+1
| |
* | Make sure Array#to_sentence always returns a StringDavid Cornu2015-03-231-1/+1
| |
* | Remove reference to Numeric#from_now, as it is no longer supportednerdinand2015-03-232-30/+0
| |
* | Deprecate alias_method_chain in favour of Module#prependKir Shatrov2015-03-223-8/+14
| | | | | | …as discussed #19413
* | Mark some constants as nodoc and remove unneeded namespaceRafael Mendonça França2015-03-202-12/+10
| |
* | Use Module#prepend instead of alias_method_chainKir Shatrov2015-03-202-20/+22
| | | | | | | | | | | | | | Thanks @fbernier for suggestion! <3 At this moment we can use Module#prepend in all all cases except of Range because of the bug [1] in MRI 2.2 [1] https://bugs.ruby-lang.org/issues/10847
* | Doc fixes [ci skip]Islam Wazery2015-03-074-4/+4
| |
* | Doc fix [ci skip]Islam Wazery2015-03-071-7/+7
| |
* | [ci skip] Update documentation for Time#seconds_since_midnightAnton Davydov2015-03-061-1/+5
| |
* | Some documentation edits [ci skip]Robin Dupret2015-03-051-3/+3
| | | | | | | | | | | | * Fix a few typos * Wrap some lines around 80 chars * Rephrase some statements
* | Move Array#without from Grouping to Access concern and add dedicated test ↵David Heinemeier Hansson2015-03-022-12/+12
| | | | | | | | (relates to #19157)
* | Use include? instead of in? for Enumerable#without.Juanito Fatas2015-03-021-1/+1
| | | | | | | | [egilburg]
* | Add Enumerable#withoutTodd Bealmear2015-03-012-0/+23
|/
* Merge pull request #19131 from ↵Yves Senn2015-02-281-1/+1
|\ | | | | | | | | tgxworld/reduce_allocated_memory_in_module_delegate Reduce allocated memory for Module#delegate.
| * Reduce allocated memory for Module#delegate.Guo Xiang Tan2015-03-011-1/+1
| |
* | [ci skip] Add code examples for Module#anonymous? documentationAnton Davydov2015-02-281-0/+7
| |
* | [ci skip] Update documentation for Range#to_formatted_sAnton Davydov2015-02-281-2/+17
|/
* [skip ci] Add documentation for String#is_utf8? methodAnton Davydov2015-02-281-0/+7
|
* Merge pull request #19121 from davydovanton/update-doc-for-removeYves Senn2015-02-281-2/+3
|\ | | | | | | Update documentation examples for String#remove [skip ci]
| * Update documentation examples for String#remove [skip ci]Anton Davydov2015-02-281-6/+7
|/
* Fix a backtracking problem in String#truncate_wordsHenrik Nygren2015-02-251-1/+1
| | | | Fixes #19070.
* s/around_filter/around_action/Akira Matsuda2015-02-211-1/+1
|
* Properly dump primitive-like AS::SafeBuffer strings as YAMLGodfrey Chan2015-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `coder.represent_scalar` means something along the lines of "Here is a quoted string, you can just add it to the output", which is not the case here. It only works for simple strings that can appear unquoted in YAML, but causes problems for e.g. primitive-like strings ("1", "true"). `coder.represent_object` on the other hand, means that "This is the Ruby-object representation for this thing suitable for use in YAML dumping", which is what we want here. Before: YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello" YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => true YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => false YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => 1 YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => 1.1 After: YAML.load ActiveSupport::SafeBuffer.new("Hello").to_yaml # => "Hello" YAML.load ActiveSupport::SafeBuffer.new("true").to_yaml # => "true" YAML.load ActiveSupport::SafeBuffer.new("false").to_yaml # => "false" YAML.load ActiveSupport::SafeBuffer.new("1").to_yaml # => "1" YAML.load ActiveSupport::SafeBuffer.new("1.1").to_yaml # => "1.1" If we ever want Ruby to behave more like PHP or JavaScript though, this is an excellent trick to use ;)
* Revert 88d08f2ec9f89ba431cba8d0c06ac9ebc204bbbbRafael Mendonça França2015-02-111-12/+24
| | | | | | | This caused a performance regression since we were decided to do the nil check in run time not in the load time. See https://github.com/rails/rails/pull/15187#issuecomment-71760058
* NameError#missing_name? can jsut use NameError#name if the arg is a SymbolYuki Nishijima2015-02-071-2/+1
| | | | | | NameError#name returns a missing name as a symbol, so if the given name is a symbol, it doesn't have to use #missing_name to get the last constant name in the error message.
* Merge pull request #14028 from uberllama/json_escape_commentsRafael Mendonça França2015-02-061-0/+5
|\ | | | | Amended json_escape comments
| * Amended json_escape comment to clarify that user-generated content must ↵Yuval Kordov2014-02-121-0/+5
| | | | | | | | still be html_escaped if being inserted ingot he DOM via JQuery's html() method.
* | Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | | | | | onwards.
* | Fix typo in Time#change docsJohn Duff2015-02-021-1/+1
| |
* | Return value of yielded block in File.atomic_writeIan Ker-Seymer2015-01-281-1/+4
| | | | | | | | | | | | Staying true to Ruby convention, we now return the value of the yielded block from `File.atomic_write {...}`. This mimics the behavior of MRI's `File.open {...}`.
* | Merge pull request #18450 from tonytonyjan/patch-1Rafael Mendonça França2015-01-191-0/+2
|\ \ | | | | | | fix dependency
| * | fix dependencyJian Weihang2015-01-121-0/+2
| | |
* | | A little performance improvement using 'take' method over 'first'Santosh Wadghule2015-01-161-1/+1
| | |
* | | No need of requiring `rbconfig`, it is by-default loadedKuldeep Aggarwal2015-01-101-1/+0
|/ /
* | Add missing requireGuillermo Iguaran2015-01-091-0/+2
| |