| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| | |
mubashirhanif/add_keep_id_suffix_option_to_humanize_new
Add keep id suffix option to humanize new
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
some documentation
remove extra whitespace.
Added id in the middle test case and corrected some testcases.
Some Coding standard guidelines corrections as suggested by codeclimate.
Some more corrections suggested by codeclimate.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 4b685aa the regex in `titlelize` was updated to not match
apostrophes to better reflect the nature of the transformation.
Unfortunately this had the side effect of breaking capitalization
on the first word of a sub-string, e.g:
>> "This was 'fake news'".titleize
=> "This Was 'fake News'"
This is fixed by extending the look-behind to also check for a
word character on the other side of the apostrophe.
Fixes #28312.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|\
| |
| |
| | |
Fixes Inflector#titleize to work with SafeBuffer
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The way Inflector#titleize was implemented did not work properly when
called on a SafeBuffer object. Using the global `$&` variable in the
gsub resulted in calling capitalize on a nil object for reasons I still
do not fully understand. Removing the UNSAFE_STRING_METHODS override for
the gsub method in SafeBuffer "fixed" the bug but is obviously
unacceptable.
An example of this is very easy to see in rails console:
ActiveSupport::SafeBuffer.new("my test").titleize
> NoMethodError: undefined method `capitalize' for nil:NilClass
Using the non global version of gsub with a |match| arg passed to the
block fixes the problem. Again I do not quite understand why. I noticed
that other parts of Inflector were already using the standard block arg
version of gsub so I don't think it should be a problem to convert this
method to using it as well.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added test cases
Using kwargs instead of three seperate functions
Updated parameterize in transliterate.rb
Updated parameterize in transliterate.rb
Added deprecation warnings and updating RDoc+Guide
Misspelled separtor. Fixed.
Deprecated test cases and added support to parameterize with keyword parameters
Squashing commits.
Fixed test cases and added deprecated test cases
Small changes to Gemfile.lock and CHANGELOG
Update Gemfile.lock
|
|/ |
|
|
|
|
| |
onwards.
|
|
|
|
|
|
| |
Fixes #8015, #9756.
[Fred Wu & Matthew Draper]
|
|
|
|
|
|
|
|
|
|
| |
* Strips leading underscores.
* Changes some unnecessary gsub!s to sub!s.
* Replaces some anchors ^, $ with \A, \z.
* Documents that human inflection rules are applied.
* Documents that words are downcased except acronyms.
* Adds an example with an acronym.
* Rewords docs.
|
|
|
|
|
|
| |
The 'cow' => 'kine' inflection has gone with c300dca9 but it should
not be removed from the tested irregularities since it ensures that
inflections work with words that do not begin with the same letters.
|
| |
|
|
|
|
|
|
|
| |
So strings can be humanized without being capitalized:
'employee_salary'.humanize # => "Employee salary"
'employee_salary'.humanize(capitalize: false) # => "employee salary"
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a follow up to #4719. It appears that singularize and pluralize
are supposed to be idempotent - i.e. when you call singularize or
pluralize multiple times on the same string, you should get the same
result. (At least for the "officially supported" cases that the stock
inflector is designed to handle.) #4719 added the missing tests for
regular cases, and this commit added the missing tests for the
irregularities.
While I'm at that, I also synced up the irregularity test cases with
the current set of irregularity cases that we ship out-of-the-box.
|
|
|
|
| |
converted to my_analyasis(in singular form).
|
|\
| |
| | |
fix inflector bug where -ice gets singularized into -ouse
|
| |
| |
| |
| | |
This should happen for mouse or louse, but not slice or pumice.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The regexp used in titleize matches saxon genitive
and other contractions, only to call capitalize on
the captured text and have the apostrophe upcased
which yields the apostrophe itself. It is more
clear that the regexp matches just what it has to
match.
|
|/ |
|
|
|
|
| |
regression uncovered
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
change.
|
| |
|
|
|
|
|
|
|
| |
Applied patch by Amir Manji
https://github.com/rails/rails/issues/437#issuecomment-1116045
Signed-off-by: Jason <jasonmichaelroth@gmail.com>
|
|
|
|
|
|
| |
[#6363]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
|
|
|
|
| |
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
|
|
|
| |
state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
|
|
|
|
| |
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
| |
|
|
|
|
|
|
|
|
| |
a + sign is interpreted by the browser as a space, possibly resulting in a "ArgumentError: illegal character in key"
[#4080 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
|
|
|
| |
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
|
|
|
|
| |
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
|
|
|
|
|
|
| |
defaults, but this seems to obvious) [#1942 state:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
(http://github.com/henrik/slugalizer)
Handles trailing and leading slashes, and squashes repeated separators into a single character.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1034 state:committed]
|
| |
|
|
|
|
| |
Knuth".parameterize => "donald-e-knuth") #713 [Matt Darby]
|
|
|
|
| |
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8533 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|
|
can use them.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7655 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
|