From 3b6cf68dde051b3221d4137437b4b28b46edf70f Mon Sep 17 00:00:00 2001 From: sandyx Date: Thu, 20 Feb 2025 15:58:49 -0600 Subject: [PATCH] CC as env variable --- install.rb | 6 ++- rub | 58 ++++++++++++++++------ templates.rb | 59 ++++++++++++++++++++++ templates/c.rb | 95 ++++++++++++++++++++++++++++++++++++ build.rb => templates/cpp.rb | 6 +-- test.rb | 6 +++ 6 files changed, 209 insertions(+), 21 deletions(-) create mode 100644 templates.rb create mode 100755 templates/c.rb rename build.rb => templates/cpp.rb (95%) mode change 100755 => 100644 create mode 100644 test.rb diff --git a/install.rb b/install.rb index 93febe9..0b75ecb 100644 --- a/install.rb +++ b/install.rb @@ -2,10 +2,12 @@ require 'fileutils' -RUBDIR = "#{Dir.home}/.rub/" +RUBDIR = "#{Dir.home}/.rub" +TMPLDIR = "#{RUBDIR}/rub/templates" File.mkdir RUBDIR unless File.exist? RUBDIR -FileUtils.cp("build.rb", RUBDIR) +FileUtils.cp_r(TMPLDIR, RUBDIR) +FileUtils.cp("templates.rb", RUBDIR) FileUtils.chmod("+x", "rub") FileUtils.cp("rub", "/usr/local/bin") #FileUtils.cp_r(Dir.pwd, RUBDIR) diff --git a/rub b/rub index e73e4b8..492a151 100755 --- a/rub +++ b/rub @@ -3,18 +3,23 @@ require 'fileutils' HELP = "rub init - initialize a new project\n" \ + "rub init [-t, --template]