aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v6/utils_response.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-08-08 00:10:22 -0400
committerRalph Amissah <ralph@amissah.com>2014-08-08 00:10:22 -0400
commit39e11a4420226c3238e787de5be1c9279f46cf1f (patch)
treebd6a5b4d5f90538ab390709cd003f207c7c1b451 /lib/sisu/v6/utils_response.rb
parentv5 v6: version & changelog (& rakefile) (diff)
v5 v6: code file renames, fairly extensive
* v5 file renames sync with v6 for easier comparison * v5 here (5.5.6) remains as in previous version (5.5.5)
Diffstat (limited to 'lib/sisu/v6/utils_response.rb')
-rw-r--r--lib/sisu/v6/utils_response.rb79
1 files changed, 79 insertions, 0 deletions
diff --git a/lib/sisu/v6/utils_response.rb b/lib/sisu/v6/utils_response.rb
new file mode 100644
index 00000000..59037c2e
--- /dev/null
+++ b/lib/sisu/v6/utils_response.rb
@@ -0,0 +1,79 @@
+# encoding: utf-8
+=begin
+
+ * Name: SiSU
+
+ * Description: a framework for document structuring, publishing and search
+
+ * Author: Ralph Amissah
+
+ * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
+ 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Ralph Amissah,
+ All Rights Reserved.
+
+ * License: GPL 3 or later:
+
+ SiSU, a framework for document structuring, publishing and search
+
+ Copyright (C) Ralph Amissah
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the Free
+ Software Foundation, either version 3 of the License, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ more details.
+
+ You should have received a copy of the GNU General Public License along with
+ this program. If not, see <http://www.gnu.org/licenses/>.
+
+ If you have Internet connection, the latest version of the GPL should be
+ available at these locations:
+ <http://www.fsf.org/licensing/licenses/gpl.html>
+ <http://www.gnu.org/licenses/gpl.html>
+
+ <http://www.sisudoc.org/sisu/en/manifest/gpl.fsf.html>
+
+ * SiSU uses:
+ * Standard SiSU markup syntax,
+ * Standard SiSU meta-markup syntax, and the
+ * Standard SiSU object citation numbering and system
+
+ * Hompages:
+ <http://www.jus.uio.no/sisu>
+ <http://www.sisudoc.org>
+
+ * Download:
+ <http://www.sisudoc.org/sisu/en/SiSU/download.html>
+
+ * Git
+ <http://sources.sisudoc.org/gitweb/?p=code/sisu.git;a=summary>
+ <http://sources.sisudoc.org/?p=code/sisu.git;a=blob;f=lib/sisu/v6/utils_response.rb;hb=HEAD>
+
+ * Ralph Amissah
+ <ralph@amissah.com>
+ <ralph.amissah@gmail.com>
+
+ ** Description: Request response
+
+=end
+module SiSU_Response
+ class Response
+ def response?(ask) #move to more appropriate directory later
+ response='redo'
+ print ask + " ['yes', 'no' or 'quit']: "
+ response=File.new('/dev/tty').gets.strip
+ ans=if response=='yes' then true
+ elsif response=='no' then false
+ elsif response =~/^quit|exit$/ then exit
+ else puts "[please type: 'yes', 'no' or 'quit']"
+ response?(ask)
+ end
+ ans
+ end
+ end
+end
+__END__