aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2011-03-23 21:49:33 -0400
committerRalph Amissah <ralph@amissah.com>2011-03-24 09:14:34 -0400
commit9e82ccef5eeb3228c7c958b049de4cbbf6b0d8a2 (patch)
treeecb8fccc7f527f6f5b6f98b36a5db973f94a5ad3 /bin
parentv2, v3: vim syntax highlighting, fix typo (diff)
v3, v2: bin/sisu*: v3 development ruby >=1.9.2p180; v2 maintenance ruby >=1.8.7
* bin/sisu* version checks
Diffstat (limited to 'bin')
-rw-r--r--bin/sisu92
-rw-r--r--bin/sisu393
-rw-r--r--bin/sisu_termsheet80
-rw-r--r--bin/sisu_webrick80
4 files changed, 258 insertions, 87 deletions
diff --git a/bin/sisu b/bin/sisu
index 5da17513..ceeebd6c 100644
--- a/bin/sisu
+++ b/bin/sisu
@@ -1,37 +1,73 @@
#!/usr/bin/env ruby
# encoding: utf-8
#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information
-#raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9'
-def check_sisu_stable_ruby_version?
- rbv_sisu_stable='1.8.7'
- if RUBY_VERSION < rbv_sisu_stable
- raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}"
+begin
+ def check_sisu_stable_ruby_version?
+ rbv_sisu_stable='1.8.7'
+ if RUBY_VERSION < rbv_sisu_stable
+ raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
end
-end
-def check_sisu_dev_ruby_version?
- rbv_sisu_dev='1.9.2'
- if RUBY_VERSION < rbv_sisu_dev
- raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}"
+ def check_sisu_dev_ruby_version?
+ rbv_sisu_dev='1.9.2'
+ if RUBY_VERSION < rbv_sisu_dev
+ raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
end
+ def check_incompatible_ruby_build?
+ require 'rbconfig'
+ e=Config::CONFIG
+ if RUBY_VERSION == '1.9.2' \
+ and e['PATCHLEVEL'].to_i < 180
+ raise <<WOK
+There are known issues with early versions of ruby1.9.2.
+Please, use Ruby 1.9.2p180 or later,
+current version #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+#{%x{ruby -v}.strip.to_s}
+
+WOK
+ end
+ end
+ $VERBOSE=nil
+ $KCODE='u' if RUBY_VERSION < '1.9'
+ argv=$*
+ SiSU_version_dir=case argv.inspect
+ when /--v2/
+ check_sisu_stable_ruby_version?
+ 'v2'
+ when /--v3/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ when /--dev/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ else
+ check_sisu_stable_ruby_version?
+ 'v2'
+ end
+ SiSU_lib="sisu/#{SiSU_version_dir}"
+ require "#{SiSU_lib}/hub"
+rescue
+ STDERR.puts 'ERROR'
+ STDERR.puts $!
+ STDERR.puts $@
+ require 'rbconfig'
+ e=Config::CONFIG
+ puts %{
+ #{%x{ruby -v}.strip.to_s}
+ #{RUBY_VERSION}
+ ruby version: #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+ ruby named: #{e['ruby_version']}
+ rubylib: #{e['rubylibdir']}
+ rubylib local: #{e['sitelibdir']}
+ }
+ system(%{echo "
+ system RUBYPATH: ${RUBYPATH}
+ system RUBYLIB: ${RUBYLIB}
+ "})
end
-check_sisu_stable_ruby_version?
-$VERBOSE=nil
-$KCODE='u' if RUBY_VERSION < '1.9'
-argv=$*
-SiSU_version_dir=case argv.inspect
-when /--v2/
- 'v2'
-when /--v3/
- check_sisu_dev_ruby_version?
- 'v3'
-when /--dev/
- check_sisu_dev_ruby_version?
- 'v3'
-else
- 'v2'
-end
-SiSU_lib="sisu/#{SiSU_version_dir}"
-require "#{SiSU_lib}/hub"
__END__
* Name: SiSU
diff --git a/bin/sisu3 b/bin/sisu3
index 359a8744..e3246376 100644
--- a/bin/sisu3
+++ b/bin/sisu3
@@ -1,38 +1,73 @@
#!/usr/bin/env ruby
# encoding: utf-8
#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information
-#raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9'
-def check_sisu_stable_ruby_version?
- rbv_sisu_stable='1.8.7'
- if RUBY_VERSION < rbv_sisu_stable
- raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}"
+begin
+ def check_sisu_stable_ruby_version?
+ rbv_sisu_stable='1.8.7'
+ if RUBY_VERSION < rbv_sisu_stable
+ raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
end
-end
-def check_sisu_dev_ruby_version?
- rbv_sisu_dev='1.9.2'
- if RUBY_VERSION < rbv_sisu_dev
- raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}"
+ def check_sisu_dev_ruby_version?
+ rbv_sisu_dev='1.9.2'
+ if RUBY_VERSION < rbv_sisu_dev
+ raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
end
+ def check_incompatible_ruby_build?
+ require 'rbconfig'
+ e=Config::CONFIG
+ if RUBY_VERSION == '1.9.2' \
+ and e['PATCHLEVEL'].to_i < 180
+ raise <<WOK
+There are known issues with early versions of ruby1.9.2.
+Please, use Ruby 1.9.2p180 or later,
+current version #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+#{%x{ruby -v}.strip.to_s}
+
+WOK
+ end
+ end
+ $VERBOSE=nil
+ $KCODE='u' if RUBY_VERSION < '1.9'
+ argv=$*
+ SiSU_version_dir=case argv.inspect
+ when /--v2/
+ check_sisu_stable_ruby_version?
+ 'v2'
+ when /--v3/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ when /--dev/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ else
+ check_sisu_dev_ruby_version?
+ 'v3'
+ end
+ SiSU_lib="sisu/#{SiSU_version_dir}"
+ require "#{SiSU_lib}/hub"
+rescue
+ STDERR.puts 'ERROR'
+ STDERR.puts $!
+ STDERR.puts $@
+ require 'rbconfig'
+ e=Config::CONFIG
+ puts %{
+ #{%x{ruby -v}.strip.to_s}
+ #{RUBY_VERSION}
+ ruby version: #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+ ruby named: #{e['ruby_version']}
+ rubylib: #{e['rubylibdir']}
+ rubylib local: #{e['sitelibdir']}
+ }
+ system(%{echo "
+ system RUBYPATH: ${RUBYPATH}
+ system RUBYLIB: ${RUBYLIB}
+ "})
end
-check_sisu_stable_ruby_version?
-$VERBOSE=nil
-$KCODE='u' if RUBY_VERSION < '1.9'
-argv=$*
-SiSU_version_dir=case argv.inspect
-when /--v2/
- 'v2'
-when /--v3/
- check_sisu_dev_ruby_version?
- 'v3'
-when /--dev/
- check_sisu_dev_ruby_version?
- 'v3'
-else
- check_sisu_dev_ruby_version?
- 'v3'
-end
-SiSU_lib="sisu/#{SiSU_version_dir}"
-require "#{SiSU_lib}/hub"
__END__
* Name: SiSU
diff --git a/bin/sisu_termsheet b/bin/sisu_termsheet
index 47af2dcc..10318191 100644
--- a/bin/sisu_termsheet
+++ b/bin/sisu_termsheet
@@ -1,22 +1,72 @@
#!/usr/bin/env ruby
# encoding: utf-8
#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information
-raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9'
-#raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4'
-$VERBOSE=nil
-argv=$*
-SiSU_version_dir=case argv.inspect
-when /--v2/
- 'v2'
-when /--v3/
- 'v3'
-when /--dev/
- 'v3'
-else
- 'v2'
+begin
+ def check_sisu_stable_ruby_version?
+ rbv_sisu_stable='1.8.7'
+ if RUBY_VERSION < rbv_sisu_stable
+ raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
+ end
+ def check_sisu_dev_ruby_version?
+ rbv_sisu_dev='1.9.2'
+ if RUBY_VERSION < rbv_sisu_dev
+ raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
+ end
+ def check_incompatible_ruby_build?
+ require 'rbconfig'
+ e=Config::CONFIG
+ if RUBY_VERSION == '1.9.2' \
+ and e['PATCHLEVEL'].to_i < 180
+ raise <<WOK
+There are known issues with early versions of ruby1.9.2.
+Please, use Ruby 1.9.2p180 or later,
+current version #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+#{%x{ruby -v}.strip.to_s}
+
+WOK
+ end
+ end
+ $VERBOSE=nil
+ argv=$*
+ SiSU_version_dir=case argv.inspect
+ when /--v2/
+ check_sisu_stable_ruby_version?
+ 'v2'
+ when /--v3/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ when /--dev/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ else
+ check_sisu_stable_ruby_version?
+ 'v2'
+ end
+ SiSU_lib="sisu/#{SiSU_version_dir}"
+ require "#{SiSU_lib}/termsheet"
+rescue
+ STDERR.puts 'ERROR'
+ STDERR.puts $!
+ STDERR.puts $@
+ require 'rbconfig'
+ e=Config::CONFIG
+ puts %{
+ #{%x{ruby -v}.strip.to_s}
+ #{RUBY_VERSION}
+ ruby version: #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+ ruby named: #{e['ruby_version']}
+ rubylib: #{e['rubylibdir']}
+ rubylib local: #{e['sitelibdir']}
+ }
+ system(%{echo "
+ system RUBYPATH: ${RUBYPATH}
+ system RUBYLIB: ${RUBYLIB}
+ "})
end
-SiSU_lib="sisu/#{SiSU_version_dir}"
-require "#{SiSU_lib}/termsheet"
__END__
* Name: SiSU
diff --git a/bin/sisu_webrick b/bin/sisu_webrick
index 1b2a724c..8f79a51f 100644
--- a/bin/sisu_webrick
+++ b/bin/sisu_webrick
@@ -1,22 +1,72 @@
#!/usr/bin/env ruby
# encoding: utf-8
#SiSU: copyright (C) 1997 - 2011 Ralph Amissah; License GPL, see appended program information
-raise "Please, use Ruby1.8 (1.8.4 or later), current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4' or RUBY_VERSION > '1.9'
-#raise "Please, use Ruby1.8.4 or later, current Ruby #{RUBY_VERSION}" if RUBY_VERSION < '1.8.4'
-$VERBOSE=nil
-argv=$*
-SiSU_version_dir=case argv.inspect
-when /--v2/
- 'v2'
-when /--v3/
- 'v3'
-when /--dev/
- 'v3'
-else
- 'v2'
+begin
+ def check_sisu_stable_ruby_version?
+ rbv_sisu_stable='1.8.7'
+ if RUBY_VERSION < rbv_sisu_stable
+ raise "Please, use Ruby#{rbv_sisu_stable} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
+ end
+ def check_sisu_dev_ruby_version?
+ rbv_sisu_dev='1.9.2'
+ if RUBY_VERSION < rbv_sisu_dev
+ raise "Please, use Ruby#{rbv_sisu_dev} or later, current Ruby #{RUBY_VERSION}"
+ else check_incompatible_ruby_build?
+ end
+ end
+ def check_incompatible_ruby_build?
+ require 'rbconfig'
+ e=Config::CONFIG
+ if RUBY_VERSION == '1.9.2' \
+ and e['PATCHLEVEL'].to_i < 180
+ raise <<WOK
+There are known issues with early versions of ruby1.9.2.
+Please, use Ruby 1.9.2p180 or later,
+current version #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+#{%x{ruby -v}.strip.to_s}
+
+WOK
+ end
+ end
+ $VERBOSE=nil
+ argv=$*
+ SiSU_version_dir=case argv.inspect
+ when /--v2/
+ check_sisu_stable_ruby_version?
+ 'v2'
+ when /--v3/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ when /--dev/
+ check_sisu_dev_ruby_version?
+ 'v3'
+ else
+ check_sisu_stable_ruby_version?
+ 'v2'
+ end
+ SiSU_lib="sisu/#{SiSU_version_dir}"
+ require "#{SiSU_lib}/webrick"
+rescue
+ STDERR.puts 'ERROR'
+ STDERR.puts $!
+ STDERR.puts $@
+ require 'rbconfig'
+ e=Config::CONFIG
+ puts %{
+ #{%x{ruby -v}.strip.to_s}
+ #{RUBY_VERSION}
+ ruby version: #{e['RUBY_PROGRAM_VERSION']}p#{e['PATCHLEVEL']}
+ ruby named: #{e['ruby_version']}
+ rubylib: #{e['rubylibdir']}
+ rubylib local: #{e['sitelibdir']}
+ }
+ system(%{echo "
+ system RUBYPATH: ${RUBYPATH}
+ system RUBYLIB: ${RUBYLIB}
+ "})
end
-SiSU_lib="sisu/#{SiSU_version_dir}"
-require "#{SiSU_lib}/webrick"
__END__
* Name: SiSU