Sha256: e78a76106b6d9c226d7eb7852fe3645351bcdf2697a9edc89f1665a69f91e571

Contents?: true

Size: 766 Bytes

Versions: 2

Compression:

Stored size: 766 Bytes

Contents

# encoding: utf-8

d '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.3.1 lib/glyph/commands/todo.rb
glyph-0.5.2 lib/glyph/commands/todo.rb