redminerb 0.7.2 → 0.7.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: 4ffa75b08fce4f5b9002a23c8390cf6bd82a9efe
4
- data.tar.gz: b8aa4a4d89f7cd543e94026d5536cd4d0205998f
3
+ metadata.gz: 27e67ed9f8225a8c334f23ce67bb321ba94584f8
4
+ data.tar.gz: 4a4d74ab862b22f0d0ff0cf0c05bf9bc9479339f
5
5
  SHA512:
6
- metadata.gz: 4f089f4606de00bfbf4da4df880b45c7c59dc982faf880f84c3ff7faf0995ee985217fa289bc8f4f0b5326388249621ab52e1c7dd7392589a611d95403b2209e
7
- data.tar.gz: 58c101d78ccaf6f156fb4ea0155ac5422795aeb2c80daf9bf002464701aff3409aa12d9735ddff579f13f6ab01fb50f7da44ef36a22c5f8a7f7e61633b2bb7b8
6
+ metadata.gz: d706073076b3ed48cccfa7d1bafbaccc86c4f76b33b61b18082e88e0508f83eb392a35c0b2193b2dcab74c929e2e8ecc414010d4d67e16d59252babe8ad5cc1f
7
+ data.tar.gz: 2213fe089f14dd2ae2e359650a51c22bf34833e37949c3be6d18252edc949f7772df2ac5530a197f262d40eb5b2c3de7a65a3f0559bbb348e31883806f6406bd
@@ -16,12 +16,8 @@ module Redminerb
16
16
  show(project_id)
17
17
  else
18
18
  Redminerb.init!
19
- name = options.delete(:name)
20
- Redminerb::Projects.list(options).each do |project|
21
- if name.nil? || project.name =~ /#{name}/i
22
- puts "#{project.id}\t".green +
23
- project.name.split.map { |i| i.capitalize }.join(' ').green
24
- end
19
+ Redminerb::Projects.list(options).each do |p|
20
+ puts "#{p.id}\t#{p.name.split.map(&:capitalize).join(' ')}".green
25
21
  end
26
22
  end
27
23
  end
@@ -13,9 +13,12 @@ module Redminerb
13
13
  # puts "#{project.id}: #{project.name}"
14
14
  # end
15
15
  #
16
-
17
16
  def list(params)
18
- Redminerb.client.get_json('/projects.json', params)['projects'].map do |project|
17
+ projects = Redminerb.client.get_json('/projects.json', params)['projects']
18
+ if (name = params.delete(:name))
19
+ projects = projects.select {|project| project['name'] =~ /#{name}/i}
20
+ end
21
+ projects.map do |project|
19
22
  OpenStruct.new project
20
23
  end
21
24
  end
@@ -1,4 +1,4 @@
1
1
  # Copyright (c) The Cocktail Experience S.L. (2015)
2
2
  module Redminerb
3
- VERSION = '0.7.2'
3
+ VERSION = '0.7.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.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fernando Garcia Samblas