Module: Bones

Extended by:
LittlePlugger
Defined in:
lib/bones.rb

Defined Under Namespace

Modules: App, Colors, Helpers, Plugins Classes: AnnotationExtractor, GemPackageTask

Constant Summary

PATH =

:stopdoc:

File.expand_path('../..', __FILE__) + File::SEPARATOR
LIBPATH =
File.expand_path('..', __FILE__) + File::SEPARATOR
VERSION =
File.read(PATH + '/version.txt').strip
HOME =
File.expand_path(ENV['HOME'] || ENV['USERPROFILE'])
RUBY =

Ruby Interpreter location - taken from Rake source code

File.join(RbConfig::CONFIG['bindir'],
RbConfig::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')

Class Method Summary collapse

Class Method Details

.config(&block) ⇒ Object

call-seq:

Bones.config
Bones.config { block }

Returns the configuration object for setting up Mr Bones options.



72
73
74
# File 'lib/bones.rb', line 72

def self.config( &block )
  Loquacious.configuration_for('Bones', &block)
end

.helpObject

call-seq:

Bones.help

Returns a help object that can be used to show the current Mr Bones configuration and descriptions for the various configuration attributes.



82
83
84
# File 'lib/bones.rb', line 82

def self.help
  Loquacious.help_for('Bones', :colorize => config.colorize, :nesting_nodes => false)
end

.libpath(*args) ⇒ Object

Returns the lib path for Mr Bones. If any arguments are given, they will be joined to the end of the path using File.join.



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/bones.rb', line 53

def self.libpath( *args )
  rv =  args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
  if block_given?
    begin
      $LOAD_PATH.unshift LIBPATH
      rv = yield
    ensure
      $LOAD_PATH.shift
    end
  end
  return rv
end

.path(*args) ⇒ Object

Returns the path for Mr Bones. If any arguments are given, they will be joined to the end of the path using File.join.



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/bones.rb', line 37

def self.path( *args )
  rv = args.empty? ? PATH : ::File.join(PATH, args.flatten)
  if block_given?
    begin
      $LOAD_PATH.unshift PATH
      rv = yield
    ensure
      $LOAD_PATH.shift
    end
  end
  return rv
end

.versionObject

Returns the version of the Mr Bones library.



30
31
32
# File 'lib/bones.rb', line 30

def self.version
  VERSION
end