DEV: Fix Ember version lookup (#18136)

The source-of-truth for our ember version is now the installed node_module. The `ember_source` gem carries an old version of Ember and so the constant is no longer useful. We'll be dropping the gem soon.
This commit is contained in:
David Taylor 2022-08-30 16:27:14 +01:00 committed by GitHub
parent e33d694361
commit 6570fed175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class Theme < ActiveRecord::Base
get_set_cache "compiler_version" do
dependencies = [
BASE_COMPILER_VERSION,
Ember::VERSION,
EmberCli.ember_version,
GlobalSetting.cdn_url,
GlobalSetting.s3_cdn_url,
GlobalSetting.s3_endpoint,

View File

@ -49,4 +49,11 @@ module EmberCli
def self.is_ember_cli_asset?(name)
assets.include?(name) || name.start_with?("chunk.")
end
def self.ember_version
@version ||= begin
ember_source_package_raw = File.read("#{Rails.root}/app/assets/javascripts/node_modules/ember-source/package.json")
JSON.parse(ember_source_package_raw)["version"]
end
end
end