Class: Object

Inherits:
BasicObject
Defined in:
lib/bones/helpers.rb

Overview

We need a “valid” method thtat determines if a string is suitable for use in the gem specification.

Instance Method Summary collapse

Instance Method Details

#ensure_in_path(*args) ⇒ Object

Adds the given arguments to the include path if they are not already there


117
118
119
120
121
122
# File 'lib/bones/helpers.rb', line 117

def ensure_in_path( *args )
  args.each do |path|
    path = File.expand_path(path)
    $:.unshift(path) if test(?d, path) and not $:.include?(path)
  end
end

#valid?Boolean

Returns:

  • (Boolean)

110
111
112
113
# File 'lib/bones/helpers.rb', line 110

def valid?
  return !(self.empty? or self == "\000") if self.respond_to?(:to_str)
  return false
end