~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to ext/tk/lib/tkextlib/trofs/trofs.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2006-05-08 22:23:12 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060508222312-w2wqeaz030ifi59j
Tags: 1.9.0+20060423-3ubuntu1
* Resynchronized with Debian.
* Only change from Debian is the addition of
  debian/patches/903_sparc_fix_define.patch to fix illegal instructions
  at runtime on sparc. (change from 1.9.0+20050921-1ubuntu1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
#  tkextlib/trofs/trofs.rb
 
3
#                               by Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)
 
4
#
 
5
 
 
6
require 'tk'
 
7
 
 
8
# call setup script for general 'tkextlib' libraries
 
9
require 'tkextlib/setup.rb'
 
10
 
 
11
# call setup script
 
12
require 'tkextlib/trofs/setup.rb'
 
13
 
 
14
# TkPackage.require('trofs', '0.4')
 
15
TkPackage.require('trofs')
 
16
 
 
17
module Tk
 
18
  module Trofs
 
19
    extend TkCore
 
20
 
 
21
    PACKAGE_NAME = 'trofs'.freeze
 
22
    def self.package_name
 
23
      PACKAGE_NAME
 
24
    end
 
25
 
 
26
    def self.package_version
 
27
      begin
 
28
        TkPackage.require('trofs')
 
29
      rescue
 
30
        ''
 
31
      end
 
32
    end
 
33
 
 
34
    ##############################################
 
35
 
 
36
    def self.create_archive(dir, archive)
 
37
      tk_call('::trofs::archive', dir, archive)
 
38
      archive
 
39
    end
 
40
 
 
41
    def self.mount(archive, mountpoint=None)
 
42
      # returns the normalized path to mountpoint
 
43
      tk_call('::trofs::mount', archive, mountpoint)
 
44
    end
 
45
 
 
46
    def self.umount(mountpoint)
 
47
      tk_call('::trofs::umount', mountpoint)
 
48
      mountpoint
 
49
    end
 
50
  end
 
51
end