jdoc 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/example-api-documentation.md +0 -4
- data/jdoc.gemspec +1 -1
- data/lib/jdoc/link.rb +2 -2
- data/lib/jdoc/resource.rb +4 -4
- data/lib/jdoc/version.rb +1 -1
- data/lib/jdoc.rb +1 -0
- data/spec/fixtures/schema.yml +0 -1
- data/template.md.erb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 272ba27b2c8096ee1cd29cf122bc4a3ad0ab1ce7
|
4
|
+
data.tar.gz: 132c4ab5391930817097b13e3e98a66fbe8c7ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9366989f68722a5a3cbe9f1b43ae5dc1b59453e461d7196f46a85feacdd1318e3a7cb2f1abfca5550bc0991fe1b48588ac3d6272a98f709368c50f7c71667859
|
7
|
+
data.tar.gz: 07e0d09dc49e06766e90a3066698a3ce8def4f1e8956906cb5d666a1d1d7b6c9c003d40b6d7cc7122e245a9f8449d4741505a94f04c333835f151ed6e738e1b1
|
data/CHANGELOG.md
CHANGED
@@ -66,7 +66,6 @@ Delete an existing app.
|
|
66
66
|
|
67
67
|
```
|
68
68
|
DELETE /apps/:id HTTP/1.1
|
69
|
-
Content-Type: application/json
|
70
69
|
Host: api.example.com
|
71
70
|
```
|
72
71
|
|
@@ -92,7 +91,6 @@ Info for existing app.
|
|
92
91
|
|
93
92
|
```
|
94
93
|
GET /apps/:id HTTP/1.1
|
95
|
-
Content-Type: application/json
|
96
94
|
Host: api.example.com
|
97
95
|
```
|
98
96
|
|
@@ -118,7 +116,6 @@ List existing apps.
|
|
118
116
|
|
119
117
|
```
|
120
118
|
GET /apps HTTP/1.1
|
121
|
-
Content-Type: application/json
|
122
119
|
Host: api.example.com
|
123
120
|
```
|
124
121
|
|
@@ -186,7 +183,6 @@ List recipes
|
|
186
183
|
|
187
184
|
```
|
188
185
|
GET /recipes HTTP/1.1
|
189
|
-
Content-Type: application/json
|
190
186
|
Host: api.example.com
|
191
187
|
```
|
192
188
|
|
data/jdoc.gemspec
CHANGED
@@ -16,9 +16,9 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
+
spec.add_dependency "activesupport"
|
19
20
|
spec.add_dependency "erubis"
|
20
21
|
spec.add_dependency "json_schema"
|
21
|
-
spec.add_development_dependency "activesupport"
|
22
22
|
spec.add_development_dependency "bundler", "~> 1.6"
|
23
23
|
spec.add_development_dependency "pry"
|
24
24
|
spec.add_development_dependency "rake"
|
data/lib/jdoc/link.rb
CHANGED
@@ -147,7 +147,7 @@ module Jdoc
|
|
147
147
|
# @param properties [Hash]
|
148
148
|
# @return [Hash]
|
149
149
|
# @example
|
150
|
-
# Jdoc::Link::ResponseGenerator(
|
150
|
+
# Jdoc::Link::ResponseGenerator(properties) #=> { "id" => 1, "name" => "example" }
|
151
151
|
def self.call(properties)
|
152
152
|
properties.inject({}) do |result, (key, value)|
|
153
153
|
result.merge(
|
@@ -161,7 +161,7 @@ module Jdoc
|
|
161
161
|
when value.type.include?("array")
|
162
162
|
[call(value.items.properties)]
|
163
163
|
else
|
164
|
-
raise ExampleNotFound, "No example found for #{
|
164
|
+
raise ExampleNotFound, "No example found for #{value.pointer}"
|
165
165
|
end
|
166
166
|
)
|
167
167
|
end
|
data/lib/jdoc/resource.rb
CHANGED
@@ -32,7 +32,7 @@ module Jdoc
|
|
32
32
|
# @example
|
33
33
|
# resource.title #=> "App"
|
34
34
|
def title
|
35
|
-
@schema.title
|
35
|
+
@title ||= @schema.title || @schema.pointer.split("/").last.camelize
|
36
36
|
end
|
37
37
|
|
38
38
|
# @return [Array<Jdoc::Property>]
|
@@ -44,16 +44,16 @@ module Jdoc
|
|
44
44
|
|
45
45
|
# Defined to change uniqueness in Hash key
|
46
46
|
def hash
|
47
|
-
|
47
|
+
title.hash
|
48
48
|
end
|
49
49
|
|
50
50
|
# Defined to change uniqueness in Hash key
|
51
51
|
def eql?(other)
|
52
|
-
|
52
|
+
title == other.title
|
53
53
|
end
|
54
54
|
|
55
55
|
def <=>(other)
|
56
|
-
|
56
|
+
title <=> other.title
|
57
57
|
end
|
58
58
|
|
59
59
|
def links
|
data/lib/jdoc/version.rb
CHANGED
data/lib/jdoc.rb
CHANGED
data/spec/fixtures/schema.yml
CHANGED
data/template.md.erb
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
```
|
26
26
|
<%= link.method %> <%= link.path %> HTTP/1.1
|
27
|
-
Content-Type: application/json
|
27
|
+
<%= "Content-Type: application/json\n" if link.has_request_body? -%>
|
28
28
|
Host: <%= schema.host_with_port %>
|
29
29
|
<%= "\n" + link.request_body if link.has_request_body? -%>
|
30
30
|
```
|
metadata
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: erubis
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,13 +39,13 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: json_schema
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
|
-
type: :
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|