2
# tk/package.rb : package command
10
TkCommandNames = ['package'.freeze].freeze
13
Tk::AUTO_PATH.value = Tk::AUTO_PATH.to_a << path
17
tk_call('package', 'forget', package)
21
def if_needed(pkg, ver, *arg, &b)
26
procedure(tk_call('package', 'ifneeded', pkg, ver))
31
tk_call('package', 'ifneeded', pkg, ver, cmd)
38
tk_call('package', 'ifneeded', pkg, ver, cmd)
42
tk_call('package', 'ifneeded', pkg, ver, '')
47
fail ArgumentError, 'too many arguments'
52
tk_split_simplelist(tk_call('package', 'names'))
55
def provide(package, version=nil)
57
tk_call('package', 'provide', package, version)
59
if (ret = tk_call('package', 'provide', package)) == ''
66
def present(package, version=None)
68
tk_call('package', 'present', package, version)
70
fail e.class, 'TkPackage ' << e.message
74
def present_exact(package, version)
76
tk_call('package', 'present', '-exact', package, version)
78
fail e.class, 'TkPackage ' << e.message
82
def require(package, version=None)
84
tk_call('package', 'require', package, version)
86
fail e.class, 'TkPackage ' << e.message
90
def require_exact(package, version)
92
tk_call('package', 'require', '-exact', package, version)
94
fail e.class, 'TkPackage ' << e.message
98
def unknown_proc(*arg, &b)
103
procedure(tk_call('package', 'unknown'))
108
tk_call('package', 'unknown', cmd)
115
tk_call('package', 'unknown', cmd)
119
tk_call('package', 'unknown', '')
124
fail ArgumentError, 'too many arguments'
128
def versions(package)
129
tk_split_simplelist(tk_call('package', 'versions', package))
132
def vcompare(version1, version2)
133
number(tk_call('package', 'vcompare', version1, version2))
136
def vsatisfies(version1, version2)
137
bool(tk_call('package', 'vsatisfies', version1, version2))