aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Just check if the buffer exists before changing itRafael Mendonça França2014-12-291-1/+3
| | |
* | | When trying to access a character on a string buffer object via `:[]`, if ↵Vipul A M2014-12-291-1/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the object being accessed currently returns `html_safe?` as true, we used to set `@html_safe` variable as true on new object created. When doing something like x = 'Hello'.html_safe x[/a/, 1] would throw an error on ruby 2.2, since when nothign gets matched nil is returned by the code and it tries to set `@html_safe` value to true, which would error since starting 2.2 nil is frozen. This change adds a safety net to avoid setting `@html_safe = true` on frozen objects. Fixes #18235
* | Add docs for Numeric time-related methodsclaudiob2014-12-171-0/+18
| | | | | | | | | | | | | | Add docs for `minutes`, `hours`, `days`, `weeks` and `fortnights`. Fix docs for `in_milliseconds`. [ci skip]
* | Replace `#=>` with `# =>` [ci skip]claudiob2014-12-176-21/+21
| | | | | | | | | | | | | | | | @rafaelfranca suggested in f7c7bcd9 that code examples should display the result after `# =>` and not after `#=>`. This commit replaces *all* the occurrences of `#=>` in the code documentation (mostly added by me :sob:) with the suggested `# =>`.
* | Add docs for Numeric#*_bytes methodsclaudiob2014-12-171-0/+20
| | | | | | | | | | | | | | Add docs for `kilobytes`, `megabytes`, `gigabytes`, `terabytes`, `petabytes` and `exabytes`. Fix docs for `bytes`. [ci skip]
* | Add docs for Time#find_zoneclaudiob2014-12-171-1/+16
| | | | | | | | | | | | Also improves docs for `Time#find_zone!` [ci skip]
* | Merge branch 'master' of github.com:rails/docrailsVijay Dev2014-12-151-1/+5
|\ \
| * | Better doc for AS::DateTime#seconds_since_midnightclaudiob2014-12-041-1/+5
| | | | | | | | | | | | | | | Adds examples and keeps coherent with the documentation of the similar method `seconds_until_end_of_day`. [ci skip]
* | | English fix [ci skip]George Millo2014-12-121-1/+1
|/ /
* | Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-295-8/+8
| |
* | Prevent Numeric#to_s from allocating an arrayJean Boussier2014-11-282-16/+25
| |
* | Document `String#html_safe` [ci skip]Sean Griffin2014-11-241-0/+5
| | | | | | | | | | | | It should be part of the documented public API, since we have an entire section of the guides dedicated to it. Documented in a way that addresses the concerns which kept it undocumented in the past.
* | Time includes DateAndTime::Zones acts_like(:time)betesh2014-11-091-0/+1
| |
* | added example of hash#except, and removed extra whitespaces [ci skip]Rishi Jain2014-11-072-5/+11
| |
* | added example of squish!, remove, test case for multiple occurrence ofRishi Jain2014-11-061-0/+9
| | | | | | | | | | | | | | | | pattern removal added example for string#remove and test case for remove of multiple occurence of pattern removed extra whitespaces
* | fix typo [ci skip]Vijay Dev2014-11-041-1/+1
| |
* | fixed typo [ci skip]Rishi Jain2014-11-041-1/+1
| |
* | added example for hash slice method [ci skip]Rishi Jain2014-11-041-2/+8
| |
* | Merge pull request #17383 from rwz/string-removeRafael Mendonça França2014-11-031-6/+10
|\ \ | | | | | | | | | | | | | | | | | | Make `String#remove` and `String#remove!` accept multiple arguments Conflicts: activesupport/CHANGELOG.md
| * | Make `String#remove` and `String#remove!` accept multiple argumentsPavel Pravosud2014-10-251-6/+10
| | |
* | | edit pass over all warningsXavier Noria2014-10-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch uniformizes warning messages. I used the most common style already present in the code base: * Capitalize the first word. * End the message with a full stop. * "Rails 5" instead of "Rails 5.0". * Backticks for method names and inline code. Also, converted a few long strings into the new heredoc convention.
* | | instance_eval is evilAkira Matsuda2014-10-251-1/+1
| | |
* | | Avoid creating range objects (take II)Akira Matsuda2014-10-251-1/+5
| | |
* | | Revert a change made to the example in 1ac4525Godfrey Chan2014-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | @carlosantoniodasilva pointed out that when `@person` is nil then this would blow up when you ended up calling `#first`on `nil`. > "there’s no way to break a try chain when you enter it :D" [ci skip]
* | | Include return value in examples added in #17378 [ci skip]Zachary Scott2014-10-241-2/+2
| | |
* | | Improved try documentation [ci skip]Eugene Gilburg2014-10-241-8/+25
|/ / | | | | | | | | | | | | | | | | | | - better `if` example - Added chaining example to the try method description - Documented the `respond_to?` check to the try method description - Clearer wording to explain that argument error is raised on argument mismatch to responding method, rather than to non-responding method (which is handled without exception by `try`) - `.any?` is more precise than `! .blank?` - Don't need to use `try` on `children` as (for regular associations) they will always be a collection or array that responds to `first` - Fix typos/grammar
* | DRY up try/try!Ari Pollak2014-10-231-10/+6
| |
* | Bring try! into parity with try.Ari Pollak2014-10-221-1/+1
| | | | | | | | Based on commit 5e51bdda.
* | [ci skip] Add Doc of with_options for the case when inherited default ↵Pramod Sharma2014-10-181-1/+15
| | | | | | | | options and original options have same keys
* | atomic_write rescue also Errno::EACCESRoberto Zanon2014-10-101-1/+1
| | | | | | atomic_write rescue also Errno::EACCES on changing file permission. It could be raised with some type of filesystem
* | doc added for `writer` method in `alias_method_chain`[ci skip]Kuldeep Aggarwal2014-10-041-2/+2
| |
* | Delegation works with reserved words passed to `:to`Agis-2014-09-191-1/+9
| | | | | | | | Fixes #16956.
* | [ci skip] ActiveSupport CHANGELOG fixesAkshay Vishnoi2014-09-181-0/+1
| | | | | | | | | | | | | | 1. spacing issues 2. spelling correction 3. grammar correction 4. Add missing docs
* | As of Unicode 6.3, Mongolian Vowel Separator is not whitespaceMatthew Draper2014-09-151-1/+1
| | | | | | | | | | Ruby 2.2 knows this, and no longer matches it with [[:space:]], so it's not a good candidate for testing String#squish.
* | Time#change can now change nanoseconds (:nsec)Agis-2014-09-141-6/+13
| | | | | | | | Closes #16392.
* | Time#change throws exception with an out-of-range :usecAgis-2014-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | https://github.com/rails/rails/commit/98b46bf5e201307cae56ee14bf41363a539779c5 did not properly handled out-of-range `:usec`s. Passing a `:usec` that's out of range now throws an `ArgumentError` as it should. Fixes #16759.
* | Methods are not duplicable.Peter Jaros2014-09-031-0/+10
| |
* | We tenderized the wrong method! Object#try already had the yield option, ↵David Heinemeier Hansson2014-08-292-15/+12
| | | | | | | | just needed some tenderloving instance_eval to fit the bill
* | Use instance_eval on @tenderlove's suggestion :trollface:David Heinemeier Hansson2014-08-291-4/+5
| |
* | Update examples to show real worthDavid Heinemeier Hansson2014-08-291-1/+1
| |
* | Added yield to Object#presenceDavid Heinemeier Hansson2014-08-291-1/+12
| |
* | Add documentation intro to example for `Object#itself`.Zachary Scott2014-08-191-2/+5
| | | | | | | | | | Also moved comment for removal above `unless()` to not confuse RDoc with the documentation for this method.
* | Fix DateTime comparison with DateTime::Infinity objectRafael Mendonça França2014-08-061-1/+3
| | | | | | | | Fixes #16406
* | Fix AS docs / changelog with wrong method [ci skip]Carlos Antonio da Silva2014-08-051-1/+1
| |
* | Update itself.rb [ci skip]Jon Atack2014-08-051-1/+1
| |
* | Only define Objetc#itself when it is not definedRafael Mendonça França2014-08-041-8/+10
| | | | | | | | | | | | | | Ruby 2.2 will include Kernel#itself so we don't need to define again. See https://github.com/ruby/ruby/commit/0a0160d6b659f6131a525fe1579e7c463d4c197e
* | Rename Object#self to Object#itself to have parity with matz sanctioned ↵David Heinemeier Hansson2014-08-012-3/+3
| | | | | | | | method name for Ruby 2.2
* | Added Object#self which returns the object itselfDavid Heinemeier Hansson2014-08-012-0/+11
| |
* | Raise a descriptive error if non-positive integer passed to in_groups_of.Xavier Shay2014-07-301-0/+5
| | | | | | | | | | | | | | | | | | | | This is more consistent than the current behaviour of raising a `ZeroDivisionError: divided by 0` error when 0 is given, which can be non-obvious especially if `in_groups_of` is part of a longer chain of methods. The negative case was ok - "ArgumentError: invalid slice size" - but this error is clearer still.
* | Add implicit receiver support to `Object#with_options`Pavel Pravosud2014-07-291-2/+15
| |