grape-markdown 0.0.1 → 0.0.2

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: 3dc94cf1475a3e3615cc3215cdf9e54eb6a02fa8
4
- data.tar.gz: 7d5e62aa00c83c69d95bc20c9b0d592bd47ddc87
3
+ metadata.gz: e78a882d691c6608a8cc6772a6d26d495671c9e2
4
+ data.tar.gz: 95194bf0b6ac4004f4fb8d6d04d802c97e2dc9e5
5
5
  SHA512:
6
- metadata.gz: 855fcaf8917043fe5a6121a1722f6669a73d18bf3cb660ed8ca977f6f3b28b8534b27b1f6b4c600688e52a2c455c8fe34510e80ef54e7de7f4e88c45698bf999
7
- data.tar.gz: 93694b04db560f1c38c99d1dc247602da9372092aab7501b71403eae875e2c57d80a59b2361a5c73660c867993f456f9edf68689f2ddad9797fd2c0ac6a218e0
6
+ metadata.gz: 3da325418b11617847ba3d7f3f8cf4848aded3e3a2a9b33dd0ff351d229e02df49272f8991a46cd03150b97e1a7df1f124a6d603cc64b486c29df8446fc1100b
7
+ data.tar.gz: 14fba51ade118c7b5f5ec4ae4a30934915d8649c687548a3dffc5358739519896ac9252b1b07649014dc1ab455386924a37d4eb34986dfd1f29ec1a6085f8193
@@ -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, :route_path, :route_method, to: '__getobj__'
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
@@ -1,3 +1,3 @@
1
1
  module GrapeMarkdown
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
@@ -38,8 +38,6 @@ describe GrapeMarkdown::Document do
38
38
 
39
39
  it 'includes properties for the resources' do
40
40
  expect(subject).to include('Properties')
41
- `clear`
42
- puts subject
43
41
  end
44
42
  end
45
43
 
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.1
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-25 00:00:00.000000000 Z
11
+ date: 2014-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grape