Strict Standards: Non-static method phpbb_feed_factory::init() should not be called statically in /home/jacius/rubygame/forums/feed.php on line 66
[phpBB Debug] PHP Notice: in file /feed.php on line 171: Cannot modify header information - headers already sent by (output started at /feed.php:66)
[phpBB Debug] PHP Notice: in file /feed.php on line 172: Cannot modify header information - headers already sent by (output started at /feed.php:66)
Rubygame Forums 2009-02-15T18:34:35+00:00 http://rubygame.org/forums/feed.php?f=4&t=17 2009-02-15T18:34:35+00:00 http://rubygame.org/forums/viewtopic.php?t=17&p=30#p30 <![CDATA[ruby 1.8/1.9 switcher script]]>
sudo setruby.rb -v
shows current version

sudo setruby.rb 1.8
switches to 1.8

sudo setruby.rb 1.9
switches to 1.9

Code:
#!/usr/bin/env ruby
# script to toggle between ruby 1.8 and ruby 1.9
RUBY_ONE_EIGHT = [
'/usr/local/bin/gem1.8',
'/usr/local/bin/gem_mirror1.8',
'/usr/local/bin/gem_server1.8',
'/usr/local/bin/gemlock1.8',
'/usr/local/bin/gemri1.8',
'/usr/local/bin/gemwhich1.8',
'/usr/local/bin/irb1.8',
'/usr/local/bin/rake1.8',
'/usr/local/bin/ri1.8',
'/usr/local/bin/ruby1.8',
'/Users/sanderson/bin/rsdl1.8'
]

RUBY_ONE_NINE = [
'/usr/local/bin/gem1.9',
'/usr/local/bin/irb1.9',
'/usr/local/bin/ri1.9',
'/usr/local/bin/ruby1.9',
'/usr/local/bin/rake1.9',
'/Users/sanderson/bin/rsdl1.9'
]

VERSIONS = {
  '1.8' => RUBY_ONE_EIGHT,
  '1.9' => RUBY_ONE_NINE
}

target_version = ARGV[0]
if target_version.nil?
  version = `ruby -v`.strip
  puts "CURRENT VERSION IS: #{version}"
  exit 0
end

for ver,files in VERSIONS.select{|k,v|k!=target_version}
  for file in files
    symlink = file.chomp(ver)
    File.delete(symlink) if File.exist?(symlink)

  end
end

for ver,files in VERSIONS.select{|k,v|k==target_version}
  for file in files
    symlink = file.chomp(ver)
    File.delete(symlink) if File.exist?(symlink)
    File.symlink(file,symlink) if File.exist?(file)
  end
end

Statistics: Posted by shawn42 — Sun Feb 15, 2009 6:34 pm


]]>