grape-apiary 0.0.3 → 0.0.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: 4b15d2669d75c2f5461216dc111cb0680cf4ef03
4
- data.tar.gz: 7fae72c31f7d7b15050f170af438bae065fd62e2
3
+ metadata.gz: f0254ff34136f5e9ec9dd020fc5de5f223ba4a82
4
+ data.tar.gz: 1b3955dc1d5fcd60451f702aa82e8f00dee139d2
5
5
  SHA512:
6
- metadata.gz: b746ab57f5703d7f0791a8c35bf257c9d2e87c8d9a8f2b5db4d347793a065e59b277a0bc1f16325dded4c03f80d8488afbab340bfbc0859150029b15b9643c07
7
- data.tar.gz: 33f12c650f2518b7c5fb0570278bb70f4e684d5f524091862e73a3554884823d4b9763ad733d92b36d3f9e6ba85c415137aeae605cd38e0b344c387842940a8c
6
+ metadata.gz: 48f420f9bc8cca9a22b3cd71523c1892d76972e34502dd64bd4368506af938dc21f199895dc32f5dff06e0b94a752ed6acccd6fddb9c08ffcdd19a3c6960a272
7
+ data.tar.gz: 58e25392ce55c0c35b022dbb41abf58dfffdb5363c800eb7fa8c29004d53eb585f99f7a2a013853026ae5eb3540d3f336d36f6c793a24d2c6625bb79edcb9c42
@@ -60,6 +60,8 @@ module GrapeApiary
60
60
  private
61
61
 
62
62
  def formatted_headers(headers)
63
+ return '' unless headers.present?
64
+
63
65
  spacer = "\n" + (' ' * 12)
64
66
 
65
67
  strings = headers.map do |header|
@@ -68,7 +70,7 @@ module GrapeApiary
68
70
  "#{key}: #{value}"
69
71
  end
70
72
 
71
- strings.join(spacer)
73
+ " + Headers\n" + spacer + strings.join(spacer)
72
74
  end
73
75
  end
74
76
  end
@@ -43,8 +43,10 @@ module GrapeApiary
43
43
  def unique_params
44
44
  # TODO: this is a hack, assuming that the resource has a POST or PUT
45
45
  # route that defines all of the parameters that would define the resource
46
+ methods = %w(POST PUT)
47
+
46
48
  potential = routes.select do |route|
47
- %w(POST PUT).include?(route.route_method)
49
+ methods.include?(route.route_method) && route.route_params.present?
48
50
  end
49
51
 
50
52
  if potential.present?
@@ -18,19 +18,15 @@ Actions on the <%= resource.name %> resource
18
18
  <% end %>
19
19
  <% resource_by_path.routes.each do |route| %>
20
20
  ### <%= route.route_description %>
21
- <%= route.request_description %>
22
- + Headers
23
-
24
- <%= formatted_request_headers %>
25
21
  <% if show_request_sample?(route) %>
22
+ <%= route.request_description %>
23
+ <%= formatted_request_headers %>
26
24
  + Body
27
25
 
28
26
  <%= resource.sample_request %>
29
27
  <% end %>
30
- <%= route.request_description %>
31
- + Headers
32
-
33
- <%= formatted_response_headers %>
28
+ <%= route.response_description %>
29
+ <%= formatted_response_headers %>
34
30
 
35
31
  + Body
36
32
 
@@ -1,3 +1,3 @@
1
1
  module GrapeApiary
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-apiary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Allen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-09 00:00:00.000000000 Z
11
+ date: 2014-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape