Module: Ditz

Defined in:
lib/ditz/plugins/git-sync.rb,
lib/ditz.rb,
lib/ditz/hook.rb,
lib/ditz/html.rb,
lib/ditz/view.rb,
lib/ditz/model.rb,
lib/ditz/views.rb,
lib/ditz/operator.rb,
lib/ditz/plugins/git.rb,
lib/ditz/file-storage.rb,
lib/ditz/model-objects.rb,
lib/ditz/plugins/icalendar.rb,
lib/ditz/plugins/mercurial.rb,
lib/ditz/plugins/sha-names.rb,
lib/ditz/plugins/issue-claiming.rb,
lib/ditz/plugins/issue-labeling.rb,
lib/ditz/plugins/issue-timetracker.rb

Overview

TODO:

* extend the HTML view to have per-labels listings
* allow for more compact way to type them (completion, prefixes...)

Defined Under Namespace

Classes: BaetleView, Component, Config, ErbHtml, FileStorage, HookManager, HtmlView, Issue, Label, ModelError, ModelObject, Operator, Project, Release, ScreenView, View

Constant Summary collapse

VERSION =
"0.5.2"

Class Method Summary collapse

Class Method Details

.debug(s) ⇒ Object



10
11
12
# File 'lib/ditz.rb', line 10

def debug s
  puts "# #{s}" if $verbose || Ditz::verbose
end

.find_dir_containing(target, start = Pathname.new(".")) ⇒ Object

helper for recursive search



40
41
42
43
44
45
# File 'lib/ditz.rb', line 40

def find_dir_containing target, start=Pathname.new(".")
  return start if (start + target).exist?
  unless start.parent.realpath == start.realpath
    find_dir_containing target, start.parent
  end
end

.find_ditz_file(fn) ⇒ Object

my brilliant solution to the ‘gem datadir’ problem

Raises:

  • (LoadError)


48
49
50
51
52
# File 'lib/ditz.rb', line 48

def find_ditz_file fn
  dir = $:.find { |p| File.exist? File.expand_path(File.join(p, fn)) }
  raise LoadError, "can't find #{fn} in any load path" unless dir
  File.expand_path File.join(dir, fn)
end

.has_readline=(val) ⇒ Object



19
20
21
# File 'lib/ditz.rb', line 19

def self.has_readline= val
  @has_readline = val
end

.has_readline?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/ditz.rb', line 15

def self.has_readline?
  @has_readline
end

.home_dirObject



31
32
33
34
35
36
37
# File 'lib/ditz.rb', line 31

def home_dir
  @home ||=
    ENV["HOME"] || (ENV["HOMEDRIVE"] && ENV["HOMEPATH"] ? ENV["HOMEDRIVE"] + ENV["HOMEPATH"] : nil) || begin
    $stderr.puts "warning: can't determine home directory, using '.'"
    "."
  end
end

.load_plugins(fn) ⇒ Object



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

def load_plugins fn
  Ditz::debug "loading plugins from #{fn}"
  return unless File.exist?(fn)
  plugins = YAML::load_file fn
  plugins.each do |p|
    fn = Ditz::find_ditz_file "ditz/plugins/#{p}.rb"
    Ditz::debug "loading plugin #{p.inspect} from #{fn}"
    require File.expand_path(fn)
  end
  plugins
end

.verboseObject

Returns the value of attribute verbose.



7
8
9
# File 'lib/ditz.rb', line 7

def verbose
  @verbose
end

.verbose=(value) ⇒ Object

Sets the attribute verbose

Parameters:

  • value

    the value to set the attribute verbose to.



7
8
9
# File 'lib/ditz.rb', line 7

def verbose=(value)
  @verbose = value
end