Permalink
Browse files

remove trailing spaces

  • Loading branch information...
1 parent 7cf72a0 commit 031e20c75cb708f9bb5ce2819b5a43d145970270 @mockdeep mockdeep committed Sep 3, 2012
@@ -10,10 +10,10 @@
# rdm-mailhandler [options] --url=<Redmine URL> --key=<API key>
#
# == Arguments
-#
+#
# -u, --url URL of the Redmine server
# -k, --key Redmine API key
-#
+#
# General options:
# --unknown-user=ACTION how to handle emails from an unknown user
# ACTION can be one of the following values:
@@ -25,7 +25,7 @@
# -h, --help show this help
# -v, --verbose show extra information
# -V, --version show version information and exit
-#
+#
# Issue attributes control options:
# -p, --project=PROJECT identifier of the target project
# -s, --status=STATUS name of the target status
@@ -35,15 +35,15 @@
# -o, --allow-override=ATTRS allow email content to override attributes
# specified by previous options
# ATTRS is a comma separated list of attributes
-#
+#
# == Examples
# No project specified. Emails MUST contain the 'Project' keyword:
-#
+#
# rdm-mailhandler --url http://redmine.domain.foo --key secret
-#
+#
# Fixed project and default tracker specified, but emails can override
# both tracker and priority attributes using keywords:
-#
+#
# rdm-mailhandler --url https://domain.foo/redmine --key secret \\
# --project foo \\
# --tracker bug \\
@@ -70,12 +70,12 @@ def self.post_form(url, params)
class RedmineMailHandler
VERSION = '0.1'
-
+
attr_accessor :verbose, :issue_attributes, :allow_override, :unknown_user, :no_permission_check, :url, :key
def initialize
self.issue_attributes = {}
-
+
opts = GetoptLong.new(
[ '--help', '-h', GetoptLong::NO_ARGUMENT ],
[ '--version', '-V', GetoptLong::NO_ARGUMENT ],
@@ -114,26 +114,26 @@ def initialize
self.no_permission_check = '1'
end
end
-
+
RDoc.usage if url.nil?
end
-
+
def submit(email)
uri = url.gsub(%r{/*$}, '') + '/mail_handler'
-
- data = { 'key' => key, 'email' => email,
+
+ data = { 'key' => key, 'email' => email,
'allow_override' => allow_override,
'unknown_user' => unknown_user,
'no_permission_check' => no_permission_check}
issue_attributes.each { |attr, value| data["issue[#{attr}]"] = value }
-
+
debug "Posting to #{uri}..."
response = Net::HTTPS.post_form(URI.parse(uri), data)
debug "Response received: #{response.code}"
-
+
case response.code.to_i
when 403
- warn "Request was denied by your Redmine server. " +
+ warn "Request was denied by your Redmine server. " +
"Make sure that 'WS for incoming emails' is enabled in application settings and that you provided the correct API key."
return 77
when 422
@@ -153,9 +153,9 @@ def submit(email)
return 1
end
end
-
+
private
-
+
def debug(msg)
puts msg if verbose
end
@@ -1,20 +1,20 @@
# Sample plugin controller
class ExampleController < ApplicationController
unloadable
-
- layout 'base'
+
+ layout 'base'
before_filter :find_project, :authorize
menu_item :sample_plugin
-
+
def say_hello
@value = Setting.plugin_sample_plugin['sample_setting']
end
def say_goodbye
end
-
+
private
- def find_project
+ def find_project
@project=Project.find(params[:id])
end
end
@@ -4,8 +4,8 @@ class Meeting < ActiveRecord::Base
acts_as_event :title => Proc.new {|o| "#{o.scheduled_on} Meeting"},
:datetime => :scheduled_on,
:author => nil,
- :url => Proc.new {|o| {:controller => 'meetings', :action => 'show', :id => o.id}}
-
+ :url => Proc.new {|o| {:controller => 'meetings', :action => 'show', :id => o.id}}
+
acts_as_activity_provider :timestamp => 'scheduled_on',
:find_options => { :include => :project }
end
@@ -24,7 +24,7 @@
# A new item is added to the project menu
menu :project_menu, :sample_plugin, { :controller => 'example', :action => 'say_hello' }, :caption => 'Sample'
-
+
# Meetings are added to the activity view
activity_provider :meetings
end

0 comments on commit 031e20c

Please sign in to comment.