From 015820efad98e6290dd171326eb091516c082129 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 3 Feb 2022 10:44:21 +0100 Subject: [PATCH] Files --- src/app.rb | 7 +------ src/func.rb | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) create mode 100644 src/func.rb diff --git a/src/app.rb b/src/app.rb index c7dc02a..5c4bd1d 100755 --- a/src/app.rb +++ b/src/app.rb @@ -7,12 +7,7 @@ require "sqlite3" require "sassc" require_relative "database.rb" - -def get_random_subtitle - subtitles = File.readlines "misc/subtitles.txt" - subtitles.sample.chomp -end - +require_relative "func.rb" get "/" do slim :index diff --git a/src/func.rb b/src/func.rb new file mode 100644 index 0000000..eee09a3 --- /dev/null +++ b/src/func.rb @@ -0,0 +1,4 @@ +def get_random_subtitle + subtitles = File.readlines "misc/subtitles.txt" + subtitles.sample.chomp +end