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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68e23c8290bec0b00853a4ad4f768deec9f173bc
4
- data.tar.gz: 8ebfaadf92a10be7c8ec6db1c84df8adaa96c367
3
+ metadata.gz: 249490f7cc9a83ad56dd8565ca49cb50d6e1e96e
4
+ data.tar.gz: 1267e0d3ef61a234622e8227c45cf27b5b10eaca
5
5
  SHA512:
6
- metadata.gz: a287b10bf7431460d20f4e04310cbc9af2dbb6ca51ad1bce073773a89364f9296e11d9c14c46052f2b5de16ebe115ea91d54a98237ffc050f96e446915d58af1
7
- data.tar.gz: c1406e5b9fb6f1af36747429c23d33c01d2578cf7456fc870d678b19b77eb50ad62aa33112a464cca57e1f012e8a15176e2981f8a885e0fb03a57163801492d0
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
  [![Build Status](https://travis-ci.org/cwalsh/api_canon.png?branch=master)](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:
@@ -1,3 +1,3 @@
1
1
  module ApiCanon
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
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.7
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-14 00:00:00.000000000 Z
11
+ date: 2013-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails