Module: ZergXcode::Plugins

Defined in:
lib/zerg_xcode/plugins/ls.rb,
lib/zerg_xcode/plugins/irb.rb,
lib/zerg_xcode/plugins/help.rb,
lib/zerg_xcode/plugins/import.rb,
lib/zerg_xcode/plugins/retarget.rb,
lib/zerg_xcode/plugins/core/core.rb,
lib/zerg_xcode/plugins/lstargets.rb,
lib/zerg_xcode/plugins/addlibrary.rb

Overview

:nodoc: namespace

Defined Under Namespace

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

Class Method Summary collapse

Class Method Details

.allObject



15
16
17
18
19
20
21
# File 'lib/zerg_xcode/plugins/core/core.rb', line 15

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



31
32
33
34
# File 'lib/zerg_xcode/plugins/core/core.rb', line 31

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

.help(plugin_name) ⇒ Object



40
41
42
# File 'lib/zerg_xcode/plugins/core/core.rb', line 40

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

.require(plugin_name) ⇒ Object



27
28
29
# File 'lib/zerg_xcode/plugins/core/core.rb', line 27

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

.require_allObject



23
24
25
# File 'lib/zerg_xcode/plugins/core/core.rb', line 23

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

.run(plugin_name, args) ⇒ Object



36
37
38
# File 'lib/zerg_xcode/plugins/core/core.rb', line 36

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