-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinit.rb
More file actions
25 lines (21 loc) · 859 Bytes
/
init.rb
File metadata and controls
25 lines (21 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'redmine'
require File.dirname(__FILE__) + '/lib/wiki_to_issue_macros.rb'
Redmine::Plugin.register :redmine_wiki2issue do
name 'Wiki2issue macro'
author 'Evolving Web Inc'
description 'Macro to create issues from within wiki pages.'
version '0.0.1'
author_url 'http://evolvingweb.ca'
Redmine::WikiFormatting::Macros.register do
desc = "Find or create issue in current project by subject (issue)"
macro :issue do |obj, args|
# these ApplicationHelper methods are accessible only in the current scope, so we pass them along
# must provide default values for args
scope = {
"link_to" => Proc.new {|a,b,c| link_to( a,b || {},c || {})},
"link_to_issue" => Proc.new {|a,b| link_to_issue( a, b || {})}
}
out = WikiToIssueMacros.find_or_create_issue(obj, args, scope)
end
end
end