redminerb 0.2.2 → 0.2.3
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/README.md +10 -0
- data/lib/redminerb/cli/users.rb +8 -0
- data/lib/redminerb/client.rb +12 -0
- data/lib/redminerb/version.rb +1 -1
- 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: 78b4c1082e72394b5aab415a8f9b1e19d93cdbcd
|
4
|
+
data.tar.gz: 3d2b52e472d8df0671609bcfbea5517cb455a015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7c4dd68bc9cc2c16612611ef5b39db474151b1b9de856525d122cebd789c1d7f3b9a4194fd080adea69fa8235ee0f77a9fd6bb3d8ea54a817c9edece6f06028
|
7
|
+
data.tar.gz: 5c5a92008102dded2da0d9a0ffa202a3819cb808bd93ffe863f0e30e17a2cc63809af1397517a1ddb9543dbc89c95a7effd4d5cc32ceb0003c762b0953b98b5d
|
data/README.md
CHANGED
@@ -76,6 +76,16 @@ by semicolons. For example:
|
|
76
76
|
|
77
77
|
Will return only the ID following by the user e-mail.
|
78
78
|
|
79
|
+
You can see all the available fields with `redminerb users me`.
|
80
|
+
|
81
|
+
#### Show our info in the Redmine server
|
82
|
+
|
83
|
+
$ redminerb users me
|
84
|
+
|
85
|
+
Will show the data in the Redmine server associated with the account that has
|
86
|
+
the API key used to access the Rest API (hopefully your data :).
|
87
|
+
|
88
|
+
|
79
89
|
#### Create new user
|
80
90
|
|
81
91
|
$ redminerb users create --login "wadus" --password "ultrasecret" \
|
data/lib/redminerb/cli/users.rb
CHANGED
@@ -24,5 +24,13 @@ module Redminerb
|
|
24
24
|
Redminerb.init!
|
25
25
|
puts Redminerb.client.create_user(options).green
|
26
26
|
end
|
27
|
+
|
28
|
+
desc 'me', 'Shows the info of the owner of the API key'
|
29
|
+
def me
|
30
|
+
Redminerb.init!
|
31
|
+
Redminerb.client.me.each do |field, value|
|
32
|
+
puts "#{field}: ".blue + value.to_s.green
|
33
|
+
end
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
data/lib/redminerb/client.rb
CHANGED
@@ -51,6 +51,18 @@ module Redminerb
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
# Returns a hash with the info of the user's account behind the API key that
|
55
|
+
# is used by the script to access the Redmine's REST API.
|
56
|
+
#
|
57
|
+
# Example (missing required params):
|
58
|
+
# Redminerb.init!
|
59
|
+
# me = Redminerb.client.me
|
60
|
+
# puts me['login'] + ': ' + me['mail']
|
61
|
+
|
62
|
+
def me
|
63
|
+
get_json('/users/current.json')['user']
|
64
|
+
end
|
65
|
+
|
54
66
|
private
|
55
67
|
|
56
68
|
# Makes a GET request of the given 'path' param and returns the body of the
|
data/lib/redminerb/version.rb
CHANGED