Sha256: 9b37ffb89af1eca8017628226fe0cd171d1568751e14b3bdeb0959947ea311de

Contents?: true

Size: 856 Bytes

Versions: 5

Compression:

Stored size: 856 Bytes

Contents

require 'thor'
require 'redmine_rest'
module RedmineCLI
  module Subcommands
    #
    # Methods for working with projects
    #
    class Project < Thor
      extend Helpers::Output

      include RedmineRest
      include Helpers::Output
      include Helpers::Input

      map 'users' => 'members'

      desc 'list', m('desc.project.list')
      def list
        puts erb('id_and_name_list', list: Models::Project.all)
      end

      desc 'members <id | name part>', m('desc.project.members')
      def members(project)
        project = InputParser.parse_project(project)

        users = project.members
                       .map(&:reload)
                       .sort { |a, b| a.id.to_i <=> b.id.to_i }

        puts erb('user/find', users: users)
      rescue ProjectNotFound
        puts "Project #{m(:not_found)}"
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
redmine_cli-0.7.0 lib/redmine_cli/subcommands/project.rb
redmine_cli-0.6.1 lib/redmine_cli/subcommands/project.rb
redmine_cli-0.6.0 lib/redmine_cli/subcommands/project.rb
redmine_cli-0.5.1 lib/redmine_cli/subcommands/project.rb
redmine_cli-0.5.0 lib/redmine_cli/subcommands/project.rb