- 07 5月, 2020 2 次提交
-
-
由 Jonathan Hefner 提交于
Follow-up to #39147 and #39168. By adding a new purpose-specific format, we avoid potential pitfalls from concatenating format strings. We also save a String allocation per Time attribute per inspect. The new format also includes a time zone offset for more introspective inspection.
-
由 Adam Hess 提交于
DATE_FORMATS can be either a format string or a lambda we don't want to attempt to concat them with a string if we are in the lambda case
-
- 05 5月, 2020 1 次提交
-
-
由 akinomaeni 提交于
before ``` p Knot.create => #<Knot id: 1, created_at: "2016-05-05 01:29:47"> ``` after ``` p Knot.create => #<Knot id: 1, created_at: "2016-05-05 01:29:47.116928000"> ```
-
- 21 9月, 2019 1 次提交
-
-
由 Nobuyoshi Nakada 提交于
Since ruby/ruby@5208c431be, `Time#inspect` is separated from `Time#to_s`, and the former may contain the fraction part now.
-
- 06 11月, 2018 1 次提交
-
-
由 Eugene Kenny 提交于
The `read_attribute` method always returns the primary key when asked to read the `id` attribute, even if the primary key isn't named `id`, and even if another attribute named `id` exists. For the `inspect`, `attribute_for_inspect` and `pretty_print` methods, this behaviour is undesirable, as they're used to examine the internal state of the record. By using `_read_attribute` instead, we'll get the real value of the `id` attribute.
-
- 23 9月, 2018 1 次提交
-
-
由 yuuji.yaginuma 提交于
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 ```
-
- 17 2月, 2018 1 次提交
-
-
由 Rafael Mendonça França 提交于
Some places we can't remove because Ruby still don't have a method equivalent to strip_heredoc to be called in an already existent string.
-
- 20 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 20 6月, 2017 1 次提交
-
-
由 Pat Allan 提交于
-
- 07 8月, 2016 2 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 13 1月, 2015 1 次提交
-
-
由 Ethan 提交于
-
- 29 5月, 2014 1 次提交
-
-
由 Ethan 提交于
-
- 22 5月, 2013 1 次提交
-
-
由 Takehiro Adachi 提交于
The methods got moved to core.rb in commit b2c9ce34, but the tests never did.
-