Commit 07f306d8af41c158ba57633fcb129d1a96169877

Authored by Sebastian Ziebell
2 parents 3b3add35 e4b67d3b

Merge branch 'master' into fixes/api

Gemfile
... ... @@ -39,7 +39,8 @@ gem "pygments.rb", git: "https://github.com/gitlabhq/pygments.rb.git", branch:
39 39 gem "github-linguist", "~> 2.3.4" , require: "linguist"
40 40  
41 41 # API
42   -gem "grape", "~> 0.2.1"
  42 +gem "grape", "~> 0.3.1"
  43 +gem "grape-entity", "~> 0.2.0"
43 44  
44 45 # Format dates and times
45 46 # based on human-friendly examples
... ...
Gemfile.lock
... ... @@ -182,8 +182,9 @@ GEM
182 182 pyu-ruby-sasl (~> 0.0.3.1)
183 183 rubyntlm (~> 0.1.1)
184 184 gitlab_yaml_db (1.0.0)
185   - grape (0.2.2)
  185 + grape (0.3.1)
186 186 activesupport
  187 + grape-entity (~> 0.2.0)
187 188 hashie (~> 1.2)
188 189 multi_json (>= 1.3.2)
189 190 multi_xml
... ... @@ -191,6 +192,7 @@ GEM
191 192 rack-accept
192 193 rack-mount
193 194 virtus
  195 + grape-entity (0.2.0)
194 196 growl (1.0.3)
195 197 guard (1.5.4)
196 198 listen (>= 0.4.2)
... ... @@ -481,7 +483,8 @@ DEPENDENCIES
481 483 gitlab_omniauth-ldap (= 1.0.2)
482 484 gitlab_yaml_db (= 1.0.0)
483 485 grack!
484   - grape (~> 0.2.1)
  486 + grape (~> 0.3.1)
  487 + grape-entity (~> 0.2.0)
485 488 grit!
486 489 grit_ext!
487 490 growl
... ...
lib/api.rb
... ... @@ -22,7 +22,6 @@ module Gitlab
22 22 end
23 23  
24 24 format :json
25   - error_format :json
26 25 helpers APIHelpers
27 26  
28 27 mount Groups
... ...
lib/api/projects.rb
... ... @@ -340,7 +340,7 @@ module Gitlab
340 340 authorize! :download_code, user_project
341 341  
342 342 page = params[:page] || 0
343   - per_page = params[:per_page] || 20
  343 + per_page = params[:per_page].to_i || 20
344 344 ref = params[:ref_name] || user_project.try(:default_branch) || 'master'
345 345  
346 346 commits = user_project.repository.commits(ref, nil, per_page, page * per_page)
... ...