Class: Racket::Utils::ToolBelt

Inherits:
Object
  • Object
show all
Includes:
Application, Exceptions, FileSystem, Helpers, Views
Defined in:
lib/racket/utils.rb

Overview

Collects functionality from all utility modules into a handy class.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Views

extract_template_settings

Methods included from Helpers

#__apply_helpers, #apply_helpers

Methods included from FileSystem

#build_path, dir_or_nil, dir_readable?, extract_dir_and_glob, file_readable?, first_matching_path, fs_path, matching_paths, resolve_path, resolve_path_with_default, #safe_require

Methods included from Exceptions

#run_block

Constructor Details

#initialize(root_dir) ⇒ ToolBelt

Returns a new instance of ToolBelt.



45
46
47
# File 'lib/racket/utils.rb', line 45

def initialize(root_dir)
  @root_dir = Pathname.new(root_dir).cleanpath.expand_path
end

Class Method Details

.service(options = {}) ⇒ Proc

Returns a service proc that can be used by the registry.

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (Proc)


41
42
43
# File 'lib/racket/utils.rb', line 41

def self.service(options = {})
  -> { new(options[:root_dir]) }
end