aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/sprockets
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #8756 from causes/js_include_tag_fixGuillermo Iguaran2013-01-101-9/+16
|\ | | | | Fix javascript_include_tag when no js runtime is available
| * Fix javascript_include_tag when no js runtime is availableNoah Silas2013-01-071-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a production environment where the assets have been precompiled, we don't want an assets compile step to happen on the application server at all. To ensure this, a js runtime may not be available on the app servers. In this environment, pages using javascript_include_tag for assets with non-standard or chained extensions were throwing 500 errors. For instance, `javascript_include_tag('jquery.min')` would blow up. Sprockets was attempting to build the assets being included during the rewrite_extension step (responsible for appending a '.js' extension to assets being included by the basename rather than a fully qualified name). This was happening as a step to resolve #6310, which required checking for the presence of an asset with a non-standard extension before appending the extension. We can check for the presence of an asset without invoking the asset build step by using Sprockets' resolve method, which will search for the base file without building it (and is the method that find_asset uses internally to get the path to the asset before attempting to build it). When rewriting the extension on an asset, these are the steps: - If the source does not have an extension, assume that the default extension is desired and append it. - If there is an extension and it doesn't match the default extension, check to see if a file with the precise name specified exists amongst the assets; if it is present, do not append the default extension. (This is the step that resolves #6310).
* | Fixes issue where duplicate assets can be required with sprockets.jejacks0n2013-01-101-2/+2
|/ | | | | - addresses the problem by calling flatten on asset array before calling uniq. - adds note to CHANGELOG.
* Asset manifest includes aliases for foo.js -> foo/index.js and vice versa. ↵Jeremy Kemper2012-09-301-20/+12
| | | | Bump Sprockets requirements from 2.1+ to 2.2+ and let it answer "should we compile this asset?" for us.
* Revert "Revert "Respect `config.digest = false` for `asset_path`""Rafael Mendonça França2012-09-201-1/+3
| | | | | | This reverts commit 54f55746a70a7091341e84236498203118a7fbb4. Reason: the last commit fixed the failing case
* Revert "Respect `config.digest = false` for `asset_path`"Rafael Mendonça França2012-09-201-3/+1
| | | | | | | | | | | | This reverts commit 1ac19c11792a745cd654f02dfaed8e93f95b3c70. Conflicts: actionpack/CHANGELOG.md Reason: This is causing failures in the railties build. See http://travis-ci.org/#!/rails/rails/jobs/2491787 Related with #7672
* Respect `config.digest = false` for `asset_path`Peter Wagenet2012-09-171-1/+3
| | | | | | | Previously, the `asset_path` internals only respected the `:digest` option, but ignored the global config setting. This meant that `config.digest = false` could not be used in conjunction with `config.compile = false` this corrects the behavior.
* Fix railties test suitePiotr Sarnacki2012-06-081-2/+1
| | | | | | Apparently asset_environment should not be invoked if it's not needed. This fixes broken build by getting back to the code more similar to the version changed here: 5b0a891
* Fix asset tags for files with more than one dotPiotr Sarnacki2012-06-071-1/+3
| | | | | | | | | | | | | | | After the fix done in 39f9f02a, there are cases that will not work correctly. If you have file with "2 extensions", like foo.min.js and you reference the file without extension, like: javascript_include_tag "foo.min" it will fail because sprockets finds foo.min.js with foo.min argument. This commit fixes this case and will get the right file even when referrencing it without extension. (closes #6598)
* Assets: don't add extension if other given and file existsSergey Nartimov2012-05-211-2/+7
| | | | | | | | | | | | | | We should lookup if asset without appended extension exists. When sprockets are disabled the asset tag helpers incorporate this logic. When sprockets are enabled we should have the same logic. For example, we have style.ext file in app/assets/stylesheets and we use stylesheet_link_tag in the layout. In this case we should have /assets/style.ext instead of /assets/style.ext.css in the output. Closes #6310
* Make sure that javascript_include_tag/stylesheet_link_tag methods inJorge Bejar2012-05-031-2/+2
| | | | sprockets/helpers/rails_helper.rb discard duplicated assets
* Fix #3993 assets:precompile task does not detect index filesDmitry Vorotilin2012-05-011-0/+3
|
* Fix GH #5411. When precompiling, params method is undefined.kennyj2012-03-221-1/+1
|
* Merge pull request #4735 from arton/masterAaron Patterson2012-01-311-1/+5
| | | | Re-launch assets:precompile task using original $0 if $0 is batch file so it works on Windows
* Silent Sprockets logger when config.assets.logger is set to falseGuillermo Iguaran2012-01-181-1/+4
|
* Add option to configure Sprockets loggerRafael Mendonça França2012-01-171-1/+1
|
* Don't fork a process when assets:precompile:nondigest is invoked in ↵kennyj2012-01-071-3/+3
| | | | assets:precompile:all. Improve GH #3694.
* Pass extensions to javascript_path and stylesheet_path helpers. Closes #3417Santiago Pastorino2012-01-031-2/+2
|
* Add font_path helper methodSantiago Pastorino2012-01-031-0/+5
|
* Remove broken #compute_source_pathJeremy Kemper2011-12-231-5/+0
|
* Use ProcessedAsset#pathname in Sprockets helpers when debugging is on. ↵Guillermo Iguaran2011-12-101-3/+3
| | | | | | Closes #3333 #3348 #3361. Is wrong use ProcessedAsset#to_s since it returns the content of the file.
* Let's do the same trick for asset_path that we do for ↵Adrian Pike2011-12-051-8/+9
| | | | | | [image,javascript,stylesheet]_path to avoid namespace conflicts on named routes. Closes #3427
* Leave default_asset_host_protocol unsetJonathan del Strother2011-12-011-2/+0
| | | When default_asset_host_protocol is left as nil, it will use absolute protocols when a request is present, and relative protocols otherwise (eg in asset generation)
* javascript_include_tag should add '.js' to sources that contain '.'lest2011-11-221-1/+1
|
* Warnings removed when running with 1.9.3Arun Agrawal2011-10-091-1/+1
|
* stylesheet_link_tag('/stylesheets/application') and similar helpers doesn't ↵Santiago Pastorino2011-10-051-0/+2
| | | | throw Sprockets::FileOutsidePaths exception anymore
* Fix regression when calling helpers inside sprockets.José Valim2011-10-054-8/+9
|
* Fix the lame config.action_controller.present? check scattered throughout ↵José Valim2011-10-055-11/+20
| | | | | | | | assets_path. Conflicts: actionpack/test/template/sprockets_helper_test.rb
* Ensure default_asset_host_protocol is respected, closes #2980.José Valim2011-10-051-1/+3
|
* Encapsulate common rake invocation logic in a method.José Valim2011-10-051-17/+14
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* added comment about why nondigest assets requires a reinvocationMark J. Titorenko2011-10-051-0/+5
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* only reinvoke if necessaryMark J. Titorenko2011-10-051-2/+16
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* only execute the nondigest task if neededMark J. Titorenko2011-10-051-3/+3
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* don't munge the environment, let rake do that for usMark J. Titorenko2011-10-051-5/+3
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* assets compilation task refactoringMark J. Titorenko2011-10-052-30/+38
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix failing test added in previous commit.José Valim2011-10-041-4/+12
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix failing tests and refactor assets.rakeJosé Valim2011-10-041-24/+37
|
* Fix #3198.José Valim2011-10-031-39/+35
|
* Ensure that enhancements to assets:precompile task are only run onceSam Pohlenz2011-10-031-0/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* :group => :assets should only run in the assets environment.José Valim2011-10-021-1/+1
|
* Provide initialize_on_precompile which, when set to false, does not ↵José Valim2011-10-021-2/+6
| | | | initialize the app for precompilation. Defaults to true.
* Use of :: in void context Warning removedArun Agrawal2011-10-011-1/+1
|
* javascript_path and stylesheet_path should honor the asset pipeliningSantiago Pastorino2011-09-281-0/+10
|
* Merge pull request #3138 from christos/correct_image_path_with_pipelineSantiago Pastorino2011-09-261-2/+3
|\ | | | | Correctly override image_path in sprockets rails_helper
| * Refactor image_path to use asset_path directlyChristos Zisopoulos2011-09-261-1/+1
| |
| * Correctly override image_path in sprockets rails_helperChristos Zisopoulos2011-09-261-1/+2
| |
* | Merge pull request #3136 from guilleiguaran/clear-digests-on-precompileSantiago Pastorino2011-09-261-0/+4
| | | | | | | | Avoid use of existing precompiled assets during rake assets:precompile run
* | Copy assets to nondigested filenames tooSantiago Pastorino2011-09-261-5/+9
|/
* Merge pull request #3135 from christos/respect_assets_digest_valueSantiago Pastorino2011-09-261-1/+1
|\ | | | | Give precedence to `config.digest = false` over the existence of manifest.yml asset digests
| * Give precedence to `config.digest = false` over manifest.yml asset digestsChristos Zisopoulos2011-09-261-1/+1
| |