Sha256: a270054fbcb1b27a8fd5d67f36631be015660830e985e85c09ae39f8ac4e0028

Contents?: true

Size: 1.13 KB

Versions: 79

Compression:

Stored size: 1.13 KB

Contents

require 'active_resource'

module EgovUtils
  module Redmine

    def self.config
      EgovUtils::Settings.redmine
    end

    def self.configured?
      config['url'] && config['project_id']
    end

    class Issue < ActiveResource::Base
      self.site = EgovUtils::Redmine.config['url']
      self.ssl_options = {verify_mode: OpenSSL::SSL::VERIFY_NONE}

      headers["X-Redmine-API-Key"] = EgovUtils::Redmine.config['api_key'] if EgovUtils::Redmine.config['api_key']

      def self.collection_path(prefix_options = {},query_options=nil)
        super
        query_options[:query_id] ||= EgovUtils::Redmine.config['query_id'] if EgovUtils::Redmine.config['query_id']
        prefix_options[:project_id] ||= EgovUtils::Redmine.config['project_id']
        "/projects/#{prefix_options[:project_id]}/#{collection_name}.#{format.extension}#{query_string(query_options)}"
      end

      def self.instantiate_collection(collection, original_params = {}, prefix_options = {})
        collection = collection[collection_name] if collection[collection_name].is_a?(Array)
        super(collection, original_params, prefix_options)
      end
    end

  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
egov_utils-1.5.0.alpha16 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha15 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha14 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha13 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha12 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha11 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha10 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha9 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha8 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha7 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha6 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha5 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha4 lib/egov_utils/redmine/issue.rb
egov_utils-1.4.5 lib/egov_utils/redmine/issue.rb
egov_utils-1.4.4 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha3 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha2 lib/egov_utils/redmine/issue.rb
egov_utils-1.5.0.alpha1 lib/egov_utils/redmine/issue.rb
egov_utils-1.4.3 lib/egov_utils/redmine/issue.rb
egov_utils-1.4.2 lib/egov_utils/redmine/issue.rb