Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle arrays in normalize_asset_timestamps #185

Merged

Conversation

will-in-wi
Copy link
Contributor

It looks like the Readme describes usages like so:

set :normalize_asset_timestamps, %w{public/images public/javascripts public/stylesheets}

Yet as seen in #184, this doesn't actually work.

This PR tries to fix this case.

assets = fetch(:normalize_asset_timestamps)
if assets
assets = fetch(:normalize_asset_timestamps, [])
assets = [assets] unless assets.respond_to?(:any?)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be cleaner?

assets = Array(assets)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Learn something new every day… I like that. Fixed.

@mattbrictson
Copy link
Member

Thanks for PR! I hadn't realized that the README example was completely broken (I don't use the normalize feature at all).

Let me know what you think of my code suggestion in the line comment. Otherwise this needs a CHANGELOG entry and then it's good to merge!

@will-in-wi
Copy link
Contributor Author

Changelog entry added. This should be good to go.

@mattbrictson mattbrictson merged commit 569a9b0 into capistrano:master Sep 10, 2016
sbonami added a commit to sb-archive/capistrano-rails that referenced this pull request Sep 13, 2016
…ride-setting

* upstream/master: (24 commits)
  Preparing v1.1.8
  Bring README up to date
  Handle arrays in normalize_asset_timestamps (capistrano#185)
  Updated configuration to avoid setting migration servers and improved recommendation
  Added recommendations section
  Remove duplicate explanations of :migration_role in README.md
  Your contribution goes here
  Add 1.1.7 release notes
  Prepare for 1.1.7
  Fix code on README
  Allow overriding migration servers
  call Array#uniq to remove duplicated :linked_dirs
  Complete installation instructions
  Prepare for 1.1.6
  Changelog for capistrano#133 /cc @januszm
  Moving capistrano related gems under the dev group
  Update changelog
  Update changelog
  Escape [ and ] when calling assets:clean rake task
  add clobber assets
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants