restapi 0.0.2 → 0.0.3
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.
- data/.travis.yml +5 -0
- data/Gemfile +4 -7
- data/Gemfile.lock +5 -25
- data/README.rdoc +3 -0
- data/app/controllers/restapi/restapis_controller.rb +3 -12
- data/app/public/restapi/javascripts/jst.js +41 -22
- data/app/public/restapi/javascripts/restapi.js +4 -5
- data/app/public/restapi/javascripts/routers/documentation_router.js +13 -8
- data/lib/restapi.rb +1 -2
- data/lib/restapi/application.rb +28 -23
- data/lib/restapi/dsl_definition.rb +8 -12
- data/lib/restapi/helpers.rb +2 -2
- data/lib/restapi/markup.rb +45 -0
- data/lib/restapi/method_description.rb +82 -16
- data/lib/restapi/param_description.rb +36 -11
- data/lib/restapi/resource_description.rb +18 -10
- data/lib/restapi/restapi_module.rb +6 -7
- data/lib/restapi/static_dispatcher.rb +2 -0
- data/lib/restapi/validator.rb +40 -31
- data/lib/restapi/version.rb +1 -1
- data/restapi.gemspec +1 -1
- data/spec/controllers/users_controller_spec.rb +156 -32
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/dogs_controller.rb +0 -2
- data/spec/dummy/app/controllers/users_controller.rb +20 -5
- data/spec/dummy/config/database.yml +2 -3
- data/spec/dummy/config/environment.rb +3 -0
- data/spec/dummy/config/initializers/restapi.rb +6 -2
- data/spec/dummy/config/routes.rb +11 -64
- metadata +7 -21
- data/spec/dummy/app/views/users/doc.html.erb +0 -24
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pavel Pokorny
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-04-
|
18
|
+
date: 2012-04-26 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rspec-rails
|
@@ -45,20 +45,6 @@ dependencies:
|
|
45
45
|
version: "0"
|
46
46
|
type: :development
|
47
47
|
version_requirements: *id002
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: rest-client
|
50
|
-
prerelease: false
|
51
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
|
-
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
hash: 3
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
version: "0"
|
60
|
-
type: :runtime
|
61
|
-
version_requirements: *id003
|
62
48
|
description: Maintain your API documentation up to date!
|
63
49
|
email:
|
64
50
|
- pajkycz@gmail.com
|
@@ -73,6 +59,7 @@ files:
|
|
73
59
|
- .gitignore
|
74
60
|
- .rspec
|
75
61
|
- .rvmrc
|
62
|
+
- .travis.yml
|
76
63
|
- Gemfile
|
77
64
|
- Gemfile.lock
|
78
65
|
- MIT-LICENSE
|
@@ -99,6 +86,7 @@ files:
|
|
99
86
|
- lib/restapi/dsl_definition.rb
|
100
87
|
- lib/restapi/error_description.rb
|
101
88
|
- lib/restapi/helpers.rb
|
89
|
+
- lib/restapi/markup.rb
|
102
90
|
- lib/restapi/method_description.rb
|
103
91
|
- lib/restapi/param_description.rb
|
104
92
|
- lib/restapi/railtie.rb
|
@@ -118,7 +106,6 @@ files:
|
|
118
106
|
- spec/dummy/app/controllers/users_controller.rb
|
119
107
|
- spec/dummy/app/helpers/application_helper.rb
|
120
108
|
- spec/dummy/app/views/layouts/application.html.erb
|
121
|
-
- spec/dummy/app/views/users/doc.html.erb
|
122
109
|
- spec/dummy/config.ru
|
123
110
|
- spec/dummy/config/application.rb
|
124
111
|
- spec/dummy/config/boot.rb
|
@@ -177,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
164
|
requirements: []
|
178
165
|
|
179
166
|
rubyforge_project:
|
180
|
-
rubygems_version: 1.8.
|
167
|
+
rubygems_version: 1.8.23
|
181
168
|
signing_key:
|
182
169
|
specification_version: 3
|
183
170
|
summary: REST API documentation tool
|
@@ -191,7 +178,6 @@ test_files:
|
|
191
178
|
- spec/dummy/app/controllers/users_controller.rb
|
192
179
|
- spec/dummy/app/helpers/application_helper.rb
|
193
180
|
- spec/dummy/app/views/layouts/application.html.erb
|
194
|
-
- spec/dummy/app/views/users/doc.html.erb
|
195
181
|
- spec/dummy/config.ru
|
196
182
|
- spec/dummy/config/application.rb
|
197
183
|
- spec/dummy/config/boot.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
<h3>Method:</h3>
|
2
|
-
<strong>Name</strong>: <%= @api.method %><br>
|
3
|
-
<strong>Resource</strong>: <%= @api.resource %><br>
|
4
|
-
<strong>Short description</strong>: <%= @api.short_description %><br>
|
5
|
-
<strong>URL path</strong>: <%= @api.path %><br>
|
6
|
-
<strong>HTTP method</strong>: <%= @api.http %><br>
|
7
|
-
<strong>Description:</strong> <%= @api.full_description.html_safe %><br>
|
8
|
-
|
9
|
-
<h3>Errors:</h3>
|
10
|
-
<% @api.errors.each do |err| %>
|
11
|
-
<%= err.code %>
|
12
|
-
<%= err.description %>
|
13
|
-
<br>
|
14
|
-
<% end %>
|
15
|
-
|
16
|
-
<h3>Params:</h3>
|
17
|
-
<% @api.params.each do |_, param| %>
|
18
|
-
<%= param.name %>:
|
19
|
-
<ul>
|
20
|
-
<li>Description: <%= param.desc %></li>
|
21
|
-
<li>Required: <%= param.required ? 'yes' : 'no' %></li>
|
22
|
-
<li>Validator: <%= param.validator.inspect %></li>
|
23
|
-
</ul>
|
24
|
-
<% end %>
|