Sha256: 23f44e811ddc5bb668e6cdcd5d6c4ed41273acc7f336c49ff7d3d4d8a7307fed

Contents?: true

Size: 706 Bytes

Versions: 2

Compression:

Stored size: 706 Bytes

Contents

require 'thor'
require 'redmine_rest'

module RedmineCLI
  module Subcommands
    #
    # All methods for working with issues, e.g. listing, linking, updating...
    #
    class Issue < Thor
      extend Helpers::Output

      include RedmineRest
      include Helpers::Output

      desc 'list [user]', m('desc.issue.list')
      def list(id = 'current')
        fail('new config') if Config.new?

        puts erb('issue/list', issues: Models::User.find(id).issues)
      end

      desc 'show <id>', m('desc.issue.show')
      def show(id)
        puts erb('issue/show', issue: Models::Issue.find(id))
      rescue ActiveResource::ResourceNotFound
        puts m(:not_found)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redmine_cli-0.2.1 lib/redmine_cli/subcommands/issue.rb
redmine_cli-0.2.0 lib/redmine_cli/subcommands/issue.rb