diff --git a/bin/rails b/bin/rails index 9914fc1..26266c7 100755 --- a/bin/rails +++ b/bin/rails @@ -25,7 +25,7 @@ end if items.empty? items = search.versions.map do |version| { - uid: search.uid, + uid: SecureRandom.uuid, type: 'default', arg: query, subtitle: "Search #{version} #{search.query}", diff --git a/lib/file_cache.rb b/lib/file_cache.rb index ce57222..a1ffcf6 100644 --- a/lib/file_cache.rb +++ b/lib/file_cache.rb @@ -10,9 +10,9 @@ class FileCache class Error < StandardError; end + VERSION = '1'.freeze CACHE_DIR = "#{ENV['TMPDIR'] || ENV['TMP'] || ENV['TEMP']}ruby_and_rails_api_docs_#{VERSION}".freeze MAX_EXPIRES_IN = 60 * 60 * 24 * 30 # 1 month - VERSION = '1'.freeze attr_reader :key, :expires_in, :compress, :dir_path diff --git a/lib/rails_search_doc.rb b/lib/rails_search_doc.rb index addb839..4da2c81 100644 --- a/lib/rails_search_doc.rb +++ b/lib/rails_search_doc.rb @@ -28,6 +28,10 @@ def title "v#{version} #{klass}" end + def uid + Base64.encode64(title).strip + end + def description self[:description].gsub!(/<\S+>/, '') presence(self[:description])