diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-11-12 17:42:53 -0600 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-11-14 17:39:08 -0600 |
commit | f60e0b62f4e5300645f235983e5b75bcf16b370d (patch) | |
tree | 0c437e6600b7a8bdf806d63fa76ce751bbe66d58 /lib | |
parent | ec3abd7c87116ad2df5b1da5701afe68a7f74844 (diff) | |
parent | 265b26489a9214a6c98a4dfa88f08ce490211ebc (diff) |
Merge remote-tracking branch 'upstream/master' into merge-glitch
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mastodon/accounts_cli.rb | 2 | ||||
-rw-r--r-- | lib/webpacker/helper_extensions.rb | 20 | ||||
-rw-r--r-- | lib/webpacker/manifest_extensions.rb | 17 |
3 files changed, 38 insertions, 1 deletions
diff --git a/lib/mastodon/accounts_cli.rb b/lib/mastodon/accounts_cli.rb index 8f9279a3c..7565620cf 100644 --- a/lib/mastodon/accounts_cli.rb +++ b/lib/mastodon/accounts_cli.rb @@ -245,7 +245,7 @@ module Mastodon end if [404, 410].include?(code) - SuspendAccountService.new.call(account, reserve_username: false) unless options[:dry_run] + DeleteAccountService.new.call(account, reserve_username: false) unless options[:dry_run] 1 else # Touch account even during dry run to avoid getting the account into the window again diff --git a/lib/webpacker/helper_extensions.rb b/lib/webpacker/helper_extensions.rb new file mode 100644 index 000000000..8f46d7631 --- /dev/null +++ b/lib/webpacker/helper_extensions.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Webpacker::HelperExtensions + def javascript_pack_tag(name, **options) + src, integrity = current_webpacker_instance.manifest.lookup!(name, type: :javascript, with_integrity: true) + javascript_include_tag(src, options.merge(integrity: integrity)) + end + + def stylesheet_pack_tag(name, **options) + src, integrity = current_webpacker_instance.manifest.lookup!(name, type: :stylesheet, with_integrity: true) + stylesheet_link_tag(src, options.merge(integrity: integrity)) + end + + def preload_pack_asset(name, **options) + src, integrity = current_webpacker_instance.manifest.lookup!(name, with_integrity: true) + preload_link_tag(src, options.merge(integrity: integrity)) + end +end + +Webpacker::Helper.prepend(Webpacker::HelperExtensions) diff --git a/lib/webpacker/manifest_extensions.rb b/lib/webpacker/manifest_extensions.rb new file mode 100644 index 000000000..789eb81cc --- /dev/null +++ b/lib/webpacker/manifest_extensions.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Webpacker::ManifestExtensions + def lookup(name, pack_type = {}) + asset = super + + if pack_type[:with_integrity] && asset.respond_to?(:dig) + [asset.dig('src'), asset.dig('integrity')] + elsif asset.respond_to?(:dig) + asset.dig('src') + else + asset + end + end +end + +Webpacker::Manifest.prepend(Webpacker::ManifestExtensions) |