Module: Treebis

Defined in:
lib/treebis.rb,
lib/treebis.rb

Overview

Experimental extension for tests running tests with a persistent tempdir now you can set and get general properties, and delegate this behavior.

Defined Under Namespace

Modules: Antecedent, Capture3, Colorize, Config, DirAsHash, PathString, PersistentDotfile, Shellopts, Sopen2, Stylize, Test Classes: Fail, FileUtilsAsClass, FileUtilsProxy, Task, TaskSet

Class Method Summary collapse

Class Method Details

.dir_task(path) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/treebis.rb', line 12

def dir_task path
  taskfile = path + '/treebis-task.rb'
  require taskfile
  name = File.basename(path).to_sym
  task = @task_set[name]
  task.from path
  task
end

.tasksObject



20
21
22
# File 'lib/treebis.rb', line 20

def tasks
  @task_set ||= TaskSet.new
end

.unindent(content) ⇒ Object



23
24
25
26
# File 'lib/treebis.rb', line 23

def unindent content
  /\A(\s*)/ =~ content
  content.gsub(/^#{Regexp.escape($1)}/,'')
end