Module: ZergXcode::Plugins

Defined in:
lib/zerg_xcode/plugins/core/core.rb

Defined Under Namespace

Classes: Addlibrary, Help, Import, Irb, Ls, Lstargets, Retarget

Class Method Summary collapse

Class Method Details

.allObject


4
5
6
7
8
9
10
# File 'lib/zerg_xcode/plugins/core/core.rb', line 4

def self.all
  plugin_dir = File.join(File.dirname(__FILE__), '..')
  plugins = Dir.entries(plugin_dir).select { |entry|
    /^[^_].*\.rb$/ =~ entry 
  }.map { |entry| entry[0..-4] }
  return Set.new(plugins)
end

.get(plugin_name) ⇒ Object


20
21
22
23
# File 'lib/zerg_xcode/plugins/core/core.rb', line 20

def self.get(plugin_name)
  self.require plugin_name
  ZergXcode::Plugins.const_get(plugin_name.capitalize).new
end

.help(plugin_name) ⇒ Object


29
30
31
# File 'lib/zerg_xcode/plugins/core/core.rb', line 29

def self.help(plugin_name)
  self.get(plugin_name).help
end

.require(plugin_name) ⇒ Object


16
17
18
# File 'lib/zerg_xcode/plugins/core/core.rb', line 16

def self.require(plugin_name)
  Kernel.require "zerg_xcode/plugins/#{plugin_name}.rb"
end

.require_allObject


12
13
14
# File 'lib/zerg_xcode/plugins/core/core.rb', line 12

def self.require_all
  all.each { |plugin| self.require plugin }
end

.run(plugin_name, args) ⇒ Object


25
26
27
# File 'lib/zerg_xcode/plugins/core/core.rb', line 25

def self.run(plugin_name, args)
  self.get(plugin_name).run args
end