Skip to content

Commit

Permalink
Removed memoization for prompts_path
Browse files Browse the repository at this point in the history
  • Loading branch information
kladaFOX committed Oct 11, 2024
1 parent 670bb42 commit 0c0be61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/spectre/prompt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class << self
attr_reader :prompts_path

def prompts_path
@prompts_path ||= detect_prompts_path
@prompts_path = detect_prompts_path
end

# Render a prompt by reading and rendering the YAML template
Expand Down Expand Up @@ -69,8 +69,8 @@ def find_project_root(dir)
while dir != '/' do
# Check for Gemfile, .git directory, or config/application.rb (Rails)
return dir if File.exist?(File.join(dir, 'Gemfile')) ||
File.directory?(File.join(dir, '.git')) ||
File.exist?(File.join(dir, 'config', 'application.rb'))
File.exist?(File.join(dir, 'config', 'application.rb')) ||
File.directory?(File.join(dir, '.git'))

# Move up one directory
dir = File.expand_path('..', dir)
Expand Down

0 comments on commit 0c0be61

Please sign in to comment.