Skip to content

Commit

Permalink
issue cprice404#4 updated Redmine issue description to include link t…
Browse files Browse the repository at this point in the history
…o Redmine
  • Loading branch information
jamesantrobus committed Aug 25, 2012
1 parent b8cc2b3 commit d0649ff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 9 additions & 3 deletions lib/rmt/redmine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,11 @@ def parse_issues(response_body)
{
:id => get_value_of_text_child_node(issue_node, "id"),
:subject => get_value_of_text_child_node(issue_node, "subject"),
:description => get_value_of_text_child_node(issue_node, "description"),
:description => get_issue_description(issue_node),
:start_date => get_value_of_text_child_node(issue_node, "start_date"),
:due_date => get_value_of_text_child_node(issue_node, "due_date"),
:done_ratio => get_value_of_text_child_node(issue_node, "done_ratio"),
:estimated_hours => get_value_of_text_child_node(issue_node, "estimated_hours"),
:description => get_value_of_text_child_node(issue_node, "description"),

This comment has been minimized.

Copy link
@jamesantrobus

jamesantrobus Aug 25, 2012

Author Owner

I took out this duplicate assignment of description too

:estimated_hours => get_value_of_text_child_node(issue_node, "estimated_hours"),
:created_on => get_value_of_text_child_node(issue_node, "created_on"),
:updated_on => get_value_of_text_child_node(issue_node, "updated_on"),
:tracker => get_attribute_of_child_node(issue_node, "tracker", :name),
Expand All @@ -103,6 +102,13 @@ def get_value_of_text_child_node(node, child_node_name)
end
private :get_value_of_text_child_node

def get_issue_description(node)
issue_id = get_value_of_text_child_node(node, "id")
description = get_value_of_text_child_node(node, "description") || ""
"#{description} #{@base_url}/issues/#{issue_id}"
end
private :get_issue_description

# given an Ox xml node, find a child node by the specified child_node_name. The specified node
# should have an attribute with the name specified by attr_name; this method returns the value
# of that attribute.
Expand Down
4 changes: 2 additions & 2 deletions lib/rmt/trello.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def create_card(properties)
puts "Adding card: #{properties[:name]}"
card = ::Trello::Card.create(:name => properties[:name],
:list_id => properties[:list],
:description => sanitize_utf8(properties[:description] || ""))
:description => sanitize_utf8(properties[:description]))
if properties[:color]
card.add_label(properties[:color])
end
Expand Down Expand Up @@ -74,4 +74,4 @@ def sanitize_utf8(str)
str.each_char.map { |c| c.valid_encoding? ? c : "\ufffd"}.join
end
end
end
end

0 comments on commit d0649ff

Please sign in to comment.