checklister 0.9.3 → 0.9.4
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/CHANGELOG.md +6 -0
- data/lib/checklister/gitlab/project.rb +15 -6
- data/lib/checklister/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: 78e466de3b78da29b9b12e95aa4778da7c1efaf5
|
4
|
+
data.tar.gz: 7db9691ccbe80398e451d53ea4c7dbb76166af02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1b58654ba268f84156437ce39dd08c1aed82478867c50066883f52045daa9a947739747e71d77271ee6b0008e4712ef1200626ea66c9b0fee57ac001e8e4317
|
7
|
+
data.tar.gz: 3ce3e01fbe39938bb457fb2eac7396cb84ba89329d95a6c3d21d8863d1181196cad5396547f4039a1c2df20212e89bab96ca83d3719f7e38d7d01412a6c144c9
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
|
4
4
|
NOTE: the project follows [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## 0.9.4 - 2015-09-26
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
- [improvement] When doing a project in gitlab, we should ideally be able to also search in the namespace
|
11
|
+
|
6
12
|
## 0.9.3 - 2015-09-26
|
7
13
|
|
8
14
|
### Added
|
@@ -24,7 +24,8 @@ module Checklister
|
|
24
24
|
|
25
25
|
class Project
|
26
26
|
# Default options that we want to pass when querying the gitlab project index
|
27
|
-
DEFAULT_OPTIONS = { order_by: "id", sort: "asc", per_page: "
|
27
|
+
DEFAULT_OPTIONS = { order_by: "id", sort: "asc", per_page: "100" }
|
28
|
+
MAX_PAGES = 5
|
28
29
|
|
29
30
|
# Initialize a gitlab project instance
|
30
31
|
#
|
@@ -49,16 +50,24 @@ module Checklister
|
|
49
50
|
# @return [Array] and array of project's properties as Hash
|
50
51
|
def all(options = {})
|
51
52
|
query_options = DEFAULT_OPTIONS.merge options
|
52
|
-
|
53
|
+
projects = []
|
54
|
+
page = 1
|
55
|
+
while page <= MAX_PAGES
|
56
|
+
projects += @client.projects(query_options.merge(page: page)).map { |p| ProjectDecorator.new(p).to_hash }
|
57
|
+
if projects.empty?
|
58
|
+
page = MAX_PAGES
|
59
|
+
else
|
60
|
+
page += 1
|
61
|
+
end
|
62
|
+
end
|
63
|
+
projects
|
53
64
|
end
|
54
65
|
|
55
66
|
# Get gitlab's projects based on a search string (LIKE on project#name)
|
56
67
|
# @param name [String] partial project's name
|
57
|
-
# @param options [optional, Hash] query options
|
58
68
|
# @return [Array] and array of project's properties as Hash
|
59
|
-
def filtered_by_name(name
|
60
|
-
|
61
|
-
@client.project_search(name, query_options).map { |p| ProjectDecorator.new(p).to_hash }
|
69
|
+
def filtered_by_name(name)
|
70
|
+
all.select { |p| p[:name].downcase.include? name.downcase }
|
62
71
|
end
|
63
72
|
end
|
64
73
|
end
|
data/lib/checklister/version.rb
CHANGED