File: load.rb

package info (click to toggle)
ruby-rghost 0.9.9-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,188 kB
  • sloc: ruby: 3,374; makefile: 6; sh: 1
file content (37 lines) | stat: -rw-r--r-- 1,208 bytes parent folder | download
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
require "rghost/ps_object"
module RGhost::Load
  # Loads library
  def self.library(name, type = :ps)
    # PsObject.new File.open(File.dirname(__FILE__)+File::SEPARATOR+type.to_s+File::SEPARATOR+name.to_s+"."+type.to_s).readlines.join("")

    RGhost::PsObject.new("(#{name}.#{type}) runlibfile\n")
  end

  def self.rg_enviroment
    RGhost::PsObject.new do
      raw RGhost::Load.library(:basic)
      raw RGhost::Load.library(:cursor)
      raw RGhost::Load.library(:rectangle)
      raw RGhost::Load.library(:font)
      raw RGhost::Load.library(:textarea)
      raw RGhost::Load.library(:horizontal_line)
      raw RGhost::Load.library(:vertical_line)
      raw RGhost::Load.library(:callbacks)
      raw RGhost::Load.library(:show)
      raw RGhost::Load.library(:eps)
      raw RGhost::Load.library(:jpeg)
      raw RGhost::Load.library(:gif)
      raw RGhost::Load.library(:begin_document)
      raw RGhost::Load.library(:datagrid)
      raw RGhost::Load.library(:text)
      raw RGhost::Load.library(:frame)
      raw RGhost::Load.library(:link)
      raw RGhost::Load.library(:rect_link)
    end
  end

  # Loads binary library
  def self.binary(path)
    File.open(path).readlines.join
  end
end