inline_forms_installer 8.0.0 → 8.0.2
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: 4ab642f22fbe01e046c50dd57353ec13401be001f48e8f115acc35f28a1a0a86
|
|
4
|
+
data.tar.gz: 950b79a445f893c5a2d579c158605a5053b52a6e4d73812303e79fc3343f1cb1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 902bae21567e1c273b39853ac858338c649d661efee1f0204e4b60006832cc7f7ebb0666e44e88562ecc1d5882206301f9970440e12fac251b7fbdb6f2305e1d
|
|
7
|
+
data.tar.gz: 1642f887d5bc700773924435a636e6dcb0e50dd6d28445ec946f27c6e7c3608f105ead486c6bec05e14d82682a9229f6ca0a91b0f7d0ea8d241c20c0b073248e
|
|
@@ -103,6 +103,7 @@ module InlineFormsInstaller
|
|
|
103
103
|
ENV["inline_forms_installer_version"] = InlineFormsInstaller::VERSION
|
|
104
104
|
ENV["INLINE_FORMS_INSTALLER_ROOT"] = InlineFormsInstaller.gem_root
|
|
105
105
|
ENV["INLINE_FORMS_ROOT"] = InlineFormsInstaller.inline_forms_gem_root
|
|
106
|
+
InlineFormsInstaller.discover_prerelease_env!
|
|
106
107
|
|
|
107
108
|
app_template_file = File.join(__dir__, "app_template.rb")
|
|
108
109
|
|
|
@@ -112,7 +113,7 @@ module InlineFormsInstaller
|
|
|
112
113
|
Gem::Specification
|
|
113
114
|
.find_all_by_name("rails")
|
|
114
115
|
.map(&:version)
|
|
115
|
-
.select { |v| v >= Gem::Version.new("
|
|
116
|
+
.select { |v| v >= Gem::Version.new("8.0") && v < Gem::Version.new("8.1") }
|
|
116
117
|
.max
|
|
117
118
|
rescue StandardError
|
|
118
119
|
nil
|
|
@@ -31,6 +31,31 @@ def bundle_install!
|
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
# Pre-install built .gem files into the app RVM gemset so Bundler can resolve
|
|
35
|
+
# inline_forms ~> 8 before those releases exist on RubyGems. Set
|
|
36
|
+
# INLINE_FORMS_RELEASE_ROOT and/or VALIDATION_HINTS_ROOT (creator sets the latter
|
|
37
|
+
# when a sibling validation_hints checkout exists).
|
|
38
|
+
def install_prerelease_gems_from_roots!
|
|
39
|
+
roots = []
|
|
40
|
+
%w[INLINE_FORMS_RELEASE_ROOT VALIDATION_HINTS_ROOT].each do |key|
|
|
41
|
+
root = ENV[key].to_s
|
|
42
|
+
roots << File.expand_path(root) if root != "" && File.directory?(root)
|
|
43
|
+
end
|
|
44
|
+
roots.uniq!
|
|
45
|
+
return if roots.empty?
|
|
46
|
+
|
|
47
|
+
%w[validation_hints inline_forms inline_forms_installer].each do |name|
|
|
48
|
+
gem_file = roots.filter_map { |root|
|
|
49
|
+
files = Dir[File.join(root, "#{name}-*.gem")]
|
|
50
|
+
files.sort.last if files.any?
|
|
51
|
+
}.max
|
|
52
|
+
next unless gem_file && File.file?(gem_file)
|
|
53
|
+
|
|
54
|
+
say "- Installing #{File.basename(gem_file)} into app gemset..."
|
|
55
|
+
run "gem install #{Shellwords.escape(gem_file)} --no-document"
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
34
59
|
# Pin Ruby for the generated app (after `rails new`; do not write these files in
|
|
35
60
|
# Creator before `rails new` — Rails also emits `.ruby-version` and prompts).
|
|
36
61
|
create_file ".ruby-version", "#{ENV.fetch('ruby_version', 'ruby-4.0.4')}\n"
|
|
@@ -44,15 +69,12 @@ use_app_rvm_gemset!
|
|
|
44
69
|
remove_file 'Gemfile' if File.exist?('Gemfile')
|
|
45
70
|
create_file 'Gemfile', "# created by inline_forms_installer #{ENV['inline_forms_installer_version']} on #{Date.today}\n"
|
|
46
71
|
|
|
47
|
-
# `rails new`
|
|
48
|
-
#
|
|
49
|
-
# `load_defaults 8.0` and other 8.x-only settings. The Gemfile below pins
|
|
50
|
-
# `rails ~> 7.2.3`; normalize application.rb so the first `bundle exec rails`
|
|
51
|
-
# boot matches that pin.
|
|
72
|
+
# `rails new` uses a locally installed Rails 8.0.x when available (see Creator).
|
|
73
|
+
# Align `load_defaults` with the Gemfile pin below if a different `rails new` left another version.
|
|
52
74
|
if File.exist?('config/application.rb')
|
|
53
75
|
gsub_file 'config/application.rb',
|
|
54
76
|
/config\.load_defaults\s+\d+\.\d+/,
|
|
55
|
-
'config.load_defaults
|
|
77
|
+
'config.load_defaults 8.0'
|
|
56
78
|
end
|
|
57
79
|
|
|
58
80
|
add_source 'https://rubygems.org'
|
|
@@ -65,8 +87,8 @@ gem 'autoprefixer-rails'
|
|
|
65
87
|
# foundation-rails 6.7+ uses Dart Sass (`sass:math`); sass-rails/sassc removed.
|
|
66
88
|
# Visually tuned against foundation-rails ~> 6.6.2; current pin ~> 6.9 (6.9.0.x).
|
|
67
89
|
gem 'foundation-rails', '~> 6.9'
|
|
68
|
-
# Pin inline_forms and validation_hints on the
|
|
69
|
-
# highest
|
|
90
|
+
# Pin inline_forms and validation_hints on the 8.x line; Bundler resolves the
|
|
91
|
+
# highest 8.x that satisfies all deps. Set INLINE_FORMS_GEMFILE_PATH for
|
|
70
92
|
# maintainer local-path overrides only.
|
|
71
93
|
if ENV["INLINE_FORMS_GEMFILE_PATH"] && File.directory?(ENV["INLINE_FORMS_GEMFILE_PATH"])
|
|
72
94
|
gem "inline_forms", path: ENV["INLINE_FORMS_GEMFILE_PATH"]
|
|
@@ -84,9 +106,9 @@ gem 'jquery-ui-rails', '4.0.3'
|
|
|
84
106
|
gem 'mini_magick'
|
|
85
107
|
gem 'mysql2'
|
|
86
108
|
gem 'paper_trail', '~> 16.0'
|
|
87
|
-
gem 'rails-i18n', '~>
|
|
109
|
+
gem 'rails-i18n', '~> 8.0'
|
|
88
110
|
gem 'rails-jquery-autocomplete'
|
|
89
|
-
gem 'rails', '~>
|
|
111
|
+
gem 'rails', '~> 8.0'
|
|
90
112
|
gem 'rake'
|
|
91
113
|
gem 'rvm'
|
|
92
114
|
gem 'dartsass-rails'
|
|
@@ -121,8 +143,8 @@ gem_group :development do
|
|
|
121
143
|
gem 'rvm-capistrano', :require => false
|
|
122
144
|
gem 'rvm1-capistrano3', require: false
|
|
123
145
|
gem 'seed_dump', '~> 0.5.3'
|
|
124
|
-
# Rails
|
|
125
|
-
gem 'sqlite3', '
|
|
146
|
+
# Rails 8 sqlite3 adapter requires sqlite3 >= 2.1.
|
|
147
|
+
gem 'sqlite3', '>= 2.1'
|
|
126
148
|
gem 'thin'
|
|
127
149
|
gem 'yaml_db'
|
|
128
150
|
end
|
|
@@ -134,13 +156,7 @@ end
|
|
|
134
156
|
|
|
135
157
|
say "- Running bundle..."
|
|
136
158
|
run "gem install bundler --no-document"
|
|
137
|
-
|
|
138
|
-
vh_gem = Dir[File.join(vh_root, "validation_hints-*.gem")].sort.last
|
|
139
|
-
if vh_gem && File.file?(vh_gem)
|
|
140
|
-
say "- Installing #{File.basename(vh_gem)} from VALIDATION_HINTS_ROOT..."
|
|
141
|
-
run "gem install #{vh_gem} --no-document"
|
|
142
|
-
end
|
|
143
|
-
end
|
|
159
|
+
install_prerelease_gems_from_roots!
|
|
144
160
|
bundle_install!
|
|
145
161
|
|
|
146
162
|
say "- Dart Sass: inline_forms stylesheet entrypoints + initializer..."
|
|
@@ -151,6 +167,13 @@ copy_file File.join(INSTALLER_ROOT, "lib/installer_templates/dartsass/inline_for
|
|
|
151
167
|
copy_file File.join(INSTALLER_ROOT, "lib/installer_templates/dartsass/devise_main.scss"),
|
|
152
168
|
"app/assets/stylesheets/inline_forms_install/devise_main.scss"
|
|
153
169
|
|
|
170
|
+
say "- Sprockets: app/assets/config/manifest.js (Rails 8 importmap default omits it)..."
|
|
171
|
+
empty_directory "app/assets/config"
|
|
172
|
+
create_file "app/assets/config/manifest.js", <<~MANIFEST unless File.exist?("app/assets/config/manifest.js")
|
|
173
|
+
//= link_tree ../images
|
|
174
|
+
//= link_tree ../builds
|
|
175
|
+
MANIFEST
|
|
176
|
+
|
|
154
177
|
say "- Dart Sass: rails dartsass:install (builds/, manifest, Procfile.dev)..."
|
|
155
178
|
run "bundle exec rails dartsass:install"
|
|
156
179
|
|
|
@@ -256,7 +279,7 @@ create_file "db/migrate/" +
|
|
|
256
279
|
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
|
257
280
|
"_" +
|
|
258
281
|
"devise_create_users.rb", <<-DEVISE_MIGRATION.strip_heredoc
|
|
259
|
-
class DeviseCreateUsers < ActiveRecord::Migration[
|
|
282
|
+
class DeviseCreateUsers < ActiveRecord::Migration[8.0]
|
|
260
283
|
|
|
261
284
|
def change
|
|
262
285
|
create_table(:users) do |t|
|
|
@@ -409,7 +432,7 @@ create_file "db/migrate/" +
|
|
|
409
432
|
Time.now.utc.strftime("%Y%m%d%H%M%S") +
|
|
410
433
|
"_" +
|
|
411
434
|
"inline_forms_create_join_table_user_role.rb", <<-ROLES_MIGRATION.strip_heredoc
|
|
412
|
-
class InlineFormsCreateJoinTableUserRole < ActiveRecord::Migration[
|
|
435
|
+
class InlineFormsCreateJoinTableUserRole < ActiveRecord::Migration[8.0]
|
|
413
436
|
def self.up
|
|
414
437
|
create_table :roles_users, :id => false, :force => true do |t|
|
|
415
438
|
t.integer :role_id
|
|
@@ -837,7 +860,7 @@ if ENV['install_example'] == 'true'
|
|
|
837
860
|
sleep 1
|
|
838
861
|
add_owner_ts = Time.now.utc.strftime("%Y%m%d%H%M%S")
|
|
839
862
|
create_file "db/migrate/#{add_owner_ts}_add_owner_to_apartments.rb", <<-ADD_OWNER.strip_heredoc
|
|
840
|
-
class AddOwnerToApartments < ActiveRecord::Migration[
|
|
863
|
+
class AddOwnerToApartments < ActiveRecord::Migration[8.0]
|
|
841
864
|
def change
|
|
842
865
|
add_reference :apartments, :owner, null: true, foreign_key: true
|
|
843
866
|
end
|
|
@@ -916,7 +939,7 @@ if ENV['install_example'] == 'true'
|
|
|
916
939
|
sleep 1
|
|
917
940
|
seed_ts = Time.now.utc.strftime("%Y%m%d%H%M%S")
|
|
918
941
|
create_file "db/migrate/#{seed_ts}_seed_example_apartments_and_owners.rb", <<-SEED_MIGRATION.strip_heredoc
|
|
919
|
-
class SeedExampleApartmentsAndOwners < ActiveRecord::Migration[
|
|
942
|
+
class SeedExampleApartmentsAndOwners < ActiveRecord::Migration[8.0]
|
|
920
943
|
# ---------------------------------------------------------------
|
|
921
944
|
# Apartment seed gallery
|
|
922
945
|
# ---------------------------------------------------------------
|
|
@@ -29,6 +29,54 @@ module InlineFormsInstaller
|
|
|
29
29
|
INLINE_FORMS_VERSION
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
|
+
|
|
33
|
+
# When developing unreleased 8.x gems, point env at checkouts that contain
|
|
34
|
+
# built *.gem files so the installer can gem-install them into the app gemset.
|
|
35
|
+
def self.discover_prerelease_env!
|
|
36
|
+
if ENV["INLINE_FORMS_RELEASE_ROOT"].to_s == "" || ENV["VALIDATION_HINTS_ROOT"].to_s == ""
|
|
37
|
+
dir = gem_root
|
|
38
|
+
6.times do
|
|
39
|
+
if ENV["INLINE_FORMS_RELEASE_ROOT"].to_s == "" &&
|
|
40
|
+
File.file?(File.join(dir, "inline_forms.gemspec")) &&
|
|
41
|
+
Dir[File.join(dir, "inline_forms-*.gem")].any?
|
|
42
|
+
ENV["INLINE_FORMS_RELEASE_ROOT"] = dir
|
|
43
|
+
end
|
|
44
|
+
if ENV["VALIDATION_HINTS_ROOT"].to_s == "" &&
|
|
45
|
+
File.file?(File.join(dir, "validation_hints.gemspec")) &&
|
|
46
|
+
Dir[File.join(dir, "validation_hints-*.gem")].any?
|
|
47
|
+
ENV["VALIDATION_HINTS_ROOT"] = dir
|
|
48
|
+
end
|
|
49
|
+
parent = File.expand_path("..", dir)
|
|
50
|
+
break if parent == dir
|
|
51
|
+
dir = parent
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
if ENV["VALIDATION_HINTS_ROOT"].to_s == ""
|
|
56
|
+
sibling_vh = File.expand_path("../validation_hints", File.expand_path("..", gem_root))
|
|
57
|
+
ENV["VALIDATION_HINTS_ROOT"] = sibling_vh if File.directory?(sibling_vh)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
"INLINE_FORMS_RELEASE_ROOT" => "inline_forms",
|
|
62
|
+
"VALIDATION_HINTS_ROOT" => "validation_hints"
|
|
63
|
+
}.each do |env_key, repo_name|
|
|
64
|
+
next if ENV[env_key].to_s != ""
|
|
65
|
+
|
|
66
|
+
checkout = dev_checkout_with_gems(repo_name)
|
|
67
|
+
ENV[env_key] = checkout if checkout
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def self.dev_checkout_with_gems(repo_name)
|
|
72
|
+
[
|
|
73
|
+
File.expand_path("~/code/#{repo_name}"),
|
|
74
|
+
File.expand_path("~/#{repo_name}")
|
|
75
|
+
].uniq.find do |checkout|
|
|
76
|
+
File.file?(File.join(checkout, "#{repo_name}.gemspec")) &&
|
|
77
|
+
Dir[File.join(checkout, "#{repo_name}-*.gem")].any?
|
|
78
|
+
end
|
|
79
|
+
end
|
|
32
80
|
end
|
|
33
81
|
|
|
34
82
|
require "inline_forms_installer/creator"
|