Module: GemWrappers
- Defined in:
- lib/gem-wrappers.rb,
lib/gem-wrappers/version.rb,
lib/gem-wrappers/installer.rb,
lib/gem-wrappers/environment.rb,
lib/gem-wrappers/specification.rb
Defined Under Namespace
Modules: Specification
Classes: Environment, Exception, Installer, NoWrapper
Constant Summary
collapse
- VERSION =
"1.4.0"
Class Method Summary
collapse
Class Method Details
.environment ⇒ Object
9
10
11
|
# File 'lib/gem-wrappers.rb', line 9
def self.environment
@environment ||= GemWrappers::Environment.new
end
|
.environment_file ⇒ Object
60
61
62
|
# File 'lib/gem-wrappers.rb', line 60
def self.environment_file
environment.file_name
end
|
.gems_executables ⇒ Object
55
56
57
58
|
# File 'lib/gem-wrappers.rb', line 55
def self.gems_executables
@executables ||= GemWrappers::Specification.installed_gems.map{|gem| gem.executables }.inject{|sum, n| sum + n }.uniq || []
end
|
.install(executables) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/gem-wrappers.rb', line 17
def self.install(executables)
environment.ensure
installer.ensure
executables.each do |executable|
installer.install(executable)
end
ruby_executables.each do |executable|
installer.install(executable)
end
end
|
.installed_wrappers ⇒ Object
51
52
53
|
# File 'lib/gem-wrappers.rb', line 51
def self.installed_wrappers
executables_in_directory(wrappers_path).sort.uniq
end
|
.installer ⇒ Object
13
14
15
|
# File 'lib/gem-wrappers.rb', line 13
def self.installer
@installer ||= GemWrappers::Installer.new(environment_file)
end
|
.uninstall(executables) ⇒ Object
31
32
33
34
35
36
|
# File 'lib/gem-wrappers.rb', line 31
def self.uninstall(executables)
executables.each do |executable|
installer.uninstall(executable)
end
end
|
.wrapper_path(exe) ⇒ Object
42
43
44
45
46
47
48
49
|
# File 'lib/gem-wrappers.rb', line 42
def self.wrapper_path(exe)
file = File.join(wrappers_path, exe)
if executable?(file)
file
else
raise GemWrappers::NoWrapper, "No wrapper: #{file}"
end
end
|
.wrappers_path ⇒ Object
38
39
40
|
# File 'lib/gem-wrappers.rb', line 38
def self.wrappers_path
installer.wrappers_path
end
|