Module: RedmineTicketClient
- Defined in:
- lib/redmine-ticket/client.rb
Defined Under Namespace
Classes: Sender
Constant Summary collapse
- VERSION =
'0.2.2'
Class Attribute Summary collapse
-
.host ⇒ Object
The host to connect to.
-
.http_open_timeout ⇒ Object
The HTTP open timeout (defaults to 2 seconds).
-
.http_read_timeout ⇒ Object
The HTTP read timeout (defaults to 5 seconds).
-
.params ⇒ Object
Returns the value of attribute params.
-
.port ⇒ Object
The port on which your Redmine server runs.
-
.proxy_host ⇒ Object
Returns the value of attribute proxy_host.
-
.proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
-
.proxy_port ⇒ Object
Returns the value of attribute proxy_port.
-
.proxy_user ⇒ Object
Returns the value of attribute proxy_user.
-
.secure ⇒ Object
Returns the value of attribute secure.
Class Method Summary collapse
-
.configure {|_self| ... } ⇒ Object
NOTE: secure connections are not yet supported.
- .default_request_params ⇒ Object
-
.default_ticket_options ⇒ Object
:nodoc:.
- .issue_status ⇒ Object
- .issues ⇒ Object
- .journals ⇒ Object
- .post_ticket ⇒ Object
- .projects ⇒ Object
-
.protocol ⇒ Object
:nodoc:.
-
.url ⇒ Object
:nodoc:.
Class Attribute Details
.host ⇒ Object
The host to connect to.
21 22 23 |
# File 'lib/redmine-ticket/client.rb', line 21 def host @host end |
.http_open_timeout ⇒ Object
The HTTP open timeout (defaults to 2 seconds).
26 27 28 |
# File 'lib/redmine-ticket/client.rb', line 26 def http_open_timeout @http_open_timeout end |
.http_read_timeout ⇒ Object
The HTTP read timeout (defaults to 5 seconds).
31 32 33 |
# File 'lib/redmine-ticket/client.rb', line 31 def http_read_timeout @http_read_timeout end |
.params ⇒ Object
Returns the value of attribute params.
12 13 14 |
# File 'lib/redmine-ticket/client.rb', line 12 def params @params end |
.port ⇒ Object
The port on which your Redmine server runs.
16 17 18 |
# File 'lib/redmine-ticket/client.rb', line 16 def port @port end |
.proxy_host ⇒ Object
Returns the value of attribute proxy_host.
12 13 14 |
# File 'lib/redmine-ticket/client.rb', line 12 def proxy_host @proxy_host end |
.proxy_pass ⇒ Object
Returns the value of attribute proxy_pass.
12 13 14 |
# File 'lib/redmine-ticket/client.rb', line 12 def proxy_pass @proxy_pass end |
.proxy_port ⇒ Object
Returns the value of attribute proxy_port.
12 13 14 |
# File 'lib/redmine-ticket/client.rb', line 12 def proxy_port @proxy_port end |
.proxy_user ⇒ Object
Returns the value of attribute proxy_user.
12 13 14 |
# File 'lib/redmine-ticket/client.rb', line 12 def proxy_user @proxy_user end |
.secure ⇒ Object
Returns the value of attribute secure.
12 13 14 |
# File 'lib/redmine-ticket/client.rb', line 12 def secure @secure end |
Class Method Details
.configure {|_self| ... } ⇒ Object
NOTE: secure connections are not yet supported.
36 37 38 |
# File 'lib/redmine-ticket/client.rb', line 36 def configure yield self end |
.default_request_params ⇒ Object
58 59 60 |
# File 'lib/redmine-ticket/client.rb', line 58 def default_request_params {}.merge RedmineTicketClient.params end |
.default_ticket_options ⇒ Object
:nodoc:
48 49 50 51 52 53 54 55 56 |
# File 'lib/redmine-ticket/client.rb', line 48 def #:nodoc: { :params => RedmineTicketClient.params, :error_message => 'Notification', :request => {}, :session => {}, :environment => ENV.to_hash } end |
.issue_status ⇒ Object
66 67 68 |
# File 'lib/redmine-ticket/client.rb', line 66 def issue_status RestClient.post("#{protocol}://#{host}:#{port}/ticket_server/issue_status", :api_key => default_request_params[:api_key], :issue_id => default_request_params[:issue_id]) end |
.issues ⇒ Object
69 70 71 |
# File 'lib/redmine-ticket/client.rb', line 69 def issues RestClient.post("#{protocol}://#{host}:#{port}/ticket_server/issues", :api_key => default_request_params[:api_key], :issue_id => default_request_params[:issue_id]) end |
.journals ⇒ Object
75 76 77 |
# File 'lib/redmine-ticket/client.rb', line 75 def journals RestClient.post("#{protocol}://#{host}:#{port}/ticket_server/journals", :api_key => default_request_params[:api_key], :issue_id => default_request_params[:issue_id]) end |
.post_ticket ⇒ Object
62 63 64 |
# File 'lib/redmine-ticket/client.rb', line 62 def post_ticket Sender.new.post_to_redmine( ) end |
.projects ⇒ Object
72 73 74 |
# File 'lib/redmine-ticket/client.rb', line 72 def projects RestClient.post("#{protocol}://#{host}:#{port}/ticket_server/projects", :api_key => default_request_params[:api_key], :issue_id => default_request_params[:issue_id]) end |
.protocol ⇒ Object
:nodoc:
40 41 42 |
# File 'lib/redmine-ticket/client.rb', line 40 def protocol #:nodoc: secure ? "https" : "http" end |
.url ⇒ Object
:nodoc:
44 45 46 |
# File 'lib/redmine-ticket/client.rb', line 44 def url #:nodoc: URI.parse("#{protocol}://#{host}:#{port}/ticket_server/") end |