inline_forms_installer 7.13.16 → 7.13.18
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65af883a40498b32b176ba59f105d6fa81c739a76426f484b689e29171814ba3
|
|
4
|
+
data.tar.gz: e6a35bc454545c6f70b0ecf87b15cbbcdc392de47ad687147e8f924a8f022e08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f1505bdbbf6eb2beca0e7c7b59cc702d6d5be3661dc580d27cc127f85a24ba21d523e3c6590134fb516858b6038bb160ae9a383eedcbd521241874b2bed57266
|
|
7
|
+
data.tar.gz: 67ff20e3683741e532f6e85d635b4eb27c9cfe2e8535fac939e4cb5c995c0df96750c82131e67b01aca2d35a95324f56ec18dacb149f079a0da44e6e985d3375
|
|
@@ -60,7 +60,14 @@ module InlineFormsInstaller
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
inline_forms_version = InlineFormsInstaller.inline_forms_version
|
|
63
|
-
|
|
63
|
+
# The Gemfile pins `gem "inline_forms", "~> 7"`, so Bundler resolves the
|
|
64
|
+
# highest 7.x available on RubyGems at install time. The
|
|
65
|
+
# `inline_forms_version` value above is just whatever happens to be in
|
|
66
|
+
# the Creator's own gemset and may differ from what lands in the app;
|
|
67
|
+
# report the constraint instead of a misleading exact version, and let
|
|
68
|
+
# `print_create_summary` read the actual locked versions from the
|
|
69
|
+
# generated app's Gemfile.lock once `bundle install` is done.
|
|
70
|
+
say "Creating #{app_name} (inline_forms ~> 7) with development database #{database}...", :green
|
|
64
71
|
|
|
65
72
|
regex = /\A[0-9a-zA-Z][0-9a-zA-Z_-]+[0-9a-zA-Z]\Z/
|
|
66
73
|
if !regex.match(app_name)
|
|
@@ -159,13 +166,31 @@ module InlineFormsInstaller
|
|
|
159
166
|
end
|
|
160
167
|
end
|
|
161
168
|
|
|
169
|
+
# Read the Bundler-locked version of `gem_name` from the generated app's
|
|
170
|
+
# Gemfile.lock so the install summary reports what actually shipped to
|
|
171
|
+
# the app, not what happens to be in the Creator's own gemset (the two
|
|
172
|
+
# can differ because the Gemfile pins `~> 7`).
|
|
173
|
+
def locked_gem_version(app_name, gem_name)
|
|
174
|
+
lock_path = File.expand_path(File.join(app_name, "Gemfile.lock"))
|
|
175
|
+
return nil unless File.file?(lock_path)
|
|
176
|
+
|
|
177
|
+
File.foreach(lock_path) do |line|
|
|
178
|
+
if (m = line.match(/^\s{4}#{Regexp.escape(gem_name)} \(([^)]+)\)/))
|
|
179
|
+
return m[1]
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
nil
|
|
183
|
+
end
|
|
184
|
+
|
|
162
185
|
def print_create_summary(app_name, log_path, started_at, ran_example)
|
|
163
186
|
duration = (Time.now - started_at).round(1)
|
|
164
187
|
bundle_ok = bundle_check_ok?(app_name)
|
|
165
188
|
|
|
166
189
|
test_summary = test_summary_from_log(log_path, ran_example)
|
|
167
190
|
|
|
168
|
-
if_ver =
|
|
191
|
+
if_ver = locked_gem_version(app_name, "inline_forms") ||
|
|
192
|
+
InlineFormsInstaller.inline_forms_version
|
|
193
|
+
vh_ver = locked_gem_version(app_name, "validation_hints")
|
|
169
194
|
inst_ver = InlineFormsInstaller::VERSION
|
|
170
195
|
|
|
171
196
|
InlineFormsInstaller::CreateLog.append_summary(
|
|
@@ -180,12 +205,12 @@ module InlineFormsInstaller
|
|
|
180
205
|
|
|
181
206
|
say ""
|
|
182
207
|
say "Install complete (#{duration}s)", :green
|
|
183
|
-
say " inline_forms #{if_ver} / inline_forms_installer #{inst_ver}", :green
|
|
208
|
+
say " inline_forms #{if_ver} / inline_forms_installer #{inst_ver}#{vh_ver ? " / validation_hints #{vh_ver}" : ''}", :green
|
|
184
209
|
say " bundle check: #{bundle_ok ? 'ok' : 'FAILED'}", bundle_ok ? :green : :red
|
|
185
210
|
say " tests: #{test_summary}", :green
|
|
186
211
|
say "Install log: #{log_path}", :green
|
|
187
212
|
end
|
|
188
|
-
private :print_create_summary, :test_summary_from_log, :bundle_check_ok
|
|
213
|
+
private :print_create_summary, :test_summary_from_log, :bundle_check_ok?, :locked_gem_version
|
|
189
214
|
end
|
|
190
215
|
end
|
|
191
216
|
|
|
@@ -499,37 +499,6 @@ create_file 'config/initializers/paper_trail_yaml_safe_load.rb', <<-PT_YAML.stri
|
|
|
499
499
|
ActiveRecord.yaml_column_permitted_classes |= Rails.application.config.active_record.yaml_column_permitted_classes
|
|
500
500
|
PT_YAML
|
|
501
501
|
|
|
502
|
-
# Create Translations
|
|
503
|
-
say "- Generate models and tables and views for translations..." # TODO Translations need to be done in inline_forms, and then generate a yml file, perhaps
|
|
504
|
-
generate "inline_forms", "InlineFormsLocale name:string inline_forms_translations:belongs_to _enabled:yes _presentation:\#{name}"
|
|
505
|
-
sleep 1 # unique migration timestamps per generator
|
|
506
|
-
generate "inline_forms", "InlineFormsKey name:string inline_forms_translations:has_many inline_forms_translations:associated _enabled:yes _presentation:\#{name}"
|
|
507
|
-
sleep 1
|
|
508
|
-
generate "inline_forms", "InlineFormsTranslation inline_forms_key:belongs_to inline_forms_locale:dropdown value:text interpolations:text is_proc:boolean _presentation:\#{value}"
|
|
509
|
-
# Plain long text uses :plain_text; ActionText-backed fields use :rich_text.
|
|
510
|
-
sleep 1 # to get unique migration number
|
|
511
|
-
create_file "db/migrate/" +
|
|
512
|
-
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
|
513
|
-
"_" +
|
|
514
|
-
"inline_forms_create_view_for_translations.rb", <<-VIEW_MIGRATION.strip_heredoc
|
|
515
|
-
class InlineFormsCreateViewForTranslations < ActiveRecord::Migration[7.2]
|
|
516
|
-
def self.up
|
|
517
|
-
execute 'CREATE VIEW translations
|
|
518
|
-
AS
|
|
519
|
-
SELECT L.name AS locale,
|
|
520
|
-
K.name AS thekey,
|
|
521
|
-
T.value AS value,
|
|
522
|
-
T.interpolations AS interpolations,
|
|
523
|
-
T.is_proc AS is_proc
|
|
524
|
-
FROM inline_forms_keys K, inline_forms_locales L, inline_forms_translations T
|
|
525
|
-
WHERE T.inline_forms_key_id = K.id AND T.inline_forms_locale_id = L.id '
|
|
526
|
-
end
|
|
527
|
-
def self.down
|
|
528
|
-
execute 'DROP VIEW translations'
|
|
529
|
-
end
|
|
530
|
-
end
|
|
531
|
-
VIEW_MIGRATION
|
|
532
|
-
|
|
533
502
|
say "- Creating application title via locales..."
|
|
534
503
|
create_file "config/locales/inline_forms_local.en.yml", <<-END_LOCALE.strip_heredoc
|
|
535
504
|
en:
|