inline_forms_installer 7.13.16 → 7.13.17

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: 96167ccff7679d08e833d0d7b3bcecf8b9ec9fa2f950f93a38041bfd99c21177
4
- data.tar.gz: 7984f59c8a809a5e65b768f7f856c5f1cb4a4fc42171d961c181141f7e1efed5
3
+ metadata.gz: 6200d605a00e7f95a08b3133687e22666b42d9bb0e86e927267997faca06e3df
4
+ data.tar.gz: 203cd9b9aae3455ed785815583fb91b4cf52e7ee51b045d7f8a9ec7b366ac8e0
5
5
  SHA512:
6
- metadata.gz: 58abafb930ddc25949d072411880a0bcf322e8dd512b5d4d82fe0bf8fb1fe93d9cd2d5521afa773995fc062bec37ac7a98d0d738a601d98b7e2b2ab6133430ea
7
- data.tar.gz: 50a6a526fc398ae983955d003c1ac6317c3ffb45ea508941a3d5a182dc3c7c2aacd110bbd230449ea2129d161f28d82d6f06c3fa2a5a7b4de5ef0681e87f8472
6
+ metadata.gz: 3612327a247fc7787c571f11f5b5530c8f418c6f6585fdb05f450ed022bea0ff5de9aabc241e8a757ff4c117792cd4521dc25532342fa79a4f9c6a3e230914a0
7
+ data.tar.gz: b19f20b4707c07eb687176ea9d32ba52cb11c1e91397d8599fcd0629f5f49478bf23c730c89fba62b6a7d9be9801ed16db8bd7addd0f999625597e07a710b8c9
@@ -60,7 +60,14 @@ module InlineFormsInstaller
60
60
  end
61
61
 
62
62
  inline_forms_version = InlineFormsInstaller.inline_forms_version
63
- say "Creating #{app_name} with inline_forms v#{inline_forms_version} and development database #{database}...", :green
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 = InlineFormsInstaller.inline_forms_version
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
 
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineFormsInstaller
3
- VERSION = "7.13.16"
3
+ VERSION = "7.13.17"
4
4
 
5
5
  # Written into generated apps' `.ruby-version` (must match gemspec `required_ruby_version`).
6
6
  TARGET_RUBY_VERSION = "ruby-4.0.4"
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: 7.13.16
4
+ version: 7.13.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ace Suares