Top Level Namespace
- Includes:
- Lowline
Defined Under Namespace
Modules: Ditz, Enumerable, Lowline Classes: Array, NilClass, Numeric, Object, String, Time
Instance Method Summary collapse
-
#run_pager ⇒ Object
Git-style automatic pagination of all output.
-
#time ⇒ Object
git ditz plugin.
Methods included from Lowline
#ask, #ask_for_many, #ask_for_selection, #ask_multiline, #ask_multiline_smartly, #ask_via_editor, #ask_yon, #can_run_editor?, #run_editor
Instance Method Details
#run_pager ⇒ Object
Git-style automatic pagination of all output. Call run_pa ger from any opperator needing pagination. Yoinked from nex-3.com/posts/73-git-style-automatic-paging-in-ruby#comments
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/ditz.rb', line 70 def run_pager return if PLATFORM =~ /win32/ return unless STDOUT.tty? read, write = IO.pipe unless Kernel.fork # Child process STDOUT.reopen(write) STDERR.reopen(write) if STDERR.tty? read.close write.close return end # Parent process, become pager STDIN.reopen(read) read.close write.close ENV['LESS'] ||= 'FSRX' # Don't page if the input is short enough, unless # the user already have a LESS variable. Kernel.select [STDIN] # Wait until we have input before we start the pager pager = ENV['PAGER'] || 'less' exec pager rescue exec "/bin/sh", "-c", pager end |
#time ⇒ Object
git ditz plugin
This plugin allows issues to be associated with git commits and git branches. Git commits can be easily tagged with a ditz issue with the ‘ditz commit’ command, and both ‘ditz show’ and the ditz HTML output will then contain a list of associated commits for each issue.
Issues can also be assigned a single git feature branch. In this case, all commits on that branch will listed as commits for that issue. This particular feature is fairly rudimentary, however—it assumes the reference point is the ‘master’ branch, and once the feature branch is merged back into master, the list of commits disappears.
Two configuration variables are added, which, when specified, are used to construct HTML links for the git commit id and branch names in the generated HTML output.
Commands added:
ditz set-branch: set the git branch of an issue
ditz commit: run git-commit, and insert the issue id into the commit
message.
Usage:
1. add a line "- git" to the .ditz-plugins file in the project root
2. run ditz reconfigure, and enter the URL prefixes, if any, from
which to create commit and branch links.
3. use 'ditz commit' with abandon.
29 |
# File 'lib/ditz/plugins/git.rb', line 29 require 'time' |