| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| |
| | |
Update documentation examples for String#remove [skip ci]
|
|/ |
|
|
|
|
| |
Fixes #19070.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`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 ;)
|
|
|
|
|
|
|
| |
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#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.
|
|\
| |
| | |
Amended json_escape comments
|
| |
| |
| |
| | |
still be html_escaped if being inserted ingot he DOM via JQuery's html() method.
|
| |
| |
| |
| | |
onwards.
|
| | |
|
| |
| |
| |
| |
| |
| | |
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 {...}`.
|
|\ \
| | |
| | | |
fix dependency
|
| | | |
|
| | | |
|
|/ / |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
The build has failed when running the date/time ext tests in isolation
due to the missing extension, so better than adding a require is using
just Ruby in this case.
https://travis-ci.org/rails/rails/jobs/46107954#L1077
|
| |
| |
| |
| | |
Date, Time, and DateTime
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
and DateTime
`#on_weekend?` returns true if the receiving date/time falls on a Saturday or
Sunday.
`#next_weekday` returns a new date/time representing the next day that does
not fall on a Saturday or Sunday.
`#prev_weekday` returns a new date/time representing the previous day that
does not fall on a Saturday or Sunday.
|
| |
| |
| |
| | |
skip]
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
bebugger doesn't work with Ruby 2.2 so we don't need to support it
anymore
|
| |
| |
| |
| |
| | |
Now that Rails requires Ruby >= 2.0, there is no need to check whether
`BigDecimal` exists or not.
|
| |
| |
| |
| |
| | |
Conflicts:
activerecord/lib/active_record/attribute_methods/read.rb
|
| | |
|
| |
| |
| |
| | |
`silence_stderr`, `silence_stream`, `capture` and `quietly`.
|
| | |
|
| | |
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Add examples for missing_name, missing_name?
[ci skip]
|
| | |
| | |
| | |
| | |
| | |
| | | |
Also add doc examples for `Object.nil`.
[ci skip]
|
| | |
| | |
| | |
| | |
| | | |
`MissingSourceFile` was just an alias to `LoadError` and was not
being raised inside the framework.
|
| | |
| | |
| | |
| | | |
They are already present on Ruby 2.2
|
| | |
| | |
| | |
| | |
| | | |
This constant may be define for auxiliar gems like rails-html-sanitizer
and these methods call will fail.
|
| | | |
|
| | | |
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 `minutes`, `hours`, `days`, `weeks` and `fortnights`.
Fix docs for `in_milliseconds`.
[ci skip]
|
| |
| |
| |
| |
| |
| |
| |
| | |
@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 `kilobytes`, `megabytes`, `gigabytes`, `terabytes`,
`petabytes` and `exabytes`. Fix docs for `bytes`.
[ci skip]
|
| |
| |
| |
| |
| |
| | |
Also improves docs for `Time#find_zone!`
[ci skip]
|