module LaunchSupport
Public Class Methods
launching_my_file_process(file, param={}) { || ... }
click to toggle source
# File lib/launchsupport.rb, line 17 def self.launching_my_file_process file, param={} unless param.empty? paths = param[:load] paths = [paths] if paths.is_a? String param[:project] ||= file.split("/")[file.split("/").rindex{|x|paths.include?(x)}-1] parts = "/#{param[:project]}/" paths.each do |path| $:.unshift file[0,file.index(parts)+parts.size-1]+"/#{path}" end [param[:require]].flatten.each{|r|require r} if param[:require] end yield if block_given? end