Skip to content

Commit 451bdba

Browse files
committed
Make tilt an optional dependency
1 parent f54e54f commit 451bdba

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

lib/generators/rodauth/install_generator.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ def create_rodauth_app
4040

4141
def add_gems
4242
if activerecord? && !sequel?
43-
gem "sequel-activerecord_connection", "~> 2.0"
44-
gem "after_commit_everywhere", "~> 1.1" if ActiveRecord.version < Gem::Version.new("7.2")
43+
gem "sequel-activerecord_connection", "~> 2.0", comment: "Enables Sequel to use Active Record's database connection"
44+
gem "after_commit_everywhere", "~> 1.1", comment: "Required for Sequel's transaction hooks to work in all cases (on Active Record < 7.2)" if ActiveRecord.version < Gem::Version.new("7.2")
4545
end
4646
unless argon2?
47-
gem "bcrypt", "~> 3.1"
47+
gem "bcrypt", "~> 3.1", comment: "Used by Rodauth for password hashing"
4848
end
49+
gem "tilt", "~> 2.4", comment: "Used by Rodauth for rendering built-in view and email templates"
4950
end
5051

5152
def create_rodauth_controller

rodauth-rails.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
2020
spec.add_dependency "rodauth", "~> 2.36"
2121
spec.add_dependency "roda", "~> 3.76"
2222
spec.add_dependency "rodauth-model", "~> 0.2"
23-
spec.add_dependency "tilt"
2423

24+
spec.add_development_dependency "tilt"
2525
spec.add_development_dependency "bcrypt", "~> 3.1"
2626
spec.add_development_dependency "jwt"
2727
spec.add_development_dependency "rotp"

test/generators/install_generator_test.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
6363
assert_file "app/misc/rodauth_main.rb", /# accounts_table :users/
6464

6565
assert_file "Gemfile", /gem "bcrypt", "~> 3.1"/
66+
assert_file "Gemfile", /gem "tilt", "~> 2.4"/
6667
end
6768

6869
test "app with --json option" do

0 commit comments

Comments
 (0)