redminerb 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea84fb5d97fc1832c49ad0b3776291b0edc96794
4
- data.tar.gz: 989425f92224631a6fd5d4d86c56f96ce234d6c3
3
+ metadata.gz: 78b4c1082e72394b5aab415a8f9b1e19d93cdbcd
4
+ data.tar.gz: 3d2b52e472d8df0671609bcfbea5517cb455a015
5
5
  SHA512:
6
- metadata.gz: 8b22642e93d4093b302171c273c74dbada54b85095e94e049880be4dee3a2359c4d94d48073ab690ec51d37b76d23c47c99f49424b756e02d709ac8d591c3e67
7
- data.tar.gz: 131f1c4a13664317154962f75543220346fae902a4cf302e3a1eb828a07ef331e0099fb8d2d316987b091ffd1d34bbac683ec6eb612c0f591fd7bc57179d3b11
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" \
@@ -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
@@ -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
@@ -1,4 +1,4 @@
1
1
  # Copyright (c) The Cocktail Experience S.L. (2015)
2
2
  module Redminerb
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redminerb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Garcia Samblas