From 899e8f5b3a76d0a00274233cdfd0ef107f6a94ca Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sat, 27 Jan 2024 23:49:40 -0300 Subject: [PATCH] README: update --- README.md | 6 +++--- twenty-backend/lib/twenty-backend.rb | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3abfaeb..8def0a0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## About Twenty helps you manage your projects with a web application -that runs on your computer with a minimal amount of effort. +that runs on your computer. ## Features @@ -45,8 +45,8 @@ that runs on your computer with a minimal amount of effort. ## Install -Eventually I hope to publish twenty as a RubyGem. For the time -being installing from source will have to do. +Eventually I hope to publish twenty as a RubyGem.
+For the time being installing from source will have to do. ## License diff --git a/twenty-backend/lib/twenty-backend.rb b/twenty-backend/lib/twenty-backend.rb index d606571..5102c5b 100644 --- a/twenty-backend/lib/twenty-backend.rb +++ b/twenty-backend/lib/twenty-backend.rb @@ -8,19 +8,20 @@ module Twenty require_relative "twenty-backend/servlet" require_relative "twenty-backend/migration" require_relative "twenty-backend/model" + extend FileUtils ## # @return [String] # Returns the directory where twenty stores data. - def self.home + def self.data_dir File.join(Dir.home, ".local", "share", "20") end ## # @return [String] - # Returns the default SQLite database. + # Returns the location of the default SQLite database. def self.default_database - @default_database ||= File.join(home, "database.sqlite") + @default_database ||= File.join(data_dir, "database.sqlite") end ## @@ -44,8 +45,8 @@ module Twenty # @api private def self.prepare_dir return if File.exist?(default_database) - FileUtils.mkdir_p(home) - FileUtils.touch(default_database) + mkdir_p(data_dir) + touch(default_database) rescue => ex warn "prepare_dir error: #{ex.message} (#{ex.class})" end