redminerb 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +10 -6
- data/README.md +15 -7
- data/lib/redminerb/template.rb +19 -1
- data/lib/redminerb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9f4f24f3042eab942ba77d07143a61b70bbed04
|
4
|
+
data.tar.gz: 83f92876f8e3f995bf552e42edefd631f9a59c46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d077f662066d6838ab71cd26877358deb77a4d87980f14b2f702f455d5fabd7f6693db270daa9493112dd24705067e0be67bca386dd1a80fa4f562f7e2a8b315
|
7
|
+
data.tar.gz: a64a0ee960d56e34ee43282c6a2712cf20266b87c111c7fc3a6aeb97377d98ca7961b106ee519a038573b5bf4e4c224b0429bc29b0cef3c1f413614f92d8a423
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,17 +1,21 @@
|
|
1
|
+
== 0.5, released 2015-09-23
|
2
|
+
|
3
|
+
* Local or home +.redminerb/templates+ directory for resource output customizations
|
4
|
+
|
1
5
|
== 0.4, released 2015-09-22
|
2
6
|
|
3
|
-
*
|
7
|
+
* +redminerb users show <id>+ to see a user's info
|
4
8
|
|
5
9
|
== 0.3, released 2015-09-22
|
6
10
|
|
7
|
-
*
|
8
|
-
*
|
11
|
+
* +redminerb issues [show] <number>+ to see an issue's info
|
12
|
+
* +redminerb issues list+ to see open issues
|
9
13
|
|
10
14
|
== 0.2, released 2015-09-17
|
11
15
|
|
12
|
-
*
|
16
|
+
* +redminerb users create+ to create a brand new user!
|
13
17
|
|
14
18
|
== 0.1, released 2015-09-16
|
15
19
|
|
16
|
-
*
|
17
|
-
*
|
20
|
+
* +redminerb config+ to get current config
|
21
|
+
* +redminerb users [list]+ to see current users
|
data/README.md
CHANGED
@@ -34,27 +34,35 @@ Or install it yourself as:
|
|
34
34
|
|
35
35
|
## Usage
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
In order to use `redminerb` the URL and the API key of your Redmine REST API must be available in one of the following places:
|
38
|
+
|
39
|
+
|
40
|
+
1. **In your environment**: using *REDMINERB_URL* and *REDMINERB_API_KEY* env. vars.
|
41
|
+
2. **In `~/.redminerb.yml`**: as values of *url* and *api_key*.
|
40
42
|
|
41
43
|
For example, this `~/.redminerb.yml`:
|
42
44
|
|
43
45
|
url: http://localhost:3000/
|
44
46
|
api_key: 69b47d74e36a6757bac5d45f8398dd23bfa8f52c
|
45
47
|
|
46
|
-
Would be the same as having the following in your `.bashrc
|
48
|
+
Would be the same as having the following in your environment (declared in `.bashrc`, for example):
|
47
49
|
|
48
50
|
export REDMINERB_URL=http://localhost:3000/
|
49
51
|
export REDMINERB_API_KEY=69b47d74e36a6757bac5d45f8398dd23bfa8f52c
|
50
52
|
|
51
|
-
|
52
|
-
|
53
|
+
If both present environment variables have priority.
|
54
|
+
|
55
|
+
Collections of resources will give us the results as indicated by the
|
56
|
+
[Redmine pagination documentation](http://www.redmine.org/projects/redmine/wiki/Rest_api#Collection-resources-and-pagination) and the *--limit (-l)* and *--offset (-o)* options can be used.
|
53
57
|
|
54
|
-
For example, you
|
58
|
+
For example, you could see the third user of your Redmine with:
|
55
59
|
|
56
60
|
$ redminerb users -o 3 -l 1
|
57
61
|
|
62
|
+
The output of particular resources can be customized creating the corresponding `.erb` file in the *.redminerb/templates* directory (the default templates could be found in the *templates* directory).
|
63
|
+
|
64
|
+
The *.redminerb* directory will be search in your current directory first, and then in your home directory.
|
65
|
+
|
58
66
|
### Configuration (config)
|
59
67
|
|
60
68
|
To see the current configuration used by Redminerb we have the `config` command:
|
data/lib/redminerb/template.rb
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
require 'erb'
|
3
3
|
|
4
4
|
module Redminerb
|
5
|
-
# Class to
|
5
|
+
# Class to render Redminerb's ERB templates
|
6
6
|
class Template
|
7
|
+
TEMPLATES_DIR = '.redminerb/templates'
|
8
|
+
|
7
9
|
class << self
|
8
10
|
# Renders the template +name+ using +resource+ assigned to a local
|
9
11
|
# variable with that same name in its binding (i.e. the template will
|
@@ -44,8 +46,24 @@ module Redminerb
|
|
44
46
|
end
|
45
47
|
|
46
48
|
def _filepath(name)
|
49
|
+
_localfile(name) || _homefile(name) || _gemfile(name)
|
50
|
+
end
|
51
|
+
|
52
|
+
def _localfile(name)
|
53
|
+
_filepath_or_nil "#{TEMPLATES_DIR}/#{name}.erb"
|
54
|
+
end
|
55
|
+
|
56
|
+
def _homefile(name)
|
57
|
+
_filepath_or_nil "#{ENV['HOME']}/#{TEMPLATES_DIR}/#{name}.erb"
|
58
|
+
end
|
59
|
+
|
60
|
+
def _gemfile(name)
|
47
61
|
File.join(File.dirname(__FILE__)[0..-15], 'templates', "#{name}.erb")
|
48
62
|
end
|
63
|
+
|
64
|
+
def _filepath_or_nil(filepath)
|
65
|
+
filepath if File.exist?(filepath)
|
66
|
+
end
|
49
67
|
end
|
50
68
|
end
|
51
69
|
end
|
data/lib/redminerb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redminerb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Garcia Samblas
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|