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 +38 -5
- data/lib/redmine-cli.rb +1 -0
- data/lib/redmine-cli/cli.rb +6 -0
- data/lib/redmine-cli/generators/.redmine +12 -0
- data/lib/redmine-cli/generators/install.rb +20 -0
- data/lib/redmine-cli/version.rb +1 -1
- metadata +5 -3
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
redmine
|
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
data/lib/redmine-cli/cli.rb
CHANGED
@@ -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,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
|
data/lib/redmine-cli/version.rb
CHANGED
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 0
|
9
8
|
- 1
|
10
|
-
|
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
|