Commit Graph

489 Commits

Author SHA1 Message Date
Andrew White
c3f4d6c8fe Merge pull request #16161 from jpawlyn/master
Fix empty host for an asset url when asset_host proc returns nil
2014-07-15 09:32:01 +01:00
Jolyon Pawlyn
d005777469 Return an absolute instead of relative path from an asset url in the case of the asset_host proc returning nil 2014-07-15 08:32:55 +01:00
Santosh Wadghule
dfee0327b5 Fix typos like a html to an html and 'an mail' to 'an email'. [ci skip] 2014-07-14 00:14:47 +05:30
Matthew Draper
4248785262 Assert the nature of the original exception
Just so it's clearer what's going on in the following assertion.

/cc #11993 @robin850
2014-07-12 18:54:17 +09:30
Guillermo Iguaran
e454a3d994 Merge pull request #11993 from razielgn/actionview-use-name-to-inspect-error
Use NameError#name to assert raised error.
2014-07-11 16:41:19 -04:00
Godfrey Chan
00aae7cb38 Synced 4.2 release notes with the latest commits.
Also reordered some of the items to put newer ones on top (same order as
CHANGELOGs), which makes it easier to diff while we are still working on it.
2014-07-11 02:16:57 -07:00
Godfrey Chan
e22e1c0b28 Fixed borken tests in AV caused by 013c74d 2014-07-10 17:10:20 -07:00
Carlos Antonio da Silva
05fde24e1e Include missing module in tag_helper
Since 6857415187810f1289068a448268264d0cf0844f we are using #safe_join to
join the content when an Array is given, so we must include the dependent
module here to make sure it's available when this module is used alone.

This was making Simple Form tests to fail with current master due to the
missing dependency.
2014-07-09 18:47:35 -03:00
Zachary Scott
2f716694f2 Change back occurrences of SQLite(3) to sqlite3 when referring to the
adapter, fixed from #16057 [ci skip]
2014-07-06 11:47:16 -07:00
Akshay Vishnoi
ddad32978d [ci skip] /sqlite/i --> SQLite 2014-07-06 15:23:12 +05:30
Akshay Vishnoi
3ac3760c69 [ci skip] /javascript/ -> JavaScript - cover whole app 2014-07-04 03:00:09 +05:30
Godfrey Chan
f2fc31473f Add CHANGELOG for c803b90 2014-07-02 15:55:28 -07:00
John F. Douthat
41de23ec03 Fix escape_once double-escaping hex-encoded entities
(This is a manual merge of #9102)
2014-07-02 15:54:47 -07:00
Rafael Mendonça França
41a7c443a6 Add CHANGELOG entry for #15214
Closes #15214
2014-06-30 17:42:56 -03:00
Rafael Mendonça França
2546610920 Use if/else
Since we are using both branches of the code is preferable to use
if/else over the early return.
2014-06-30 17:41:50 -03:00
Todd Bealmear
ac44345da3 Add String support for min/max attributes on DatetimeField 2014-06-30 17:39:50 -03:00
Robin Dupret
9ca0f8da2a Tiny documentation fixes [ci skip] 2014-06-29 20:15:28 +02:00
Max Kramer
4e1dc11283 Rename options param of #time_ago_in_words to match API change
Rename `include_seconds_or_options` to `options` to match 6b9356a (which removed the deprecation introduced by #6077).  This has no functional impact because the parameter is passed directly through, but makes it clearer that the parameter no longer supports a boolean as input.
2014-06-28 14:30:16 -04:00
Gareth Rees
124f88eaa2 Deal with regex match groups in excerpt
Original implementation has bugs if the regex contains a match group.

Example:

    excerpt('This is a beautiful? morning', /\b(beau\w*)\b/i, :radius => 5)
    Expected: "...is a beautiful? mor..."
    Actual: "...is a beautifulbeaut..."

The original phrase was being converted to a regex and returning the text
either side of the phrase as expected:

    'This is a beautiful? morning'.split(/beautiful/i, 2)
    # => ["This is a ", "? morning"]

When we have a match with groups the match is returned in the array.

Quoting the ruby docs: "If pattern is a Regexp, str is divided where the
pattern matches. [...] If pattern contains groups, the respective matches will
be returned in the array as well."

    'This is a beautiful? morning'.split(/\b(beau\w*)\b/iu, 2)
    # => ["This is a ", "beautiful", "? morning"]

If we assume we want to split on the first match – this fix makes that
assumption – we can pass the already assigned `phrase` variable as the place
to split (because we already know that a match exists from line 168).

Originally spotted by Louise Crow (@crowbot) at
https://github.com/mysociety/alaveteli/pull/1557
2014-06-24 17:01:40 +01:00
Rafael Mendonça França
0e09875a67 Merge pull request #15732 from kuldeepaggarwal/correct-assets-ouput
[ci skip] correct output for asset_helper methods
2014-06-23 14:41:40 -03:00
Rafael Mendonça França
d4ca0a44c7 Merge pull request #15450 from aditya-kapoor/remove-nbsp-debug
remove unnecessary gsub for space in ActionView::Helpers#debug
2014-06-19 16:43:47 -03:00
Lucas Mazza
9f27e1076a 'TextHelper#highlight' now accepts a block to highlight the matched words.
The helper will yield each matched word, and you can use this instead of the
':highlighter' option for more complex replacing logic:

  highlight('My email is me@work.com', EMAIL_REGEXP) { |m| mail_to(m) }
  # => 'My email is <a href="mailto:me@work.com">me@work.com</a>'
2014-06-19 15:22:23 -03:00
Jan Szumiec
490f25034d highlight() now accepts regular expressions as well. 2014-06-19 14:53:18 -03:00
Jan Szumiec
2b617783ad excerpt() now accepts regular expression instances as phrases. 2014-06-19 14:44:59 -03:00
Yves Senn
dccf6da66b Merge pull request #15709 from zuhao/refactor_actionview_compiled_templates_test
Move cleanup into teardown, delete obsolete code.
2014-06-18 08:39:13 +02:00
Aditya Kapoor
7ddaf10fcb [ci skip] /javascript/ ~> JavaScript 2014-06-17 02:07:07 +05:30
Kuldeep Aggarwal
4db09e6f6c [ci skip] correct output for asset_helper methods
see cc255d3
2014-06-16 23:05:11 +05:30
Kuldeep Aggarwal
cffbceeb03 reload I18n as we are defining :ts locale
fix build- see https://travis-ci.org/rails/rails/jobs/27578159#L2913.
2014-06-15 01:11:13 +05:30
Yves Senn
64220a1de3 Merge pull request #15715 from zuhao/refactor_actionview_cleanup_I18n_translations
Clean up I18n stored translations after test.
2014-06-14 16:32:02 +02:00
Aditya Kapoor
c782641002 remove unnecessary substitution for space in ActionView::Helpers#debug 2014-06-14 15:22:09 +05:30
Yves Senn
534e1e1f53 Merge pull request #15712 from zuhao/refactor_actionview_javascript_helper_test
Avoid hard-coded value in test setup and teardown.
2014-06-14 11:09:33 +02:00
Zuhao Wan
48d118573d Clean up I18n stored translations after test. 2014-06-14 16:36:53 +08:00
Zuhao Wan
0da1c80a99 Avoid hard-coded value in test setup and teardown. 2014-06-14 16:12:44 +08:00
Zuhao Wan
0c58eb02ef Make sure restoration always happen. 2014-06-14 15:55:52 +08:00
Zuhao Wan
c085078442 Move cleanup into teardown, delete obsolete code. 2014-06-14 15:42:51 +08:00
Matthew Draper
c28e436aae Merge pull request #15693 from pdg137/enforce_utf8
In actionview, eliminate calls to tag that use html_safe parameter values.
2014-06-14 06:33:21 +09:30
Paul Grayson
19af434840 In actionview, eliminate calls to tag that use html_safe parameter values. This is generally unnecessary, since tag handles string quoting, except in one case (utf8_enforcer_tag) where we want to specify the encoding ourselves. 2014-06-13 12:55:55 -07:00
Zachary Scott
1ecc0106ae Builder source code is still available on github [ci skip]
This was also removed from #15542
2014-06-13 10:12:20 -07:00
Matthew Draper
6857415187 Merge pull request #15654 from pdg137/master
In tag helper, honor html_safe on arrays; also make safe_join more similar to Array.join
2014-06-13 08:52:44 +09:30
Paul Grayson
bcab3f20da In tag helper, honor html_safe on array parameters; also make safe_join more similar to Array.join by first calling flatten. 2014-06-12 15:30:40 -07:00
Yves Senn
8f247871bb Merge pull request #15590 from zuhao/refactor_actionview_register_template_handler
Add unregister_template_handler to prevent leaks.

Conflicts:
	actionview/CHANGELOG.md
2014-06-12 14:06:59 +02:00
Zuhao Wan
a1dbb4e7e0 Add unregister_template_handler to prevent leaks. 2014-06-12 18:49:40 +08:00
Aditya Kapoor
9505a21f42 [ci skip] Fix doc for javascript_helper 2014-06-11 01:29:17 +05:30
Akshay Vishnoi
294ddff512 [ci skip] Add Docs for strip_insignificant_zeros option in number helpers 2014-06-10 23:07:49 +05:30
Akshay Vishnoi
9bb0f1e08a [ci skip] Correct output and use valid options of number helpers 2014-06-10 22:16:13 +05:30
Jiri Pospisil
f62ec6cb2d Fix cache_digest rake tasks
Bring cache_digests:* rake tasks up-to-date with the API changes introduced in
637bb726cac60aaa1f7e482836458aa73e17fbb7
2014-06-10 13:52:36 +02:00
Arthur Nogueira Neves
a6c8cde835 Merge pull request #15542 from Gaurav2728/gaurav-remove_shutdown_link
remove rubyforge.org that was shut down [ci skip]
2014-06-06 19:50:54 -05:00
Matthew Draper
fadbc7c9ee Unwrap another html_escape
/cc @tenderlove
2014-06-07 10:13:00 +09:30
Aaron Patterson
17fc6f16eb eliminate more wasteful allocations 2014-06-06 15:29:03 -07:00
Gaurav Sharma
19ef270923 remove rubyforge.org that was shut down [ci skip] 2014-06-06 22:26:56 +05:30