Skip to content

Commit a9ede30

Browse files
Fix this
1 parent d096d71 commit a9ede30

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/langchainrb_rails/generators/langchainrb_rails/assistant_generator.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ def copy_stylesheets
8383
# TODO: Depending on the LLM provider, we may need to add additional gems
8484
def add_to_gemfile
8585
gem_name = "turbo-rails"
86-
gemfile_content = File.read(Rails.root.join("Gemfile"))
8786

88-
if gemfile_content.include?(gem_name)
87+
if gem_exists?(gem_name)
8988
say_status :skipped, "#{gem_name} already exists in Gemfile"
9089
else
9190
inside Rails.root do
@@ -102,6 +101,10 @@ def post_install_message
102101

103102
private
104103

104+
def gem_exists?(gem_name)
105+
File.read(Rails.root.join("Gemfile")).include?(gem_name)
106+
end
107+
105108
# @return [String] LLM provider to use
106109
def llm
107110
options["llm"]

0 commit comments

Comments
 (0)