Created
November 10, 2008 08:27
-
-
Save mattn/23450 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[email protected]>", | |
: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