# File lib/model-objects.rb, line 55 def add_issue issue added_issues << issue issues << issue issue.project = self assign_issue_names! issue end
# File lib/model-objects.rb, line 70 def added_issues; @added_issues ||= [] end
# File lib/model-objects.rb, line 115 def assign_issue_names! prefixes = components.map { |c| [c.name, c.name.gsub(/^\s+/, "-").downcase] }.to_h ids = components.map { |c| [c.name, 0] }.to_h issues.sort_by { |i| i.creation_time }.each do |i| i.name = "#{prefixes[i.component]}-#{ids[i.component] += 1}" end end
# File lib/model-objects.rb, line 89 def component_for component_name components.find { |i| i.name == component_name } end
# File lib/model-objects.rb, line 71 def deleted_issues; @deleted_issues ||= [] end
# File lib/model-objects.rb, line 63 def drop_issue issue if issues.delete issue deleted_issues << issue assign_issue_names! end end
# File lib/model-objects.rb, line 73 def get_components puts Issues can be tracked across the project as a whole, or the project can besplit into components, and issues tracked separately for each component. use_components = ask_yon "Track issues separately for different components?" comp_names = use_components ? ask_for_many("components") : [] ([name] + comp_names).uniq.map { |n| Component.create_interactively :with => { :name => n } } end
# File lib/model-objects.rb, line 111 def group_issues these_issues=issues these_issues.group_by { |i| i.type }.sort_by { |(t,g)| Issue::TYPE_ORDER[t] } end
# File lib/model-objects.rb, line 48 def issues= issues @issues = issues @issues.each { |i| i.project = self } assign_issue_names! issues end
# File lib/model-objects.rb, line 84 def issues_for ident by_name = issues.find { |i| i.name == ident } by_name ? [by_name] : issues.select { |i| i.id =~ /^#{Regexp::escape ident}/ } end
# File lib/model-objects.rb, line 103 def issues_for_component component issues.select { |i| i.component == component.name } end
# File lib/model-objects.rb, line 99 def issues_for_release release release == :unassigned ? unassigned_issues : issues.select { |i| i.release == release.name } end
# File lib/model-objects.rb, line 93 def release_for release_name releases.find { |i| i.name == release_name } end
# File lib/model-objects.rb, line 107 def unassigned_issues issues.select { |i| i.release.nil? } end
# File lib/model-objects.rb, line 97 def unreleased_releases; releases.select { |r| r.unreleased? } end
# File lib/model-objects.rb, line 123 def validate! if(dup = components.map { |c| c.name }.first_duplicate) raise Error, "more than one component named #{dup.inspect}: #{components.inspect}" elsif(dup = releases.map { |r| r.name }.first_duplicate) raise Error, "more than one release named #{dup.inspect}" end end
Generated with the Darkfish Rdoc Generator 2.