inline_forms_installer 8.1.66 → 8.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/inline_forms_installer/installer_core.rb +18 -10
- data/lib/inline_forms_installer/version.rb +2 -2
- data/lib/installer_templates/example_app_tests/test/integration/example_app_layout_title_test.rb +20 -0
- data/lib/installer_templates/example_app_tests/test/integration/example_app_production_js_compressor_test.rb +26 -0
- data/lib/installer_templates/example_app_tests/test/integration/example_app_stylesheet_test.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a76760c3472f54ae4118cbc75a0a651c2c898742ef0ed5369c9278cb2a220772
|
|
4
|
+
data.tar.gz: 6801b1b3425f0167c246221a7ea95b86fe55bebbcefd5587d67acad9cc2733a1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bc729a5297f2491e0236235eeb9e249c386d38eb3efd15c4401e4dbcc0a2f461fe18bfda459a17fb8550ef1303ed837eb3bb2aba131f87eb141ff218429a05d8
|
|
7
|
+
data.tar.gz: e942c5ad03e09a0bd905eca34817e9056004d4d54ee748e827be96b333b766280e7308032d15d20ac50432e4d74dae3de2c3b408b6aa21896ebd1229613fd229
|
|
@@ -88,7 +88,7 @@ end
|
|
|
88
88
|
# agnostic `X.Y.Z` form; `force: true` avoids Thor's interactive overwrite
|
|
89
89
|
# prompt when Rails' value differs (it always does, now that we drop the
|
|
90
90
|
# RVM-only `ruby-` prefix).
|
|
91
|
-
create_file ".ruby-version", "#{ENV.fetch('ruby_version', '4.0.
|
|
91
|
+
create_file ".ruby-version", "#{ENV.fetch('ruby_version', '4.0.10')}\n", force: true
|
|
92
92
|
if (gemset = ENV["inline_forms_rvm_gemset"]).to_s != ""
|
|
93
93
|
create_file ".ruby-gemset", "#{gemset}\n"
|
|
94
94
|
end
|
|
@@ -201,8 +201,11 @@ gem_group :development do
|
|
|
201
201
|
end
|
|
202
202
|
|
|
203
203
|
gem_group :production do
|
|
204
|
+
# The ExecJS runtime (embedded V8) terser runs on, so no node is needed.
|
|
204
205
|
gem 'mini_racer'
|
|
205
|
-
|
|
206
|
+
# JavaScript compressor (config.assets.js_compressor in production.rb).
|
|
207
|
+
# uglifier is ES5-era and cannot parse Turbo 8's ES2022 bundle.
|
|
208
|
+
gem 'terser'
|
|
206
209
|
end
|
|
207
210
|
|
|
208
211
|
say "- Running bundle..."
|
|
@@ -658,15 +661,10 @@ PT_YAML
|
|
|
658
661
|
say "- Creating application title via locales..."
|
|
659
662
|
create_file "config/locales/inline_forms_local.en.yml", <<-END_LOCALE.strip_heredoc
|
|
660
663
|
en:
|
|
661
|
-
#
|
|
662
|
-
#
|
|
664
|
+
# The application's name in the gem's titles, Devise pages included
|
|
665
|
+
# (InlineForms.application_title; in a locale without this key the
|
|
666
|
+
# ApplicationHelper#application_name below, which says the same).
|
|
663
667
|
application_name: #{app_name}
|
|
664
|
-
inline_forms:
|
|
665
|
-
general:
|
|
666
|
-
application_title: #{app_name}
|
|
667
|
-
devise:
|
|
668
|
-
title_for_devise: #{app_name}
|
|
669
|
-
welcome: Welcome to #{app_name}!
|
|
670
668
|
END_LOCALE
|
|
671
669
|
|
|
672
670
|
say "- Migrating Database (only when using sqlite)"
|
|
@@ -779,6 +777,16 @@ gsub_file "config/environments/production.rb",
|
|
|
779
777
|
gsub_file "config/environments/production.rb",
|
|
780
778
|
"# config.force_ssl = true", "config.force_ssl = true"
|
|
781
779
|
|
|
780
|
+
# JavaScript compression on assets:precompile. Nothing else sets a compressor,
|
|
781
|
+
# and the gem alone (production group) does not switch it on.
|
|
782
|
+
say "- Setting js_compressor = :terser in environments/production.rb..."
|
|
783
|
+
insert_into_file "config/environments/production.rb", <<-JS_COMPRESSOR.strip_heredoc.indent(2), after: "Rails.application.configure do\n"
|
|
784
|
+
# Compress JavaScript with terser (ES2022-capable), which runs on mini_racer;
|
|
785
|
+
# both are in the Gemfile's production group.
|
|
786
|
+
config.assets.js_compressor = :terser
|
|
787
|
+
|
|
788
|
+
JS_COMPRESSOR
|
|
789
|
+
|
|
782
790
|
# devise mailer stuff
|
|
783
791
|
say "- Injecting devise mailer stuff in environments/production.rb..."
|
|
784
792
|
# strip_heredoc_with_indent(2) became strip_heredoc(2), but only in rails 4... :-(
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
2
|
|
|
3
3
|
module InlineFormsInstaller
|
|
4
|
-
VERSION = "8.1.
|
|
4
|
+
VERSION = "8.1.70"
|
|
5
5
|
|
|
6
6
|
# Canonical bare Ruby version (must match gemspec `required_ruby_version`).
|
|
7
7
|
# Written verbatim into generated apps' `.ruby-version` for rbenv/chruby/asdf/
|
|
8
8
|
# mise (which need the bare `X.Y.Z` form). For RVM installs the Creator writes
|
|
9
9
|
# the `ruby-X.Y.Z` form instead, because RVM's `.ruby-version` reader rejects a
|
|
10
10
|
# bare version. See Creator#create (ENV["ruby_version"]).
|
|
11
|
-
TARGET_RUBY_VERSION = "4.0.
|
|
11
|
+
TARGET_RUBY_VERSION = "4.0.10"
|
|
12
12
|
|
|
13
13
|
# Kept in sync with inline_forms gem releases from the same repo tag.
|
|
14
14
|
INLINE_FORMS_VERSION = VERSION
|
data/lib/installer_templates/example_app_tests/test/integration/example_app_layout_title_test.rb
CHANGED
|
@@ -20,6 +20,26 @@ class ExampleAppLayoutTitleTest < ExampleAppIntegrationTestCase
|
|
|
20
20
|
assert_equal ApplicationController.helpers.application_name, I18n.t(:application_name, locale: :en)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
# The gem's title keys are lambdas (lib/locales/inline_forms_titles.rb);
|
|
24
|
+
# a host's own translation of one must load after them to win.
|
|
25
|
+
test "the host's locale files load after the gem's title keys" do
|
|
26
|
+
paths = I18n.load_path.map(&:to_s)
|
|
27
|
+
gem_titles = paths.index { |path| path.end_with?("lib/locales/inline_forms_titles.rb") }
|
|
28
|
+
host = paths.index { |path| path.end_with?("config/locales/inline_forms_local.en.yml") }
|
|
29
|
+
|
|
30
|
+
assert gem_titles, "the gem's title keys are on the load path"
|
|
31
|
+
assert host, "the installer's locale file is on the load path"
|
|
32
|
+
assert_operator gem_titles, :<, host
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
test "the title keys say the app name in en and nl" do
|
|
36
|
+
name = ApplicationController.helpers.application_name
|
|
37
|
+
%i[en nl].each do |locale|
|
|
38
|
+
assert_equal name, I18n.t("inline_forms.general.application_title", locale: locale)
|
|
39
|
+
assert_equal name, I18n.t("inline_forms.devise.title_for_devise", locale: locale)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
23
43
|
test "apartments page title is the app name and version" do
|
|
24
44
|
get apartments_path
|
|
25
45
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "../example_app/example_integration_test_case"
|
|
4
|
+
|
|
5
|
+
# Production minifies JavaScript with terser on mini_racer (8.1.69; uglifier
|
|
6
|
+
# before, which nothing switched on and which cannot parse Turbo 8's ES2022).
|
|
7
|
+
# The test env does not load the production group, so this reads the generated
|
|
8
|
+
# files; a real assets:precompile is checked by hand on a release.
|
|
9
|
+
class ExampleAppProductionJsCompressorTest < ExampleAppIntegrationTestCase
|
|
10
|
+
test "production config sets the terser compressor" do
|
|
11
|
+
config = File.read(Rails.root.join("config", "environments", "production.rb"))
|
|
12
|
+
|
|
13
|
+
assert_match(/^ config\.assets\.js_compressor = :terser$/, config,
|
|
14
|
+
"expected the installer to set js_compressor in production.rb")
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
test "the production group has terser and mini_racer, and uglifier is gone" do
|
|
18
|
+
gemfile = File.read(Rails.root.join("Gemfile"))
|
|
19
|
+
production = gemfile[/^group :production do\n(.*?)^end/m, 1]
|
|
20
|
+
|
|
21
|
+
assert production, "expected a production group in the Gemfile"
|
|
22
|
+
assert_match(/gem ["']terser["']/, production)
|
|
23
|
+
assert_match(/gem ["']mini_racer["']/, production)
|
|
24
|
+
assert_no_match(/gem ["']uglifier["']/, gemfile)
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/installer_templates/example_app_tests/test/integration/example_app_stylesheet_test.rb
CHANGED
|
@@ -18,7 +18,7 @@ class ExampleAppStylesheetTest < ActiveSupport::TestCase
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
test "uninitialised top-bar submenus are hidden" do
|
|
21
|
-
assert_includes built("inline_forms"), ".dropdown.menu>li>ul.menu:not(.is-dropdown-submenu){display:none}"
|
|
21
|
+
assert_includes built("inline_forms"), ".dropdown.menu[data-dropdown-menu]>li>ul.menu:not(.is-dropdown-submenu){display:none}"
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
private
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: inline_forms_installer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.1.
|
|
4
|
+
version: 8.1.70
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ace Suares
|
|
@@ -108,6 +108,7 @@ files:
|
|
|
108
108
|
- lib/installer_templates/example_app_tests/test/integration/example_app_photo_comments_test.rb
|
|
109
109
|
- lib/installer_templates/example_app_tests/test/integration/example_app_photo_revert_test.rb
|
|
110
110
|
- lib/installer_templates/example_app_tests/test/integration/example_app_photos_test.rb
|
|
111
|
+
- lib/installer_templates/example_app_tests/test/integration/example_app_production_js_compressor_test.rb
|
|
111
112
|
- lib/installer_templates/example_app_tests/test/integration/example_app_production_ssl_test.rb
|
|
112
113
|
- lib/installer_templates/example_app_tests/test/integration/example_app_routing_test.rb
|
|
113
114
|
- lib/installer_templates/example_app_tests/test/integration/example_app_sass_deprecations_test.rb
|
|
@@ -160,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
160
161
|
- !ruby/object:Gem::Version
|
|
161
162
|
version: '0'
|
|
162
163
|
requirements: []
|
|
163
|
-
rubygems_version: 4.0.
|
|
164
|
+
rubygems_version: 4.0.20
|
|
164
165
|
specification_version: 4
|
|
165
166
|
summary: CLI and Rails app template for generating inline_forms applications.
|
|
166
167
|
test_files: []
|