grape-markdown 0.0.3 → 0.0.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/lib/grape-markdown/route.rb +4 -10
- data/lib/grape-markdown/sample_generator.rb +1 -1
- data/lib/grape-markdown/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e25251ad9ffa8528ff2cce7f2c22de9442bb0d4a
|
|
4
|
+
data.tar.gz: a712b64644241064a0ba9f72b3920181d77222a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 21dc05842af3d45fd5544a9bbfa036894eaad89e066dae87ca383b3fff9da666cfdbdbed19dd959a0b7b7c16c80a202b54f82cb020d17d1221a281901f40470d
|
|
7
|
+
data.tar.gz: a345de86136d1bdf399faa931612c837dc335d87cde936b763ae9f1637da7486228fc0c77d6ff04a97a060f769ccb6ec3601ae68246e0011bd0764813f15ff7a
|
data/lib/grape-markdown/route.rb
CHANGED
|
@@ -19,6 +19,10 @@ module GrapeMarkdown
|
|
|
19
19
|
route_path.match('\/(\w*?)[\.\/\(]').captures.first
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def route_short_description
|
|
23
|
+
"#{route_method.titleize} a #{route_model}"
|
|
24
|
+
end
|
|
25
|
+
|
|
22
26
|
def route_path_without_format
|
|
23
27
|
route_path.gsub(/\((.*?)\)/, '')
|
|
24
28
|
end
|
|
@@ -31,16 +35,6 @@ module GrapeMarkdown
|
|
|
31
35
|
list? ? 'collection' : 'single'
|
|
32
36
|
end
|
|
33
37
|
|
|
34
|
-
def request_description
|
|
35
|
-
"+ Request #{'(application/json)' if request_body?}"
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
def response_description
|
|
39
|
-
code = route_method == 'POST' ? 201 : 200
|
|
40
|
-
|
|
41
|
-
"+ Response #{code} (application/json)"
|
|
42
|
-
end
|
|
43
|
-
|
|
44
38
|
def list?
|
|
45
39
|
%w(GET POST).include?(route_method) && !route_path.include?(':id')
|
|
46
40
|
end
|
|
@@ -18,7 +18,7 @@ module GrapeMarkdown
|
|
|
18
18
|
|
|
19
19
|
hash = Hash[array.compact]
|
|
20
20
|
|
|
21
|
-
hash = hash.reverse_merge(id
|
|
21
|
+
hash = hash.reverse_merge('id' => Configuration.generate_id) if id
|
|
22
22
|
hash = { root => hash } if Configuration.include_root
|
|
23
23
|
|
|
24
24
|
hash
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: grape-markdown
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
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-
|
|
11
|
+
date: 2014-02-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: grape
|