Sha256: 2f98129048970adde69de14f5095632e3fa947f92ea62e179ebd495afa9a21fa

Contents?: true

Size: 678 Bytes

Versions: 3

Compression:

Stored size: 678 Bytes

Contents

require 'rubygems'
require 'active_resource'

module RedmineApi
  class Client < ActiveResource::Base; end
  class Issue < RedmineApi::Client; end
end

module Stagecoach
  class Redmine
    def self.issue(issue_number)
      return RedmineApi::Issue.find(issue_number)
    end

    def self.issue_url(issue)
      RedmineApi::Client.site + "/issues/" + issue.id
    end

    # Open the issue in a browser.
    def self.view_issue(issue)
      issue_url = Redmine.issue_url(issue)
        print "Open planio issue in browser? [Y]es or anything else to exit:  "
        `open #{issue_url.to_s}` if gets.chomp == "Y"
        puts "Staging completed!  Exiting..."
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
redmine_stagecoach-0.5.2 lib/stagecoach/redmine.rb
redmine_stagecoach-0.5.1 lib/stagecoach/redmine.rb
redmine_stagecoach-0.5.0 lib/stagecoach/redmine.rb