Sha256: 7c804b5e2c6c71c3a18c1ac8ece574225982ff9214954aa3c2ff3d7e718cbbb7

Contents?: true

Size: 773 Bytes

Versions: 2

Compression:

Stored size: 773 Bytes

Contents

# encoding: utf-8

GLI.desc 'Display all project TODO items'
command :todo do |c|
	c.action do |global_options, options, args|
		Glyph['system.quiet'] = true
		Glyph.run "generate:document"
		Glyph['system.quiet'] = false
		unless Glyph.document.todos.blank?
			puts "====================================="
			puts "#{Glyph['document.title']} - TODOs"
			puts "====================================="
			# Group items
			if Glyph.document.todos.respond_to? :group_by then
				Glyph.document.todos.group_by{|e| e[:source]}.each_pair do |k, v|
					puts
					puts "=== #{k} "
					v.each do |i|
						puts " * #{i[:text]}"
					end
				end
			else
				Glyph.document.todos.each do |t|
					Glyph.info t
				end
			end
		else
			Glyph.info "Nothing left to do."
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
glyph-0.5.1 lib/glyph/commands/todo.rb
glyph-0.5.0 lib/glyph/commands/todo.rb