Make executable Ruby gem

This commit is contained in:
Pistos 2021-09-18 02:20:25 -05:00
parent ea65d2e74a
commit 5c99437dfe
4 changed files with 47 additions and 7 deletions

View file

@ -5,6 +5,7 @@ Diakonos Changelog
- Handle symlink cycles when fuzzy file finding (file open)
- Fix language switch display bug
- Made Diakonos installable via gem
0.9.7
- Added ability to move lines up or down.

30
diakonos.gemspec Normal file
View file

@ -0,0 +1,30 @@
Gem::Specification.new do |s|
s.add_runtime_dependency "curses", "1.4.1"
s.authors = ["Pistos"]
s.bindir = "bin"
s.description = "Diakonos is a console text editor for the masses."
s.email = "diakonos dawt pistos aet purepistos dawt net"
s.executables = "diakonos"
s.files = [
"CHANGELOG",
"diakonos.conf",
"diakonos-256-colour.conf",
"LICENCE.md",
"bin/diakonos",
] +
Dir["help/*"] +
Dir["lib/**/*.rb"]
s.homepage = "https://git.sr.ht/~pistos/diakonos"
s.license = "GPL-3.0-only"
s.metadata = {
"changelog_uri" => "https://git.sr.ht/~pistos/diakonos/tree/master/item/CHANGELOG",
"homepage_uri" => "https://git.sr.ht/~pistos/diakonos",
"source_code_uri" => "https://git.sr.ht/~pistos/diakonos",
}
s.name = "diakonos"
s.required_ruby_version = ">= 2.6", "< 4"
s.summary = "Console text editor for the masses"
s.version = "0.9.8"
end

View file

@ -20,6 +20,13 @@ module Diakonos
"### #{e} (NOT LOADED)"
}.join( "\n" )
installation_artifact = File.join(inst[:lib_dir], 'diakonos', 'installation.rb')
if File.exist?(installation_artifact)
install_time = File.mtime(installation_artifact)
else
install_time = "--"
end
f.puts %{
# About Diakonos
@ -30,7 +37,7 @@ Copyright: Copyright (c) 2004-#{ Time.now.year } Pistos
Version: #{ ::Diakonos::VERSION }
Code Date: #{ ::Diakonos::LAST_MODIFIED }
Install Time: #{ File.mtime( File.join( inst[ :lib_dir ], 'diakonos', 'installation.rb' ) ) }
Install Time: #{ install_time }
Ruby Version: #{ ::RUBY_VERSION }
## Paths

View file

@ -2,13 +2,15 @@
# This copy is here to permit the tests to execute.
module Diakonos
root = File.expand_path("../..", __dir__)
INSTALL_SETTINGS = {
:prefix => '.',
:bin_dir => 'bin',
:doc_dir => '.',
:help_dir => 'help',
:conf_dir => '.',
:lib_dir => 'lib',
:prefix => root,
:bin_dir => File.join(root, "bin"),
:doc_dir => root,
:help_dir => File.join(root, "help"),
:conf_dir => root,
:lib_dir => File.join(root, "lib"),
:installed => {
:files => [],
:dirs => [],