api_canon 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -10
  3. data/lib/api_canon/version.rb +1 -1
  4. metadata +2 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2f4993fa3f12d27e8ff54ca9ee6becafa5bb6080
4
- data.tar.gz: 31e54ec37b2a8715bd0d8c31729734cc34d816ac
3
+ metadata.gz: 9fa91521da7d5fd5b48562111c5d99d83bb69a3f
4
+ data.tar.gz: 65e021ee8670382922e8211367dd53fa2e9a5df3
5
5
  SHA512:
6
- metadata.gz: a851685829187972e5b14c379846f9a1fb42c587b16c52edccf46b79d67d5d61c3cd21653cb70948d07429cb1fc0ec133489462bdc41a7a074670d1613fe1880
7
- data.tar.gz: 6d67a86a1019e78a56a566bdac9c5790ec63edfd958e95ee571526bd1814505cb033c23b71f247b1ee8a2841cd57630a8fc2bdaf2b27c309d65775b4e18e8d68
6
+ metadata.gz: 23746edbb6ce43120aed1fd73b374dee09865390eed1810364fd46a5864e1a81d2506ad98a7fe0c3ed13d3ee96a36469cf38fbd4659185c43ff4eba1abc94a1e
7
+ data.tar.gz: 33f3ae296a40dc414ad5cbf8871ad2d6d56227a3ebdc4bae5f6d63b0a60d4025082513fa0070a4e350c3c6ae1342ddb06d56945779920630b3baad57edb232a1
data/README.md CHANGED
@@ -21,7 +21,8 @@ include ApiCanon
21
21
 
22
22
  ```ruby
23
23
  document_controller :as => 'optional_rename' do
24
- describe "The actions here are awesome, they allow you to get a list of awesome things, and make awesome things, too!"
24
+ describe %Q{The actions here are awesome, they allow you to get a list of
25
+ awesome things, and make awesome things, too!}
25
26
  end
26
27
  ```
27
28
 
@@ -31,7 +32,10 @@ More usefully you can document all the actions you want like this:
31
32
 
32
33
  ```ruby
33
34
  document_method :index do
34
- param :category_codes, :type => :array, :multiple => true, :example_values => Category.all(:limit => 5, :select => :code).map(&:code), :description => "Return only categories for the given category codes", :default => 'some-awesome-category-code'
35
+ param :category_codes, :type => :array, :multiple => true,
36
+ :example_values => Category.limit(5).pluck(:code),
37
+ :description => "Return only categories for the given category codes",
38
+ :default => 'some-awesome-category-code'
35
39
  end
36
40
  ```
37
41
 
@@ -56,8 +60,11 @@ class CategoriesController < ApplicationController
56
60
 
57
61
  document_method :index do
58
62
  describe "This gives you a bunch of categories."
59
- param :node, :type => :string, :values => ['womens-fashion', 'mens-fashion'], :default => 'womens-fashion', :description => "Category code to start with"
60
- param :depth, :type => :integer, :values => 1..4, :default => 1, :description => "Maximum depth to include child categories"
63
+ param :node, :type => :string, :default => 'womens-fashion',
64
+ :values => ['womens-fashion', 'mens-fashion'],
65
+ :description => "Category code to start with"
66
+ param :depth, :type => :integer, :values => 1..4, :default => 1,
67
+ :description => "Maximum depth to include child categories"
61
68
  end
62
69
  def index
63
70
  # Do stuff.
@@ -86,18 +93,29 @@ class FunkyCategoriesController < ApplicationController
86
93
  include ApiCanon
87
94
 
88
95
  document_controller :as => 'Categories' do
89
- describe "Categories are used for filtering products. They are hierarchical, with 4 levels. These 4 levels are known as Super-Categories, Categories, Sub-Categories and Types. Examples include \"Women's Fashion\", \"Shirts\" and so forth. They are uniquely identifiable by their category_code field."
96
+ describe %Q{Categories are used for filtering products. They are
97
+ hierarchical, with 4 levels. Examples include "Women's Fashion",
98
+ "Shirts" and so forth. They are uniquely identifiable by their
99
+ category_code field.}
90
100
  end
91
101
 
92
102
  document_method :index do
93
- describe "This action returns a filtered tree of categories based on the parameters given in the request."
94
- param :hierarchy_level, :values => 1..4, :type => :integer, :default => 1, :description => "Maximum depth to include child categories"
95
- param :category_codes, :type => :array, :multiple => true, :example_values => Category.online.enabled.super_categories.all(:limit => 5, :select => :code).map(&:code), :description => "Return only categories for the given category codes", :default => 'mens-fashion-accessories'
103
+ describe %Q{This action returns a filtered tree of categories based on the
104
+ parameters given in the request.}
105
+ param :hierarchy_level, :values => 1..4, :type => :integer, :default => 1,
106
+ :description => "Maximum depth to include child categories"
107
+ param :category_codes, :type => :array, :multiple => true,
108
+ :example_values => Category.limit(5).pluck(:code),
109
+ :description => "Return only categories for the given category codes",
110
+ :default => 'mens-fashion-accessories'
96
111
  end
97
112
 
98
113
  document_method :show do
99
- describe "This action returns a tree of categories starting at the requested root node."
100
- param :id, :type => :string, :example_values => Category.online.enabled.super_categories.all(:limit => 5, :select => :code).map(&:code), :description => "Category code to show, the root node for the entire tree.", :default => 'mens-fashion-accessories'
114
+ describe %Q{This action returns a tree of categories starting at the
115
+ requested root node.}
116
+ param :id, :type => :string,:default => 'mens-fashion-accessories',
117
+ :example_values => Category.limit(5).pluck(:code),
118
+ :description => "Category code to show, the root node for the entire tree."
101
119
  end
102
120
 
103
121
  #... code to support the above documented parameters etc.
@@ -1,3 +1,3 @@
1
1
  module ApiCanon
2
- VERSION = '0.2.5'
2
+ VERSION = '0.2.6'
3
3
  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.5
4
+ version: 0.2.6
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-07 00:00:00.000000000 Z
11
+ date: 2013-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,20 +66,6 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: redcarpet
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - '>='
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
69
  description: |-
84
70
  api_canon is a declarative documentation generator
85
71
  for APIs. Declare the parameters and response codes,