redmine-cli 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -1,11 +1,44 @@
1
1
  # A command line interface for redmine
2
2
 
3
+ ## Install
4
+
5
+ Execute
6
+ redmine install
7
+
8
+ This will create a .redmine file in your home directory. The file is a yaml file which contains our necessary configuration
9
+
10
+ Here you can add mappings for users and status like:
11
+
12
+ user_mappings:
13
+ "me": 1
14
+ "johndoe": 24
15
+ status_mappings:
16
+ "new": 1
17
+ "closed": 4
18
+
19
+ This will allow to use those names with the commands instead of the ids of users or status
20
+
3
21
  ## Use cases
4
22
 
23
+ - Listing tickets
24
+
5
25
  redmine list
6
- redmine list -a
26
+ redmine list -a me
27
+
28
+ - Display ticket
29
+
7
30
  redmine show 524
8
- redmine update 524 -d "New description"
9
- redmine update 256 --assigned_to "me"
10
- redmine update 2,3,4 --assigned_to "me"
11
- redmine list --status 1 | xargs redmine update --asigned_to "me" --status 3 -l
31
+
32
+ - Updating a ticket
33
+
34
+ redmine update 524 -description "New description"
35
+ redmine update 256 --assigned_to me
36
+
37
+ - Updating multiple tickets
38
+
39
+ redmine update 2,3,4 --assigned_to johndoe
40
+
41
+ - Updating all tickets for a list
42
+
43
+ redmine list --status new --std_output | xargs redmine update --asigned_to me --status 3 -l
44
+ \# Note that the last argument of the update command must be -l
data/lib/redmine-cli.rb CHANGED
@@ -2,3 +2,4 @@ require 'thor'
2
2
  require 'active_resource'
3
3
  require 'redmine-cli/issue'
4
4
  require 'redmine-cli/cli'
5
+ require 'redmine-cli/generators/install'
@@ -79,6 +79,12 @@ module Redmine
79
79
  tickets.collect { |ticket| Thread.new { update_ticket(ticket, options) } }.each(&:join)
80
80
  end
81
81
 
82
+ desc "install [URL][USERNAME][PASSWORD]", "Generates a recipe scaffold"
83
+ def install(url = "localhost:3000", username = "admin", password = "admin")
84
+ url = "http://#{url}" unless url =~ /\Ahttp/
85
+ Redmine::Cli::Generators::Install.start([url, username, password])
86
+ end
87
+
82
88
  no_tasks do
83
89
  def link_to_issue(id)
84
90
  "#{Issue.config.url}/issues/#{id}"
@@ -0,0 +1,12 @@
1
+ url: "<%= url %>"
2
+ username: "<%= username %>"
3
+ password: "<%= password %>"
4
+ user_mappings:
5
+ "admin": 1
6
+ status_mappings:
7
+ "new": 1
8
+ "in-progress": 2
9
+ "resolved": 3
10
+ "feedback": 4
11
+ "closed": 5
12
+ "rejected": 6
@@ -0,0 +1,20 @@
1
+ require 'thor/group'
2
+ require 'pathname'
3
+
4
+ module Redmine::Cli::Generators
5
+ class Install < Thor::Group
6
+ include Thor::Actions
7
+
8
+ def self.source_root
9
+ File.dirname(__FILE__)
10
+ end
11
+
12
+ argument :url, :type => :string
13
+ argument :username, :type => :string
14
+ argument :password, :type => :string
15
+ def copy_configuration_file
16
+ self.destination_root = File.expand_path("~")
17
+ template(".redmine")
18
+ end
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
1
  module Redmine
2
2
  module Cli
3
- VERSION = "0.0.1"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine-cli
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 0
9
8
  - 1
10
- version: 0.0.1
9
+ - 0
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jorge Dias
@@ -80,6 +80,8 @@ files:
80
80
  - bin/redmine
81
81
  - lib/redmine-cli.rb
82
82
  - lib/redmine-cli/cli.rb
83
+ - lib/redmine-cli/generators/.redmine
84
+ - lib/redmine-cli/generators/install.rb
83
85
  - lib/redmine-cli/issue.rb
84
86
  - lib/redmine-cli/version.rb
85
87
  - redmine-cli.gemspec