Update Ruby version in README.md

This commit is contained in:
Eric Schultz 2021-03-12 14:32:36 -06:00 committed by Eric Schultz
parent f6a45a4d0d
commit ce4940fde8
4 changed files with 33 additions and 4 deletions

View file

@ -11,8 +11,12 @@ require "bundler/setup"
require "webpacker" require "webpacker"
require "webpacker/webpack_runner" require "webpacker/webpack_runner"
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
APP_ROOT = File.expand_path("..", __dir__) APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do Dir.chdir(APP_ROOT) do
system!("rake i18n:js:export")
Webpacker::WebpackRunner.run(ARGV) Webpacker::WebpackRunner.run(ARGV)
end end

View file

@ -12,7 +12,12 @@ require "bundler/setup"
require "webpacker" require "webpacker"
require "webpacker/dev_server_runner" require "webpacker/dev_server_runner"
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end
APP_ROOT = File.expand_path("..", __dir__) APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do Dir.chdir(APP_ROOT) do
system!("rake i18n:js:export")
Webpacker::DevServerRunner.run(ARGV) Webpacker::DevServerRunner.run(ARGV)
end end

View file

@ -2,8 +2,24 @@
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE # Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
desc 'For generating the i18n-js exports at runtime. Overrides the built in i18n-js task'
def enhance_assets_precompile
# yarn:install was added in Rails 5.1
Rake::Task["assets:precompile"].enhance(['i18n:js:export'])
end
def enhance_webpacker_compile
# yarn:install was added in Rails 5.1
Rake::Task["webpacker:compile"].enhance(['i18n:js:export'])
end
def enhance_assets_clean_and_clobber
Rake::Task["assets:clean"].enhance(['i18n:js:clean'])
Rake::Task["assets:clobber"].enhance(['i18n:js:clean'])
end
desc 'For generating the i18n-js exports at runtime. Overrides the built in i18n-js task'
namespace :i18n do namespace :i18n do
namespace :js do namespace :js do
task export: :environment do task export: :environment do
@ -11,9 +27,13 @@ namespace :i18n do
end end
desc 'Delete all of the generated Javascript locales files' desc 'Delete all of the generated Javascript locales files'
task clear: :environment do task clean: :environment do
locales_dir = Rails.root.join('app', 'javascript', 'i18n', 'locales') locales_dir = Rails.root.join('app', 'javascript', 'i18n', 'locales')
FileUtils.remove_dir(locales_dir) if Dir.exists? locales_dir FileUtils.remove_dir(locales_dir) if Dir.exists? locales_dir
end end
end end
end end
enhance_assets_precompile
enhance_webpacker_compile
enhance_assets_clean_and_clobber

View file

@ -19,7 +19,7 @@
"prepare-for-push": "yarn test && yarn eslint --fix && yarn markdownlint --fix && bin/rails notice:update", "prepare-for-push": "yarn test && yarn eslint --fix && yarn markdownlint --fix && bin/rails notice:update",
"prepare-for-push-js": "yarn jest && yarn eslint --fix && yarn markdownlint --fix && bin/rails notice:js:update", "prepare-for-push-js": "yarn jest && yarn eslint --fix && yarn markdownlint --fix && bin/rails notice:js:update",
"notice:js": "npx @houdiniproject/noticeme@^1.1.0-pre1 -f NOTICE-js -i included.json -s 250", "notice:js": "npx @houdiniproject/noticeme@^1.1.0-pre1 -f NOTICE-js -i included.json -s 250",
"webpack": "bin/rails i18n:js:export && bin/webpack" "webpack": "bin/webpack"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.0.0", "@babel/core": "^7.0.0",