api_canon 0.2.7 → 0.2.8
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/README.md +5 -1
- data/lib/api_canon/version.rb +1 -1
- data/lib/api_canon.rb +2 -2
- 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: 249490f7cc9a83ad56dd8565ca49cb50d6e1e96e
|
|
4
|
+
data.tar.gz: 1267e0d3ef61a234622e8227c45cf27b5b10eaca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78c97fdc96307a82fd071559aa9da85aaf7ecfc45c8cbd14d33b80c915e2127e9f6517ecbab04024ac5c3bdaa3a7c03f2f4274bce7c0d89101630be87ab64d73
|
|
7
|
+
data.tar.gz: 5542805bec9fdfc19eb64a52c3d841870726acb3bad33e1735766394457a656f46b810a1a1b518f3410adf5efa5e23bc23b68e8fb5394e9b3236a07bbe849802
|
data/README.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# API Canon
|
|
2
2
|
|
|
3
|
+
Because API documentation should show you, not tell you.
|
|
4
|
+
|
|
3
5
|
[](https://travis-ci.org/cwalsh/api_canon)
|
|
4
6
|
|
|
5
7
|
## Introduction
|
|
6
|
-
API Canon is a tool for programatically documenting Ruby on Rails APIs with example usage.
|
|
8
|
+
API Canon is a tool for programatically documenting Ruby on Rails APIs with example usage.
|
|
9
|
+
It supports Rails 2, 3 and 4. You can see a real live example at
|
|
10
|
+
[http://www.westfield.com.au/api/product/latest/categories](http://www.westfield.com.au/api/product/latest/categories)
|
|
7
11
|
|
|
8
12
|
## Installation and usage
|
|
9
13
|
If you're using bundler, then put this in your Gemfile:
|
data/lib/api_canon/version.rb
CHANGED
data/lib/api_canon.rb
CHANGED
|
@@ -50,7 +50,7 @@ module ApiCanon
|
|
|
50
50
|
def document_controller(opts={}, &block)
|
|
51
51
|
document = DocumentationStore.fetch controller_path
|
|
52
52
|
document ||= Document.new controller_path, controller_name, opts
|
|
53
|
-
document.instance_eval &block
|
|
53
|
+
document.instance_eval &block if block_given?
|
|
54
54
|
DocumentationStore.store document
|
|
55
55
|
end
|
|
56
56
|
|
|
@@ -72,7 +72,7 @@ module ApiCanon
|
|
|
72
72
|
document = DocumentationStore.fetch controller_path
|
|
73
73
|
document ||= Document.new controller_path, controller_name
|
|
74
74
|
documented_action = ApiCanon::DocumentedAction.new method_name
|
|
75
|
-
documented_action.instance_eval &block
|
|
75
|
+
documented_action.instance_eval &block if block_given?
|
|
76
76
|
document.add_action documented_action
|
|
77
77
|
DocumentationStore.store document
|
|
78
78
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: api_canon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Cameron Walsh
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-05-
|
|
11
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|