redminerb 0.7.5 → 0.8.0

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: 33579d16f4ec37d35fdd4d7c4614984fbd43dadb
4
- data.tar.gz: 3302211d9c58917bb07ccadca0424046306f9fc4
3
+ metadata.gz: 6fab0c9d47ded9d94c9f5493d83e86303c47eaac
4
+ data.tar.gz: 23719db05f4831efc40eb52cbf896ec0191f5c65
5
5
  SHA512:
6
- metadata.gz: bd83552c384f3e53fed2c9f37ceacf66dc8aae1e880fd8fba1fce9fbd009f039078aaa3f965a77def7203dde24d314ee94445c0cd9b2de4970a90724f31ee649
7
- data.tar.gz: a4d15addd5891dc51d2158efb03f75f5dca162e328ca01306c249478dcb5f8e2c9c07f812c7f4c55693350682b7b7dd55a2955ea4b50842a1c4d5f6751373fcf
6
+ metadata.gz: 4e79942f238f54007293d5a9be204a69c894c9abc14df14ca486e7813af15dd479f0b6d1914820878a56dda54458604179ed14a4657ce88c311c3dd9561f4ed0
7
+ data.tar.gz: 954359ec39e9d9a983a765f962c30b7b305d8322748c0a086b0d5577ab60894a2fa0a72c19eaf83348b6fe7b5aa82c420d56decae5aa93ee1c734b036d673566
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,12 @@
1
1
  = CHANGELOG
2
+ == 0.8, released 2015-10-09
3
+
4
+ * Users' create now asks for each param unless we use the --no-ask option
5
+ * +redminerb project [show] <id>+ to see a project's info
6
+ * +redminerb projects list [--name <FILTER>]+ to see our projects
7
+ * +--project_id+, +assigned_to+ and +--closed+ options to filter *issues*
8
+ * Minor fixes
9
+
2
10
  == 0.7, released 2015-10-05
3
11
 
4
12
  * Show subcommand's +--template+ option for user/issue command to indicate the .erb template to render.
data/README.md CHANGED
@@ -162,22 +162,19 @@ Will give us the info associated with the user with the given *id*.
162
162
 
163
163
  To create a new user we should use the *create* subcommand:
164
164
 
165
- $ redminerb users create --login wadus --password="ultrasecret" \
166
- --firstname="Wadux" --lastname Wallace \
167
- --mail "wadus@waduxwallace.out"
165
+ $ redminerb users create
168
166
 
169
- The options have the following aliases (extracted from `redminerb users help create`):
167
+ It **will ask for the required params** giving us the possibility to fix any mistake until we confirm that everything is ok.
170
168
 
171
- l, --login=LOGIN
172
- p, --password=PASSWORD
173
- fn, --firstname=FIRSTNAME
174
- ln, --lastname=LASTNAME
175
- m, --mail=MAIL
169
+ If want to supply some (or all) of the values when calling `redminerb` we can use the following subcommand options (extracted from `redminerb users help create`):
176
170
 
177
- So, the previous command is the same as the following:
171
+ -n, --name, [--login=LOGIN]
172
+ -p, --pass, [--password=PASSWORD]
173
+ -f, --fn, [--firstname=FIRSTNAME]
174
+ -l, --ln, [--lastname=LASTNAME]
175
+ -m, --email, [--mail=MAIL]
178
176
 
179
- $ redminerb users create -l wadus -p ultrasecret -fn Wadux -ln Wallace \
180
- -m wadus@waduxwallace.out
177
+ Use the option **--no-ask** if you're supplying all the required values and don't want to be asked for them (from a script, for example).
181
178
 
182
179
  ### Issues
183
180
 
@@ -23,17 +23,34 @@ module Redminerb
23
23
  end
24
24
  end
25
25
  end
26
-
26
+
27
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
28
+ # (i'd move code from here but inheriting from Thor i still don't know how :(
27
29
  desc 'create', 'Creates a user.'
28
- option :login, aliases: :l, required: true
29
- option :password, aliases: :p, required: true
30
- option :firstname, aliases: :fn, required: true
31
- option :lastname, aliases: :ln, required: true
32
- option :mail, aliases: :m, required: true
30
+ option :ask, type: :boolean, default: true
31
+ option :login, aliases: [:n, '--name']
32
+ option :password, aliases: [:p, '--pass']
33
+ option :firstname, aliases: [:f, '--fn']
34
+ option :lastname, aliases: [:l, '--ln']
35
+ option :mail, aliases: [:m, '--email']
33
36
  def create
34
37
  Redminerb.init!
38
+ if options[:ask]
39
+ loop do
40
+ initializer_data = @_initializer.detect do |internal|
41
+ internal.is_a?(Hash) && internal.keys.include?(:current_command)
42
+ end
43
+ initializer_data[:current_command].options.keys.each do |option|
44
+ next if option == :ask
45
+ value = ask("#{option.capitalize} [#{options[option]}]:", Thor::Shell::Color::GREEN)
46
+ options[option] = value unless value.empty?
47
+ end
48
+ break if yes?('Is everything OK? (NO/yes)')
49
+ end
50
+ end
35
51
  puts Redminerb::Users.create(options).green
36
52
  end
53
+ # rubocop:enabled Metrics/AbcSize, Metrics/MethodLength
37
54
 
38
55
  desc 'me', 'Shows the info of the owner of the API key.'
39
56
  def me
@@ -1,4 +1,4 @@
1
1
  # Copyright (c) The Cocktail Experience S.L. (2015)
2
2
  module Redminerb
3
- VERSION = '0.7.5'
3
+ VERSION = '0.8.0'
4
4
  end
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.7.5
4
+ version: 0.8.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-10-08 00:00:00.000000000 Z
11
+ date: 2015-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor