File: sur

package info (click to toggle)
subtle 0.11.3224-xi-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,132 kB
  • sloc: ansic: 14,702; ruby: 3,101; makefile: 17; sh: 8
file content (50 lines) | stat: -rw-r--r-- 1,159 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
47
48
49
50
#!/usr/bin/ruby
# -*- encoding: utf-8 -*-
#
# @package sur
#
# @file SUR - Subtle User Repository
# @author Christoph Kappel <unexist@subforge.org>
# @version $Id: sur.rb,v 7 2009/09/07 21:25:11 unexist $
#
# This program can be distributed under the terms of the GNU GPLv2.
# See the file COPYING for details.
#

begin
  require "subtle/sur/version"
  require "subtle/sur/runner"

  # Clone to change
  args = ARGV.clone

  Subtle::Sur::Runner.new.run(args)
rescue LoadError => error
  missing = error.to_s.split(" ").last

  # Check missing files
  if "archive/tar/minitar" == missing
    missing = "archive-tar-minitar"
  elsif missing.match("subtle")
    puts <<EOF
>>> ERROR: Cannot find runtime files of sur
>>>        Please make sure that you installed subtle into the
>>>        current ruby environment (#{RUBY_VERSION})
EOF
    exit
  end

  puts <<EOF
>>> ERROR: Cannot find the gem `#{missing}'
>>>        Please install it with following command:
>>>        gem install #{missing}
EOF
rescue => error
  puts ">>> ERROR: #{error}"

  unless error.is_a?(RuntimeError)
    puts error.backtrace
  end
end

# vim:ts=2:bs=2:sw=2:et:fdm=marker:ft=ruby