grape-markdown 0.0.1 → 0.0.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e78a882d691c6608a8cc6772a6d26d495671c9e2
|
4
|
+
data.tar.gz: 95194bf0b6ac4004f4fb8d6d04d802c97e2dc9e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3da325418b11617847ba3d7f3f8cf4848aded3e3a2a9b33dd0ff351d229e02df49272f8991a46cd03150b97e1a7df1f124a6d603cc64b486c29df8446fc1100b
|
7
|
+
data.tar.gz: 14fba51ade118c7b5f5ec4ae4a30934915d8649c687548a3dffc5358739519896ac9252b1b07649014dc1ab455386924a37d4eb34986dfd1f29ec1a6085f8193
|
data/lib/grape-markdown/route.rb
CHANGED
@@ -2,7 +2,11 @@ module GrapeMarkdown
|
|
2
2
|
class Route < SimpleDelegator
|
3
3
|
# would like to rely on SimpleDelegator but Grape::Route uses
|
4
4
|
# method_missing for these methods :'(
|
5
|
-
delegate :route_namespace,
|
5
|
+
delegate :route_namespace,
|
6
|
+
:route_path,
|
7
|
+
:route_method,
|
8
|
+
:route_description,
|
9
|
+
to: '__getobj__'
|
6
10
|
|
7
11
|
def route_params
|
8
12
|
@route_params ||= __getobj__.route_params.sort.map do |param|
|
@@ -15,10 +19,6 @@ module GrapeMarkdown
|
|
15
19
|
route_path.match('\/(\w*?)[\.\/\(]').captures.first
|
16
20
|
end
|
17
21
|
|
18
|
-
def route_description
|
19
|
-
"#{__getobj__.route_description} [#{route_method.upcase}]"
|
20
|
-
end
|
21
|
-
|
22
22
|
def route_path_without_format
|
23
23
|
route_path.gsub(/\((.*?)\)/, '')
|
24
24
|
end
|
@@ -29,11 +29,7 @@ module GrapeMarkdown
|
|
29
29
|
|
30
30
|
return unless hash.present?
|
31
31
|
|
32
|
-
# format json spaces for blueprint markdown
|
33
32
|
JSON.pretty_generate(hash)
|
34
|
-
.gsub('{', (' ' * 14) + '{')
|
35
|
-
.gsub('}', (' ' * 14) + '}')
|
36
|
-
.gsub(/\ {2}\"/, (' ' * 16) + '"')
|
37
33
|
end
|
38
34
|
|
39
35
|
def response(list = false)
|
@@ -43,13 +39,7 @@ module GrapeMarkdown
|
|
43
39
|
|
44
40
|
hash = [hash] if list
|
45
41
|
|
46
|
-
# format json spaces for blueprint markdown
|
47
42
|
JSON.pretty_generate(hash)
|
48
|
-
.gsub('[', (' ' * 12) + '[')
|
49
|
-
.gsub(']', (' ' * 12) + ']')
|
50
|
-
.gsub('{', (' ' * 14) + '{')
|
51
|
-
.gsub('}', (' ' * 14) + '}')
|
52
|
-
.gsub(/\ {2}\"/, (' ' * 16) + '"')
|
53
43
|
end
|
54
44
|
end
|
55
45
|
end
|
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.2
|
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-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grape
|