checklister 0.9.3 → 0.9.4

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: 08d5e35df41587f793a8f21775e8fafeb9d4c04b
4
- data.tar.gz: c5613a39590bf9203abfd5aec3eb8f5ae720f450
3
+ metadata.gz: 78e466de3b78da29b9b12e95aa4778da7c1efaf5
4
+ data.tar.gz: 7db9691ccbe80398e451d53ea4c7dbb76166af02
5
5
  SHA512:
6
- metadata.gz: 15f2bb49f709e445ec8dcbb31865ff634aeebc3a4a0f77839823b0f174aaef5c345946c9487cd854d38b000aeed48250bb973cdef33c39e14893955b2c7261b9
7
- data.tar.gz: a84716cfd646cfdcb79814fb04db912b4186a7a44da842c032527f5300deaaa013e0a3c771ca8103c621de1113dc3a12f97d49d2d6a58e4a1c3271a0950d62e8
6
+ metadata.gz: b1b58654ba268f84156437ce39dd08c1aed82478867c50066883f52045daa9a947739747e71d77271ee6b0008e4712ef1200626ea66c9b0fee57ac001e8e4317
7
+ data.tar.gz: 3ce3e01fbe39938bb457fb2eac7396cb84ba89329d95a6c3d21d8863d1181196cad5396547f4039a1c2df20212e89bab96ca83d3719f7e38d7d01412a6c144c9
@@ -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: "200" }
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
- @client.projects(query_options).map { |p| ProjectDecorator.new(p).to_hash }
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, options = {})
60
- query_options = DEFAULT_OPTIONS.merge options
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
@@ -1,3 +1,3 @@
1
1
  module Checklister
2
- VERSION = "0.9.3"
2
+ VERSION = "0.9.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checklister
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Thouret