restapi_doc 0.0.1 → 0.0.2
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/CHANGELOG.rdoc +8 -0
 - data/README.rdoc +41 -2
 - data/VERSION +1 -1
 - data/restapi_doc.gemspec +3 -2
 - metadata +15 -14
 
    
        data/CHANGELOG.rdoc
    ADDED
    
    
    
        data/README.rdoc
    CHANGED
    
    | 
         @@ -15,14 +15,53 @@ Run the following rake command to setup your environment. 
     | 
|
| 
       15 
15 
     | 
    
         | 
| 
       16 
16 
     | 
    
         
             
            This will create a 'restapi_doc' directory in your Rails config directory.
         
     | 
| 
       17 
17 
     | 
    
         
             
            In this directory you will now have a "restapi_doc.yml' file with some simple configuration options for your API document.
         
     | 
| 
      
 18 
     | 
    
         
            +
            == Documenting Controller class
         
     | 
| 
      
 19 
     | 
    
         
            +
            Below is a sample of how to document a class.
         
     | 
| 
       18 
20 
     | 
    
         | 
| 
      
 21 
     | 
    
         
            +
                    # =begin apidoc
         
     | 
| 
      
 22 
     | 
    
         
            +
            	# Description of class
         
     | 
| 
      
 23 
     | 
    
         
            +
                    # =end
         
     | 
| 
       19 
24 
     | 
    
         | 
| 
       20 
     | 
    
         
            -
            == Documenting controllers
         
     | 
| 
      
 25 
     | 
    
         
            +
            == Documenting controllers methods
         
     | 
| 
       21 
26 
     | 
    
         
             
            Below is a sample of how to document the controller to generate a document
         
     | 
| 
       22 
27 
     | 
    
         | 
| 
      
 28 
     | 
    
         
            +
                    # =begin apidoc
         
     | 
| 
      
 29 
     | 
    
         
            +
                    # method:: POST
         
     | 
| 
      
 30 
     | 
    
         
            +
                    # requires_authentication:: Yes
         
     | 
| 
      
 31 
     | 
    
         
            +
                    # response_format:: json
         
     | 
| 
      
 32 
     | 
    
         
            +
                    # response_format:: xml
         
     | 
| 
      
 33 
     | 
    
         
            +
                    # param:: Name - string - required - Users name
         
     | 
| 
      
 34 
     | 
    
         
            +
                    # param:: Email - string - required - Users email address
         
     | 
| 
      
 35 
     | 
    
         
            +
                    # param:: Password - string - required - Users password.
         
     | 
| 
      
 36 
     | 
    
         
            +
                    #
         
     | 
| 
      
 37 
     | 
    
         
            +
                    # http_response:: 201 - Created - Returns user object
         
     | 
| 
      
 38 
     | 
    
         
            +
                    # http_response:: 401 - Not Authorized - Not authorized
         
     | 
| 
      
 39 
     | 
    
         
            +
                    # http_response:: 422 - Unprocessable Entity - Unable to process parameters
         
     | 
| 
      
 40 
     | 
    
         
            +
                    #
         
     | 
| 
      
 41 
     | 
    
         
            +
                    # request:: json
         
     | 
| 
      
 42 
     | 
    
         
            +
                    # {
         
     | 
| 
      
 43 
     | 
    
         
            +
                    #  "name":"Linda Clarkson",
         
     | 
| 
      
 44 
     | 
    
         
            +
                    #  "email":"athatcher@yahoo.com",
         
     | 
| 
      
 45 
     | 
    
         
            +
                    #  "password":"Hl108dLpSr"
         
     | 
| 
      
 46 
     | 
    
         
            +
                    # }
         
     | 
| 
      
 47 
     | 
    
         
            +
                    # ::request-end::
         
     | 
| 
      
 48 
     | 
    
         
            +
                    #
         
     | 
| 
      
 49 
     | 
    
         
            +
                    # output:: json
         
     | 
| 
      
 50 
     | 
    
         
            +
                    # {
         
     | 
| 
      
 51 
     | 
    
         
            +
                    #    "_id":"4f9778fe4736df029c000003",
         
     | 
| 
      
 52 
     | 
    
         
            +
                    #    "created_at":"2012-04-24T21:09:34-07:00",
         
     | 
| 
      
 53 
     | 
    
         
            +
                    #    "email":"athatcher@yahoo.com",
         
     | 
| 
      
 54 
     | 
    
         
            +
                    #    "name":"Linda Clarkson"
         
     | 
| 
      
 55 
     | 
    
         
            +
                    # }
         
     | 
| 
      
 56 
     | 
    
         
            +
                    # ::output-end::
         
     | 
| 
      
 57 
     | 
    
         
            +
                    #
         
     | 
| 
      
 58 
     | 
    
         
            +
                    #
         
     | 
| 
      
 59 
     | 
    
         
            +
                    # Creates a new user
         
     | 
| 
      
 60 
     | 
    
         
            +
                    # =end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
       23 
62 
     | 
    
         | 
| 
       24 
63 
     | 
    
         
             
            == Creating Api Document
         
     | 
| 
       25 
64 
     | 
    
         | 
| 
       26 
65 
     | 
    
         
             
                    rake restapi_doc:generate
         
     | 
| 
       27 
66 
     | 
    
         | 
| 
       28 
     | 
    
         
            -
            You will now have a 'apidoc' directory located in your Rails 'public' directory
         
     | 
| 
      
 67 
     | 
    
         
            +
            You will now have a 'apidoc' directory located in your Rails 'public' directory
         
     | 
    
        data/VERSION
    CHANGED
    
    | 
         @@ -1 +1 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            0.0. 
     | 
| 
      
 1 
     | 
    
         
            +
            0.0.2
         
     | 
    
        data/restapi_doc.gemspec
    CHANGED
    
    | 
         @@ -5,11 +5,11 @@ 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.name = "restapi_doc"
         
     | 
| 
       8 
     | 
    
         
            -
              s.version = "0.0. 
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = "0.0.2"
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         
     | 
| 
       11 
11 
     | 
    
         
             
              s.authors = ["Kevin Haight"]
         
     | 
| 
       12 
     | 
    
         
            -
              s.date = "2012-04- 
     | 
| 
      
 12 
     | 
    
         
            +
              s.date = "2012-04-27"
         
     | 
| 
       13 
13 
     | 
    
         
             
              s.description = "REST API doc generates an easy way to create a twitter style document for your RESTful interface.  \n                        Leveraging Twitter Bootstrap to create an easy to read document for your RESTful api. "
         
     | 
| 
       14 
14 
     | 
    
         
             
              s.email = "kevinjhaight@gmail.com"
         
     | 
| 
       15 
15 
     | 
    
         
             
              s.extra_rdoc_files = [
         
     | 
| 
         @@ -17,6 +17,7 @@ Gem::Specification.new do |s| 
     | 
|
| 
       17 
17 
     | 
    
         
             
                "README.rdoc"
         
     | 
| 
       18 
18 
     | 
    
         
             
              ]
         
     | 
| 
       19 
19 
     | 
    
         
             
              s.files = [
         
     | 
| 
      
 20 
     | 
    
         
            +
                "CHANGELOG.rdoc",
         
     | 
| 
       20 
21 
     | 
    
         
             
                "Gemfile",
         
     | 
| 
       21 
22 
     | 
    
         
             
                "Gemfile.lock",
         
     | 
| 
       22 
23 
     | 
    
         
             
                "LICENSE",
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: restapi_doc
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.2
         
     | 
| 
       5 
5 
     | 
    
         
             
              prerelease: 
         
     | 
| 
       6 
6 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       7 
7 
     | 
    
         
             
            authors:
         
     | 
| 
         @@ -9,11 +9,11 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date: 2012-04- 
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2012-04-27 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: activesupport
         
     | 
| 
       16 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: &2152415760 !ruby/object:Gem::Requirement
         
     | 
| 
       17 
17 
     | 
    
         
             
                none: false
         
     | 
| 
       18 
18 
     | 
    
         
             
                requirements:
         
     | 
| 
       19 
19 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -21,10 +21,10 @@ dependencies: 
     | 
|
| 
       21 
21 
     | 
    
         
             
                    version: '2.1'
         
     | 
| 
       22 
22 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       23 
23 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       24 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 24 
     | 
    
         
            +
              version_requirements: *2152415760
         
     | 
| 
       25 
25 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       26 
26 
     | 
    
         
             
              name: haml
         
     | 
| 
       27 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 27 
     | 
    
         
            +
              requirement: &2152415240 !ruby/object:Gem::Requirement
         
     | 
| 
       28 
28 
     | 
    
         
             
                none: false
         
     | 
| 
       29 
29 
     | 
    
         
             
                requirements:
         
     | 
| 
       30 
30 
     | 
    
         
             
                - - =
         
     | 
| 
         @@ -32,10 +32,10 @@ dependencies: 
     | 
|
| 
       32 
32 
     | 
    
         
             
                    version: 3.1.4
         
     | 
| 
       33 
33 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       34 
34 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       35 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 35 
     | 
    
         
            +
              version_requirements: *2152415240
         
     | 
| 
       36 
36 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       37 
37 
     | 
    
         
             
              name: rake
         
     | 
| 
       38 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 38 
     | 
    
         
            +
              requirement: &2152414660 !ruby/object:Gem::Requirement
         
     | 
| 
       39 
39 
     | 
    
         
             
                none: false
         
     | 
| 
       40 
40 
     | 
    
         
             
                requirements:
         
     | 
| 
       41 
41 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -43,10 +43,10 @@ dependencies: 
     | 
|
| 
       43 
43 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       44 
44 
     | 
    
         
             
              type: :development
         
     | 
| 
       45 
45 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       46 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 46 
     | 
    
         
            +
              version_requirements: *2152414660
         
     | 
| 
       47 
47 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       48 
48 
     | 
    
         
             
              name: jeweler
         
     | 
| 
       49 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 49 
     | 
    
         
            +
              requirement: &2152413760 !ruby/object:Gem::Requirement
         
     | 
| 
       50 
50 
     | 
    
         
             
                none: false
         
     | 
| 
       51 
51 
     | 
    
         
             
                requirements:
         
     | 
| 
       52 
52 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -54,10 +54,10 @@ dependencies: 
     | 
|
| 
       54 
54 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       55 
55 
     | 
    
         
             
              type: :development
         
     | 
| 
       56 
56 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       57 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 57 
     | 
    
         
            +
              version_requirements: *2152413760
         
     | 
| 
       58 
58 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       59 
59 
     | 
    
         
             
              name: rspec
         
     | 
| 
       60 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 60 
     | 
    
         
            +
              requirement: &2152413180 !ruby/object:Gem::Requirement
         
     | 
| 
       61 
61 
     | 
    
         
             
                none: false
         
     | 
| 
       62 
62 
     | 
    
         
             
                requirements:
         
     | 
| 
       63 
63 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -65,10 +65,10 @@ dependencies: 
     | 
|
| 
       65 
65 
     | 
    
         
             
                    version: 2.2.0
         
     | 
| 
       66 
66 
     | 
    
         
             
              type: :development
         
     | 
| 
       67 
67 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       68 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 68 
     | 
    
         
            +
              version_requirements: *2152413180
         
     | 
| 
       69 
69 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       70 
70 
     | 
    
         
             
              name: mocha
         
     | 
| 
       71 
     | 
    
         
            -
              requirement: & 
     | 
| 
      
 71 
     | 
    
         
            +
              requirement: &2152412640 !ruby/object:Gem::Requirement
         
     | 
| 
       72 
72 
     | 
    
         
             
                none: false
         
     | 
| 
       73 
73 
     | 
    
         
             
                requirements:
         
     | 
| 
       74 
74 
     | 
    
         
             
                - - ! '>='
         
     | 
| 
         @@ -76,7 +76,7 @@ dependencies: 
     | 
|
| 
       76 
76 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       77 
77 
     | 
    
         
             
              type: :development
         
     | 
| 
       78 
78 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       79 
     | 
    
         
            -
              version_requirements: * 
     | 
| 
      
 79 
     | 
    
         
            +
              version_requirements: *2152412640
         
     | 
| 
       80 
80 
     | 
    
         
             
            description: ! "REST API doc generates an easy way to create a twitter style document
         
     | 
| 
       81 
81 
     | 
    
         
             
              for your RESTful interface.  \n                        Leveraging Twitter Bootstrap
         
     | 
| 
       82 
82 
     | 
    
         
             
              to create an easy to read document for your RESTful api. "
         
     | 
| 
         @@ -87,6 +87,7 @@ extra_rdoc_files: 
     | 
|
| 
       87 
87 
     | 
    
         
             
            - LICENSE
         
     | 
| 
       88 
88 
     | 
    
         
             
            - README.rdoc
         
     | 
| 
       89 
89 
     | 
    
         
             
            files:
         
     | 
| 
      
 90 
     | 
    
         
            +
            - CHANGELOG.rdoc
         
     | 
| 
       90 
91 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       91 
92 
     | 
    
         
             
            - Gemfile.lock
         
     | 
| 
       92 
93 
     | 
    
         
             
            - LICENSE
         
     |