api_canon 0.4.2 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 936137d1ba8d5b45575054ffa7256e7468fbd457
4
- data.tar.gz: 4bf72194dbd52c8a611f8061a704af227d2ef6ee
3
+ metadata.gz: c187459fb3312f6a298e12416a51499ce9f5c60a
4
+ data.tar.gz: 88a9d06fddf3b3f413dce2e93c93ce5922927fe8
5
5
  SHA512:
6
- metadata.gz: 909f47fb720e0abf57913eaf50d6aad5431b4c9c1f4b65f5488895eff417fd10f28bd8bd80ebe496ec9d6cf69f91da2e754523c8fb927695b5a19afc3be72b15
7
- data.tar.gz: 727389d6de3213745959a73c1b3e422b9ffae6d86fc16f515b358c60264a4f13e6833f6c219ca5102a487576594db3de0d827938a62439710527d68d2d91c48e
6
+ metadata.gz: 1347370f6ee8ae03530a0c343100b3ea2cc5a92e6cd9b3ba2016744f735db4b6069c247ae254213051bb2e5559c7e44b08be4f1ff8ba16ea099009bd0e80874a
7
+ data.tar.gz: de9d214e7053256806977ca2e73a4b3a89263fb59baf030b35cccf0a959e8d77078f66df2e3ca5af7f76155472a457312b23769bb2d30453c225aaa8ce6aa71f
data/README.md CHANGED
@@ -6,9 +6,11 @@ Because API documentation should show you, not tell you.
6
6
 
7
7
  ## Introduction
8
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
9
+ It supports Rails 2 (see the Rails2 branch, api_canon versions less than 0.4), 3 and 4. You can see a real live example at
10
10
  [http://www.westfield.com.au/api/product/latest/categories](http://www.westfield.com.au/api/product/latest/categories)
11
11
 
12
+ As of 0.4.1, api_canon now supports [https://developers.helloreverb.com/swagger/](Swagger) json output, but only supports Rails 3+.
13
+
12
14
  ## Installation and usage
13
15
  If you're using bundler, then put this in your Gemfile:
14
16
 
@@ -30,6 +32,7 @@ include ApiCanon
30
32
 
31
33
  ```ruby
32
34
  document_controller :as => 'optional_rename' do
35
+ link_path '/foo' #Optionally override the sidebar link.
33
36
  describe %Q{The actions here are awesome, they allow you to get a list of
34
37
  awesome things, and make awesome things, too!}
35
38
  end
@@ -144,3 +147,6 @@ Right now, api_canon is changing a lot. I plan to support the following feature
144
147
  3. Pull request
145
148
  4. ???
146
149
  5. Profit.
150
+
151
+ # License
152
+ See MIT-LICENSE.
@@ -65,7 +65,10 @@
65
65
  <% content_for :sidebar do %>
66
66
  <ul class='nav nav-list'>
67
67
  <% ApiCanon::DocumentationStore.instance.docos.each do |key, doco| %>
68
- <li><%= link_to doco.display_name, url_for(:controller => doco.controller_path, :action => :index, :format => :html) %></li>
68
+ <li>
69
+ <%- doco_link = doco.sidebar_link || url_for(:controller => doco.controller_path, :action => :index, :format => :html) -%>
70
+ <%= link_to doco.display_name, doco_link %>
71
+ </li>
69
72
  <% end %>
70
73
  </ul>
71
74
  <% end %>
@@ -1,7 +1,7 @@
1
1
  module ApiCanon
2
2
  class Document
3
3
  include ActiveModel::Serialization
4
- attr_reader :description, :controller_path, :controller_name, :version
4
+ attr_reader :description, :controller_path, :controller_name, :version, :sidebar_link
5
5
  attr_accessor :documented_actions
6
6
  def initialize(controller_path, controller_name, opts={})
7
7
  @controller_path = controller_path
@@ -17,6 +17,9 @@ module ApiCanon
17
17
  def describe(desc)
18
18
  @description = desc
19
19
  end
20
+ def link_path(link)
21
+ @sidebar_link = link
22
+ end
20
23
  def display_name
21
24
  @display_name || @controller_name.titleize
22
25
  end
@@ -1,3 +1,3 @@
1
1
  module ApiCanon
2
- VERSION = '0.4.2'
2
+ VERSION = '0.4.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_canon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Walsh
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-22 00:00:00.000000000 Z
12
+ date: 2013-08-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails