grape-markdown 0.0.5 → 0.0.6

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: 30f403b536969e9ff19d17557900c45af9560c43
4
- data.tar.gz: a6e79f5280fd10081e291afb34ad391de064b34f
3
+ metadata.gz: fd6795347e2d992cc9afb0cff433233546c37c85
4
+ data.tar.gz: 2ae1d275b9041fb8156b00fa03e0dba70771a152
5
5
  SHA512:
6
- metadata.gz: 845705d3464c1b22597cc19979488b546ebd7f8db9ca0228ae84da26348fbf50b2acf93dda6556294a83abea97d151e1bbb6fd3a98fbf84a9ae8f1dc5ac3daee
7
- data.tar.gz: 365d3089e3a15d327684040cbf69b69d2ab3f51beed7e01fc7c218bd09773938853e9ffd865286ca1d1ed61a5a353ad2ff4bbcd841058faecbd12b72aec0e6fb
6
+ metadata.gz: 0a932d99462ca9b8730897151b20876612919d4107a349851a3ee30a01902e11f6243a65f8039c0d87798e404ff5095d90b257240bd3fd5084414dbdff41b71b
7
+ data.tar.gz: 507427675239837beb66161070d93ecacf44fefa80348f951596444b0a4fd1136fa77d39221ff3dc3f3786b1a297984cf463f5af51022c29af512183ca00399d
@@ -30,7 +30,7 @@ module GrapeMarkdown
30
30
  def resources
31
31
  @resources ||= begin
32
32
  grouped_routes = routes.group_by(&:route_name).reject do |name, routes|
33
- resource_exclusion.include?(name.to_sym)
33
+ resource_exclusion.include?(name.parameterize('_').to_sym)
34
34
  end
35
35
 
36
36
  grouped_routes.map { |name, routes| Resource.new(name, routes) }
@@ -38,7 +38,9 @@ module GrapeMarkdown
38
38
  #{list? ? route_title : route_title.singularize}
39
39
  DESCRIPTION
40
40
 
41
- description << "on a #{root_resource_title.singularize}" if has_parent?
41
+ description << "on a #{root_resource_title.singularize}" if parent?
42
+
43
+ description
42
44
  end
43
45
 
44
46
  def route_path_without_format
@@ -63,7 +65,7 @@ module GrapeMarkdown
63
65
  !%w(GET DELETE).include?(route_method)
64
66
  end
65
67
 
66
- def has_parent?
68
+ def parent?
67
69
  route_name != root_resource
68
70
  end
69
71
  end
@@ -1,3 +1,3 @@
1
1
  module GrapeMarkdown
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -39,6 +39,10 @@ describe GrapeMarkdown::Document do
39
39
  it 'includes properties for the resources' do
40
40
  expect(subject).to include('Properties')
41
41
  end
42
+
43
+ it 'includes short route descriptions' do
44
+ expect(subject).to include('## Post a Widget')
45
+ end
42
46
  end
43
47
 
44
48
  it 'exposes configuration settings' do
@@ -31,6 +31,28 @@ class SampleApi < Grape::API
31
31
  end
32
32
  end
33
33
 
34
+ resource '/widgets/:widget_id/sprockets' do
35
+ desc 'create a sprocket for a specific widget'
36
+ params do
37
+ requires :name,
38
+ type: 'string',
39
+ desc: 'the widgets name',
40
+ documentation: { example: 'super widget' }
41
+ end
42
+ post '/' do
43
+ end
44
+
45
+ desc 'updates a sprocket for a specific widget'
46
+ params do
47
+ requires :name,
48
+ type: 'string',
49
+ desc: 'the widgets name',
50
+ documentation: { example: 'super widget' }
51
+ end
52
+ put ':id' do
53
+ end
54
+ end
55
+
34
56
  resource 'admin' do
35
57
  get '/' do
36
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grape-markdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Allen