Utility methods used by the various rake tasks
# File ext/packaging/lib/packaging/util.rb, line 15 def self.boolean_value(var) return TRUE if (var == TRUE || ( var.is_a?(String) && ( var.downcase == 'true' || var.downcase =~ /^y$|^yes$/ ))) FALSE end
# File ext/packaging/lib/packaging/util.rb, line 30 def self.get_var(var) check_var(var, ENV[var]) ENV[var] end
# File ext/packaging/lib/packaging/util.rb, line 20 def self.in_project_root(&blk) result = nil fail "Cannot execute in project root if Pkg::Config.project_root is not set" unless Pkg::Config.project_root Dir.chdir Pkg::Config.project_root do result = blk.call end result end
# File ext/packaging/lib/packaging/util.rb, line 35 def self.require_library_or_fail(library, library_name = nil) library_name ||= library begin require library rescue LoadError fail "Could not load #{library_name}. #{library_name} is required by the packaging repo for this task" end end
Generated with the Darkfish Rdoc Generator 2.