We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d096d71 commit a9ede30Copy full SHA for a9ede30
lib/langchainrb_rails/generators/langchainrb_rails/assistant_generator.rb
@@ -83,9 +83,8 @@ def copy_stylesheets
83
# TODO: Depending on the LLM provider, we may need to add additional gems
84
def add_to_gemfile
85
gem_name = "turbo-rails"
86
- gemfile_content = File.read(Rails.root.join("Gemfile"))
87
88
- if gemfile_content.include?(gem_name)
+ if gem_exists?(gem_name)
89
say_status :skipped, "#{gem_name} already exists in Gemfile"
90
else
91
inside Rails.root do
@@ -102,6 +101,10 @@ def post_install_message
102
101
103
private
104
+ def gem_exists?(gem_name)
105
+ File.read(Rails.root.join("Gemfile")).include?(gem_name)
106
+ end
107
+
108
# @return [String] LLM provider to use
109
def llm
110
options["llm"]
0 commit comments