Commit ae687cf1 authored by Benjamin Neff's avatar Benjamin Neff

Merge branch 'next-minor' into develop

parents e82ac219 10935d62
......@@ -31,6 +31,7 @@
* Fix autosize in modals [#7339](https://github.com/diaspora/diaspora/pull/7339)
* Only display invite link on contacts page if invitations are enabled [#7342](https://github.com/diaspora/diaspora/pull/7342)
* Fix regex for hashtags for some languages [#7350](https://github.com/diaspora/diaspora/pull/7350)
* Create asterisk.png without digest after precompile [#7322](https://github.com/diaspora/diaspora/pull/7322)
## Features
* Add support for [Liberapay](https://liberapay.com) donations [#7290](https://github.com/diaspora/diaspora/pull/7290)
......
......@@ -203,6 +203,12 @@ gem "minitest"
gem "versionist", "1.5.0"
# Prevent accidental upgrades of thor
# TODO: remove this when either all gems depending on thor have fixed the warnings
# or thor released a version where they are clearly marked as warnings
# see: https://github.com/erikhuda/thor/issues/538
gem "thor", "0.19.1"
# Windows and OSX have an execjs compatible runtime built-in, Linux users should
# install Node.js or use "therubyracer".
#
......
......@@ -715,7 +715,7 @@ GEM
unicode-display_width (~> 1.1.1)
test_after_commit (1.1.0)
activerecord (>= 3.2)
thor (0.19.4)
thor (0.19.1)
thread_safe (0.3.6)
tilt (1.4.1)
timecop (0.8.1)
......@@ -913,6 +913,7 @@ DEPENDENCIES
spring-commands-rspec (= 1.0.4)
string-direction (= 1.2.0)
test_after_commit (= 1.1.0)
thor (= 0.19.1)
timecop (= 0.8.1)
turbo_dev_assets (= 0.0.2)
twitter (= 6.1.0)
......
......@@ -86,6 +86,9 @@ module Diaspora
# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
# See lib/tasks/assets.rake: non_digest_assets
config.assets.non_digest_assets = %w(branding/logos/asterisk.png)
# Configure generators values. Many other options are available, be sure to check the documentation.
config.generators do |g|
g.template_engine :haml
......
......@@ -10,9 +10,32 @@ namespace :assets do
BookmarkletRenderer.compile
end
desc "Create non digest assets"
task non_digest_assets: :environment do
logger = ::Logging::Logger["assets:non_digest_assets"]
non_digest_assets = Diaspora::Application.config.assets.non_digest_assets
manifest_path = Dir.glob(File.join(Rails.root, "public/assets/manifest-*.json")).first
JSON.load(File.new(manifest_path))["assets"].each do |logical_path, digested_path|
logical_pathname = Pathname.new(logical_path)
next unless non_digest_assets.any? {|testpath| logical_pathname.fnmatch?(testpath, File::FNM_PATHNAME) }
full_digested_path = File.join(Rails.root, "public/assets", digested_path)
full_non_digested_path = File.join(Rails.root, "public/assets", logical_path)
next unless FileUtils.uptodate?(full_digested_path, [full_non_digested_path])
logger.info "Copying #{full_digested_path} to #{full_non_digested_path}"
FileUtils.copy_file(full_digested_path, full_non_digested_path, true)
end
end
# Augment precompile with error page generation
task :precompile do
Rake::Task['assets:generate_error_pages'].invoke
Rake::Task['assets:uglify_bookmarklet'].invoke
Rake::Task["assets:generate_error_pages"].invoke
Rake::Task["assets:uglify_bookmarklet"].invoke
Rake::Task["assets:non_digest_assets"].invoke
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment