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 +4 -4
- data/lib/redminerb/cli/projects.rb +2 -6
- data/lib/redminerb/projects.rb +5 -2
- 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: 27e67ed9f8225a8c334f23ce67bb321ba94584f8
|
4
|
+
data.tar.gz: 4a4d74ab862b22f0d0ff0cf0c05bf9bc9479339f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
20
|
-
|
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
|
data/lib/redminerb/projects.rb
CHANGED
@@ -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']
|
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
|
data/lib/redminerb/version.rb
CHANGED