redminerb 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -10
- data/lib/redminerb/version.rb +1 -1
- data/lib/redminerb.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0eaa8da3e11151f1a2699b28ef9d1cdb1f5444f
|
4
|
+
data.tar.gz: 48d69b47bb1d62359ceb1c8561eaf725303af1ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5171b97f91535076e8329bdbe5a87ccb88e94cb5951670e8dc1447a1788efbc659b2036d6dffc17ff96b2b1db960c06338b8da30b0b6670e0c0c0fdb967f365f
|
7
|
+
data.tar.gz: e1ca1b8a22384bc489850c2dcec3671bb5792c4239399d1236ada750f73ad39e87f5354de4a7607f3daae1d4c50dd8922828b39a22b5d588691a8099083aa091
|
data/README.md
CHANGED
@@ -74,12 +74,12 @@ The output of **a single resource** obtained with **the `show` subcommand can be
|
|
74
74
|
|
75
75
|
The default templates could be found in the *templates* directory.
|
76
76
|
|
77
|
-
For example, to customize the output of an issue, we
|
77
|
+
For example, to customize the output of an issue, we write the following content in the `.redminerb/issue.erb` file:
|
78
78
|
|
79
79
|
Number: <%= issue.id %>
|
80
80
|
Title: <%= issue.subject %>
|
81
81
|
|
82
|
-
The *.redminerb* directory will be search in
|
82
|
+
The *.redminerb* directory will be search **in the current directory first**, and then in **your home directory**.
|
83
83
|
|
84
84
|
We can also create other templates and use them through **the `--template` option**. For example:
|
85
85
|
|
@@ -91,7 +91,13 @@ Will use the file `.redminerb/user_in_a_box.erb` as template, whose content coul
|
|
91
91
|
<%= Redminerb.line user.login %>
|
92
92
|
<%= Redminerb.bottom %>
|
93
93
|
|
94
|
-
|
94
|
+
That would give us an output similar to this:
|
95
|
+
|
96
|
+
┌────────────────────────────────────┐
|
97
|
+
│ roger.williams │
|
98
|
+
└────────────────────────────────────┘
|
99
|
+
|
100
|
+
As you can see Redminerb give us also **some functions to draw** its output using old-school boxes. These functions are:
|
95
101
|
|
96
102
|
* **Redminerb.top**: shows the top of the box (i.e. `┌──────┐`).
|
97
103
|
* **Redminerb.middle**: shows a line in the middle of the box (i.e. `├──────┤`).
|
@@ -99,6 +105,8 @@ As you can see Redminerb give us also some functions to draw its output using ol
|
|
99
105
|
* **Redminerb.line** *string*: content into the box (i.e. `│ Example │`).
|
100
106
|
* **Redminerb.separator**: a line from left to right (like *middle* wo/ box borders).
|
101
107
|
|
108
|
+
Have fun with them!
|
109
|
+
|
102
110
|
### Configuration (config)
|
103
111
|
|
104
112
|
To see the current configuration used by Redminerb we have the `config` command:
|
@@ -135,18 +143,18 @@ by semicolons. For example:
|
|
135
143
|
|
136
144
|
Will return only the ID following by the user's email.
|
137
145
|
|
138
|
-
You can see **all the fields available** with `redminerb
|
146
|
+
You can see **all the fields available** with `redminerb user me`.
|
139
147
|
|
140
148
|
#### Show our info in the Redmine server
|
141
149
|
|
142
|
-
$ redminerb
|
150
|
+
$ redminerb user me
|
143
151
|
|
144
152
|
Will show the data in the Redmine server associated with the account that has
|
145
153
|
the API key used to access the Rest API (hopefully your data :).
|
146
154
|
|
147
155
|
#### Show user's data
|
148
156
|
|
149
|
-
$ redminerb
|
157
|
+
$ redminerb user [show] <id>
|
150
158
|
|
151
159
|
Will give us the info associated with the user with the given *id*.
|
152
160
|
|
@@ -177,17 +185,17 @@ The **issues** command is the wrapper for part of the [Issues resource](http://w
|
|
177
185
|
|
178
186
|
#### List issues
|
179
187
|
|
180
|
-
$ redminerb issues list
|
188
|
+
$ redminerb issues [list]
|
181
189
|
|
182
190
|
#### Show an issue
|
183
191
|
|
184
192
|
Shows the info of an issue with a number or id.
|
185
193
|
|
186
|
-
$ redminerb
|
194
|
+
$ redminerb issue [show] <number>
|
187
195
|
|
188
|
-
For example, to see the info of the issue #
|
196
|
+
For example, to see the info of the issue #12539 we'd launch:
|
189
197
|
|
190
|
-
$ redminerb
|
198
|
+
$ redminerb issue 12539
|
191
199
|
|
192
200
|
## Development
|
193
201
|
|
data/lib/redminerb/version.rb
CHANGED
data/lib/redminerb.rb
CHANGED
@@ -74,14 +74,15 @@ module Redminerb
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def line(string)
|
77
|
-
|
77
|
+
uncolorized = string.uncolorize
|
78
|
+
if uncolorized.size > max_length
|
78
79
|
"│ #{string[0..(max_length - 1)]} │\n#{line(string[max_length..-1])}" if string
|
79
80
|
else
|
80
|
-
"│ #{string}#{
|
81
|
+
"│ #{string}#{fill_with_spaces(uncolorized)} │"
|
81
82
|
end
|
82
83
|
end
|
83
|
-
|
84
|
-
def
|
84
|
+
|
85
|
+
def fill_with_spaces(string)
|
85
86
|
' ' * (max_length - string.size)
|
86
87
|
end
|
87
88
|
end
|