Skip to content

Instantly share code, notes, and snippets.

@mattn
Created November 10, 2008 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/23450 to your computer and use it in GitHub Desktop.
Save mattn/23450 to your computer and use it in GitHub Desktop.
require 'ditz'
require 'pathname'
config = begin
Ditz::Config.from ".ditz-config"
rescue SystemCallError => e
Ditz::Config.new
end
issue_dir = Pathname.new(config.issue_dir || '.ditz')
project_root = Ditz::find_dir_containing(issue_dir + Ditz::FileStorage::PROJECT_FN)
project_root += issue_dir
storage = Ditz::FileStorage.new project_root
project = begin
storage.load
rescue SystemCallError, Ditz::Project::Error => e
die "#{e.message} (use 'init' to initialize)"
end
issue = Ditz::Issue::create([config, project],
:title => 'foo is not found!!',
:desc => 'shut the fuck up and add "foo"',
:type => "task",
:component => "example",
:reporter => "hehehe <your@example.com>",
:status => :unstarted
)
project.add_issue issue
project.assign_issue_names!
storage.save project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment