aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
Commit message (Collapse)AuthorAgeFilesLines
* Move Integer#positive? and Integer#negative? query methods to Numeric classMehmet Emin İNAÇ2015-05-133-2/+2
| | | | By this way Integer, Rational, Float, Fixnum, Bignum classes have the same behaviour
* Minor comment fix. [ci skip]Zoltan Kiss2015-05-131-4/+4
|
* Add Integer#positive? and Integer#negative? query methods in the vein of ↵David Heinemeier Hansson2015-05-132-0/+20
| | | | Fixnum#zero?
* Merge pull request #20049 from iamvery/patch-1Yves Senn2015-05-071-1/+13
|\ | | | | | | Amend `next_week` documentation [ci skip]
| * Add examples of Date and Time `next_week` usageJay Hayes2015-05-071-0/+7
|/ | | | [skip ci]
* deep_dup method, remove old key from duplicated hash to avoid unnecessary pairsMehmet Emin İNAÇ2015-05-041-0/+1
|
* Clearify that alias_method_chain is deprecatedPrem Sichanugrist2015-04-221-0/+3
| | | | | This was not clear on the API documentation that the method was deprecated in a982a42d766169c2170d7f100c2a5ceb5430efb1.
* Merge pull request #19814 from y-yagi/array_inquiryRafael Mendonça França2015-04-191-0/+2
|\ | | | | add missing require for ArrayInquirer
| * add missing require for ArrayInquireryuuji.yaginuma2015-04-191-0/+2
| |
* | Merge pull request #19799 from yui-knk/fix/wrap_doc2Arthur Nogueira Neves2015-04-191-3/+4
|\ \ | |/ |/| [ci skip] Fix docs and guide about 'Array.wrap'
| * [ci skip] Fix docs and guide about 'Array.wrap'yui-knk2015-04-191-3/+4
| |
* | [ci skip] Replace `list` with `array`yui-knk2015-04-181-1/+1
|/
* 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