/usr/lib/ruby/1.8/svg/misc.rb is in libsvg-ruby1.8 1.0.3-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #==============================================================================#
# svg/misc.rb
# $Id: misc.rb,v 1.6 2003/02/06 14:59:43 yuya Exp $
#==============================================================================#
#==============================================================================#
# SVG Module
module SVG
#============================================================================#
# Point Class
class Point
def initialize(x, y)
@x = x
@y = y
end
attr_accessor :x, :y
def self.[](*points)
if points.size % 2 == 0
return (0...(points.size / 2)).collect { |i|
self.new(points[i * 2], points[i * 2 + 1])
}
else
raise ArgumentError, 'odd number args for Point'
end
end
def to_s
return "#{@x} #{@y}"
end
end # Point
#============================================================================#
# ArrayMixin Module
module ArrayMixin
include Enumerable
def array
raise NotImplementedError
end
private :array
def [](index)
array[index]
end
def []=(index, value)
array[index] = value
end
def <<(other)
array << other
end
def clear
array.clear
end
def first
array.first
end
def last
array.last
end
def each(&block)
array.each(&block)
end
end # ArrayMixin
end # SVG
#==============================================================================#
#==============================================================================#
|