Top Level Namespace
- Includes:
- Config
Defined Under Namespace
Modules: RDocF95, RubyToken Classes: Hash, MathMLWrapper, RubyLex
Constant Summary collapse
- OPTS =
{}
Instance Method Summary collapse
-
#installBIN(from, opfile) ⇒ Object
Install a binary file.
Instance Method Details
#installBIN(from, opfile) ⇒ Object
Install a binary file. We patch in on the way through to insert a #! line. If this is a Unix install, we name the command (for example) ‘rdoc-f95’ and let the shebang line handle running it. Under windows, we add a ‘.rb’ extension and let file associations to their stuff
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rdoc-f95/install.rb', line 18 def installBIN(from, opfile) tmp_dir = nil [".", "/tmp", "c:/temp", $bindir].each{|t| stat = File.stat(t) rescue next if stat.directory? and stat.writable? tmp_dir = t break end } fail "Cannot find a temporary directory" unless tmp_dir tmp_file = File.join(tmp_dir, "_tmp") File.open(from) do |ip| File.open(tmp_file, "w") do |op| ruby = File.join($realbindir, $ruby) # op.puts "#!#{ruby}" op.write ip.read end end opfile += ".rb" if CONFIG["target_os"] =~ /mswin/i FileUtils::makedirs($bindir, {:verbose => true}) FileUtils::install(tmp_file, File.join($bindir, opfile), {:mode => 0755, :verbose => true}) FileUtils::safe_unlink(tmp_file) end |