easy_api_doc 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +58 -0
  4. data/Rakefile +40 -0
  5. data/app/assets/images/easy_api_doc/favicon.ico +0 -0
  6. data/app/assets/images/easy_api_doc/glyphicons-halflings-white.png +0 -0
  7. data/app/assets/images/easy_api_doc/glyphicons-halflings.png +0 -0
  8. data/app/assets/images/easy_api_doc/loading.gif +0 -0
  9. data/app/assets/javascripts/easy_api_doc/api.js +2 -0
  10. data/app/assets/javascripts/easy_api_doc/application.js +15 -0
  11. data/app/assets/javascripts/easy_api_doc/base64.js +65 -0
  12. data/app/assets/javascripts/easy_api_doc/bootstrap.js +1999 -0
  13. data/app/assets/javascripts/easy_api_doc/documentation.js +223 -0
  14. data/app/assets/javascripts/easy_api_doc/status_codes.js +61 -0
  15. data/app/assets/stylesheets/easy_api_doc/api.css +4 -0
  16. data/app/assets/stylesheets/easy_api_doc/application.css +13 -0
  17. data/app/assets/stylesheets/easy_api_doc/bootstrap.css +6805 -0
  18. data/app/assets/stylesheets/easy_api_doc/documentation.css +47 -0
  19. data/app/controllers/easy_api_doc/api_controller.rb +13 -0
  20. data/app/controllers/easy_api_doc/application_controller.rb +17 -0
  21. data/app/controllers/easy_api_doc/documentation_controller.rb +42 -0
  22. data/app/helpers/easy_api_doc/application_helper.rb +71 -0
  23. data/app/helpers/easy_api_doc/documentation_helper.rb +5 -0
  24. data/app/models/easy_api_doc/action.rb +59 -0
  25. data/app/models/easy_api_doc/api_version.rb +18 -0
  26. data/app/models/easy_api_doc/namespace.rb +14 -0
  27. data/app/models/easy_api_doc/parameter.rb +49 -0
  28. data/app/models/easy_api_doc/resource.rb +18 -0
  29. data/app/views/easy_api_doc/api/index.html.erb +5 -0
  30. data/app/views/easy_api_doc/documentation/_parameter.html.erb +29 -0
  31. data/app/views/easy_api_doc/documentation/_resource_index.html.erb +16 -0
  32. data/app/views/easy_api_doc/documentation/api_action.html.erb +105 -0
  33. data/app/views/easy_api_doc/documentation/namespace.html.erb +13 -0
  34. data/app/views/easy_api_doc/documentation/resource.html.erb +18 -0
  35. data/app/views/layouts/easy_api_doc/_header.html.erb +23 -0
  36. data/app/views/layouts/easy_api_doc/application.html.erb +34 -0
  37. data/app/views/shared/_versions_index.html.erb +10 -0
  38. data/config/routes.rb +9 -0
  39. data/lib/configurable.rb +92 -0
  40. data/lib/configuration.rb +31 -0
  41. data/lib/easy_api_doc/engine.rb +5 -0
  42. data/lib/easy_api_doc/version.rb +3 -0
  43. data/lib/easy_api_doc.rb +6 -0
  44. data/test/dummy/README.rdoc +261 -0
  45. data/test/dummy/Rakefile +7 -0
  46. data/test/dummy/app/assets/javascripts/application.js +15 -0
  47. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  48. data/test/dummy/app/controllers/application_controller.rb +3 -0
  49. data/test/dummy/app/helpers/application_helper.rb +2 -0
  50. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  51. data/test/dummy/config/application.rb +59 -0
  52. data/test/dummy/config/boot.rb +10 -0
  53. data/test/dummy/config/database.yml +25 -0
  54. data/test/dummy/config/environment.rb +5 -0
  55. data/test/dummy/config/environments/development.rb +36 -0
  56. data/test/dummy/config/environments/production.rb +67 -0
  57. data/test/dummy/config/environments/test.rb +39 -0
  58. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  59. data/test/dummy/config/initializers/inflections.rb +15 -0
  60. data/test/dummy/config/initializers/mime_types.rb +5 -0
  61. data/test/dummy/config/initializers/secret_token.rb +7 -0
  62. data/test/dummy/config/initializers/session_store.rb +8 -0
  63. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  64. data/test/dummy/config/locales/en.yml +5 -0
  65. data/test/dummy/config/routes.rb +3 -0
  66. data/test/dummy/config.ru +4 -0
  67. data/test/dummy/doc/api_doc.yml +104 -0
  68. data/test/dummy/log/development.log +742 -0
  69. data/test/dummy/public/404.html +26 -0
  70. data/test/dummy/public/422.html +26 -0
  71. data/test/dummy/public/500.html +25 -0
  72. data/test/dummy/public/favicon.ico +0 -0
  73. data/test/dummy/script/rails +6 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/04965396c9cfe69081b5dd98c3212fae +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/16d88b38a506ba01a817e258ad8fb263 +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/203aa633656e7d9c927c57c46e470c83 +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/2f062b493cefffdbc012a973e9a105d5 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/2f0ed6020953bd16ba9b363edbf7cda0 +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/30465ccaba36954861158b4242883bd6 +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/36351f369d6eaf233c5e86e07555c170 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/405c9c78a785fb067d1c67657cfc62ef +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/4abfd2becb22be944eb58bcf7107c873 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/4c371d51ee36edfddc4b8428b18dd632 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/4e7b4f8fde8fe12c9c12da639bed576e +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/543e8b4a615c1577865f6ef73059d40f +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/593636db3cefe193ebf65f5b58f57c9a +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/67409083f86d1b03662b495d04418132 +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/6afb7fed89c6f68558c4186d7a740a3a +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/6b1110992dffe4c4455380229a0b8dff +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/6db6675fbfed66d3d342f71869217dac +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/75d2dc9028e3a3f3e6ca14d8f2fe7b5e +0 -0
  92. data/test/dummy/tmp/cache/assets/development/sprockets/76b036b95dde7edc081890640b4e7ed0 +0 -0
  93. data/test/dummy/tmp/cache/assets/development/sprockets/76da432edc6235bd7d73c3335233b1ed +0 -0
  94. data/test/dummy/tmp/cache/assets/development/sprockets/76faccd1d102ff2260e90ba48328b865 +0 -0
  95. data/test/dummy/tmp/cache/assets/development/sprockets/7cbc737c6b2b24706bf9170823e12d87 +0 -0
  96. data/test/dummy/tmp/cache/assets/development/sprockets/7de191b871e66d0c65b1cbaf04a60f58 +0 -0
  97. data/test/dummy/tmp/cache/assets/development/sprockets/802227e7577d1f42b5991586df8c9f02 +0 -0
  98. data/test/dummy/tmp/cache/assets/development/sprockets/848e56c99230cfa8034c10a99fc52c28 +0 -0
  99. data/test/dummy/tmp/cache/assets/development/sprockets/8619cf373138f78fdaab67c14cf6593b +0 -0
  100. data/test/dummy/tmp/cache/assets/development/sprockets/8b8f23bb1606d4e7f5738827686ff14f +0 -0
  101. data/test/dummy/tmp/cache/assets/development/sprockets/8dde0af325a3c57426da61982576c899 +0 -0
  102. data/test/dummy/tmp/cache/assets/development/sprockets/92396eadb57dc8abfb0bf5b3a01295a8 +0 -0
  103. data/test/dummy/tmp/cache/assets/development/sprockets/92a86617e44e9093fb483fc122b75752 +0 -0
  104. data/test/dummy/tmp/cache/assets/development/sprockets/940b911c55d2dc0ea6ca56b25f087739 +0 -0
  105. data/test/dummy/tmp/cache/assets/development/sprockets/a39a3034ca0b3e6ae8eaca11c3ca5ad6 +0 -0
  106. data/test/dummy/tmp/cache/assets/development/sprockets/a8036af98430c82633505d9ca5fcde5f +0 -0
  107. data/test/dummy/tmp/cache/assets/development/sprockets/b4869b1ad3dab2a1821989791a57171f +0 -0
  108. data/test/dummy/tmp/cache/assets/development/sprockets/b7ad7703003d24dab911bd3730756ca6 +0 -0
  109. data/test/dummy/tmp/cache/assets/development/sprockets/b89605b311bfb96d01c875e7a9710861 +0 -0
  110. data/test/dummy/tmp/cache/assets/development/sprockets/c237c4326b837e51c2650d4f6ed7b7a5 +0 -0
  111. data/test/dummy/tmp/cache/assets/development/sprockets/c780d1da090d4bb4d9fa09753f04e17f +0 -0
  112. data/test/dummy/tmp/cache/assets/development/sprockets/ca91101b167a195ab54cdbc39efec3e9 +0 -0
  113. data/test/dummy/tmp/cache/assets/development/sprockets/cdb61eee371606ef082a5ee3189889d2 +0 -0
  114. data/test/dummy/tmp/cache/assets/development/sprockets/d86f52fe55c0b5686bacec92537b0c03 +0 -0
  115. data/test/dummy/tmp/cache/assets/development/sprockets/e9636c04426623ad28848cb917d96a95 +0 -0
  116. data/test/dummy/tmp/cache/assets/development/sprockets/ee9a7b09a7ab141b6ae0cf8ce9197a3c +0 -0
  117. data/test/dummy/tmp/cache/assets/development/sprockets/f0fcdc72564e7709bcdeb9e88dd86135 +0 -0
  118. data/test/dummy/tmp/cache/assets/development/sprockets/f5bcd46e1a1371d63dec98bc97bcda4c +0 -0
  119. data/test/dummy/tmp/cache/assets/development/sprockets/fb3e3925ae8dcb2704d2602719387463 +0 -0
  120. data/test/dummy/tmp/cache/assets/development/sprockets/fcbbb63c7069e7c3b471d13ff0441d2a +0 -0
  121. data/test/dummy/tmp/cache/assets/development/sprockets/ff8858e82d7df03c855d847837676e31 +0 -0
  122. data/test/test_helper.rb +10 -0
  123. metadata +291 -0
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ config.eager_load = false
11
+
12
+ # Configure static asset server for tests with Cache-Control for performance
13
+ config.serve_static_assets = true
14
+ config.static_cache_control = "public, max-age=3600"
15
+
16
+ # Log error messages when you accidentally call methods on nil
17
+ config.whiny_nils = true
18
+
19
+ # Show full error reports and disable caching
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ # config.action_mailer.delivery_method = :test
33
+
34
+ # Raise exception on mass assignment protection for Active Record models
35
+ config.active_record.mass_assignment_sanitizer = :strict
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '18a1f49101bca5a4a99fad28daba98c284bac08d686d20b87c0ac6503d832b9d32475ef16135fee5a8dc23abd9d1ffdcae7ba1855e56ab083749b1e36b67cbb0'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount EasyApiDoc::Engine => "/api_doc"
3
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,104 @@
1
+ api:
2
+ v2:
3
+ private:
4
+ description: API For Mule
5
+ detail: Loyalty Mule Service API
6
+ formats: 'json'
7
+ defaults:
8
+ uri: /v1
9
+ resources:
10
+
11
+ #===============================================================
12
+ # transactions
13
+ #===============================================================
14
+
15
+ transactions:
16
+ authentication:
17
+ type: oauth_bearer
18
+ access_token:
19
+ description: Transaction resource
20
+ actions:
21
+ create:
22
+ http_method: POST
23
+ uri: /v1/private/transactions
24
+ description: Create a new transaction. Transaction data is provided as a JSON structure in the request body. See Col's Google doc for data structure.
25
+ v1:
26
+ defaults:
27
+ domain: localhost:3000
28
+ protocol: http
29
+ private:
30
+ description: Our private (internal) API
31
+ detail: blah blah blah - longer description
32
+ formats: 'json, xml'
33
+ defaults:
34
+ uri: /api/v1/private
35
+ authentication:
36
+ type: basic
37
+ user: admin
38
+ password: password
39
+ resources:
40
+ members:
41
+ description: 'List all the Harry members, and perform updates'
42
+ actions:
43
+ index:
44
+ http_method: GET
45
+ uri: /api/v1/private/members
46
+ description: List all the members
47
+ parameters:
48
+ page:
49
+ type: integer
50
+ default: 1
51
+ per_page:
52
+ type: integer
53
+ default: 20
54
+ show:
55
+ http_method: GET
56
+ uri: /api/v1/private/members/:id
57
+ description: Show the details for a single member
58
+ parameters:
59
+ id:
60
+ type: integer
61
+ example: 1
62
+ post_update:
63
+ http_method: POST
64
+ uri: /api/v1/private/members/:id
65
+ description: Update the member's attributes
66
+ post_data:
67
+ example: '{"key": "value"}'
68
+ update:
69
+ http_method: PUT
70
+ uri: /api/v1/private/members/:id
71
+ description: Update the member's attributes
72
+ parameters:
73
+ id:
74
+ type: integer
75
+ example: 1
76
+ member:
77
+ email:
78
+ type: string
79
+ email_confirmation:
80
+ type: string
81
+ title:
82
+ type: string
83
+ first_name:
84
+ type: string
85
+ middle_names:
86
+ type: string
87
+ last_name:
88
+ type: string
89
+ date_of_birth:
90
+ type: string
91
+ info: 'YYYY-MM-DD'
92
+ gender:
93
+ type: string
94
+ info: 'M|F'
95
+ mobile_area:
96
+ type: string
97
+ mobile:
98
+ type: string
99
+ home_phone_area:
100
+ type: string
101
+ home_phone:
102
+ type: string
103
+ work_phone:
104
+ type: string