praxis 2.0.pre.6 → 2.0.pre.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (237) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.travis.yml +1 -3
  4. data/CHANGELOG.md +25 -0
  5. data/TODO.md +1 -4
  6. data/bin/praxis +67 -12
  7. data/lib/praxis.rb +10 -3
  8. data/lib/praxis/action_definition.rb +15 -13
  9. data/lib/praxis/action_definition/headers_dsl_compiler.rb +0 -7
  10. data/lib/praxis/api_general_info.rb +1 -1
  11. data/lib/praxis/application.rb +6 -2
  12. data/lib/praxis/blueprint.rb +357 -0
  13. data/lib/praxis/bootloader.rb +9 -3
  14. data/lib/praxis/bootloader_stages/environment.rb +16 -13
  15. data/lib/praxis/collection.rb +1 -11
  16. data/lib/praxis/config_hash.rb +44 -0
  17. data/lib/praxis/docs/{openapi → open_api}/info_object.rb +18 -10
  18. data/lib/praxis/docs/{openapi → open_api}/media_type_object.rb +0 -0
  19. data/lib/praxis/docs/{openapi → open_api}/operation_object.rb +0 -0
  20. data/lib/praxis/docs/{openapi → open_api}/parameter_object.rb +2 -2
  21. data/lib/praxis/docs/{openapi → open_api}/paths_object.rb +12 -15
  22. data/lib/praxis/docs/{openapi → open_api}/request_body_object.rb +0 -0
  23. data/lib/praxis/docs/{openapi → open_api}/response_object.rb +0 -0
  24. data/lib/praxis/docs/{openapi → open_api}/responses_object.rb +0 -0
  25. data/lib/praxis/docs/{openapi → open_api}/schema_object.rb +0 -0
  26. data/lib/praxis/docs/{openapi → open_api}/server_object.rb +0 -0
  27. data/lib/praxis/docs/{openapi → open_api}/tag_object.rb +0 -0
  28. data/lib/praxis/docs/open_api_generator.rb +91 -6
  29. data/lib/praxis/endpoint_definition.rb +273 -0
  30. data/lib/praxis/extensions/attribute_filtering/active_record_filter_query_builder.rb +57 -8
  31. data/lib/praxis/extensions/attribute_filtering/filtering_params.rb +3 -16
  32. data/lib/praxis/extensions/attribute_filtering/sequel_filter_query_builder.rb +20 -8
  33. data/lib/praxis/extensions/field_expansion.rb +3 -36
  34. data/lib/praxis/extensions/pagination.rb +5 -32
  35. data/lib/praxis/extensions/pagination/ordering_params.rb +5 -1
  36. data/lib/praxis/extensions/pagination/pagination_params.rb +10 -4
  37. data/lib/praxis/field_expander.rb +90 -0
  38. data/lib/praxis/finalizable.rb +34 -0
  39. data/lib/praxis/mapper/active_model_compat.rb +4 -0
  40. data/lib/praxis/mapper/resource.rb +18 -2
  41. data/lib/praxis/mapper/selector_generator.rb +2 -1
  42. data/lib/praxis/mapper/sequel_compat.rb +7 -0
  43. data/lib/praxis/media_type.rb +3 -68
  44. data/lib/praxis/plugin_concern.rb +1 -1
  45. data/lib/praxis/plugins/mapper_plugin.rb +24 -15
  46. data/lib/praxis/plugins/pagination_plugin.rb +34 -4
  47. data/lib/praxis/renderer.rb +88 -0
  48. data/lib/praxis/request.rb +1 -1
  49. data/lib/praxis/resource_definition.rb +2 -311
  50. data/lib/praxis/response_definition.rb +2 -10
  51. data/lib/praxis/response_template.rb +3 -3
  52. data/lib/praxis/router.rb +2 -2
  53. data/lib/praxis/routing_config.rb +1 -1
  54. data/lib/praxis/tasks/api_docs.rb +17 -64
  55. data/lib/praxis/tasks/routes.rb +2 -2
  56. data/lib/praxis/types/media_type_common.rb +1 -11
  57. data/lib/praxis/version.rb +1 -1
  58. data/praxis.gemspec +0 -1
  59. data/spec/functional_spec.rb +5 -9
  60. data/spec/praxis/action_definition_spec.rb +12 -20
  61. data/spec/praxis/blueprint_spec.rb +373 -0
  62. data/spec/praxis/bootloader_spec.rb +10 -2
  63. data/spec/praxis/collection_spec.rb +0 -13
  64. data/spec/praxis/config_hash_spec.rb +64 -0
  65. data/spec/praxis/{resource_definition_spec.rb → endpoint_definition_spec.rb} +37 -64
  66. data/spec/praxis/extensions/attribute_filtering/active_record_filter_query_builder_spec.rb +19 -8
  67. data/spec/praxis/extensions/attribute_filtering/filtering_params_spec.rb +106 -0
  68. data/spec/praxis/extensions/field_expansion_spec.rb +5 -24
  69. data/spec/praxis/extensions/field_selection/active_record_query_selector_spec.rb +1 -1
  70. data/spec/praxis/extensions/field_selection/sequel_query_selector_spec.rb +1 -1
  71. data/spec/praxis/extensions/support/spec_resources_active_model.rb +1 -1
  72. data/spec/praxis/field_expander_spec.rb +149 -0
  73. data/spec/praxis/mapper/selector_generator_spec.rb +1 -1
  74. data/spec/praxis/media_type_identifier_spec.rb +5 -4
  75. data/spec/praxis/media_type_spec.rb +4 -93
  76. data/spec/praxis/renderer_spec.rb +188 -0
  77. data/spec/praxis/response_definition_spec.rb +0 -31
  78. data/spec/praxis/response_spec.rb +1 -1
  79. data/spec/praxis/router_spec.rb +8 -8
  80. data/spec/praxis/routing_config_spec.rb +3 -3
  81. data/spec/spec_app/app/controllers/instances.rb +13 -7
  82. data/spec/spec_app/design/media_types/instance.rb +1 -19
  83. data/spec/spec_app/design/media_types/volume.rb +1 -1
  84. data/spec/spec_app/design/media_types/volume_snapshot.rb +2 -14
  85. data/spec/spec_app/design/resources/instances.rb +5 -8
  86. data/spec/spec_app/design/resources/volume_snapshots.rb +1 -1
  87. data/spec/spec_app/design/resources/volumes.rb +1 -1
  88. data/spec/support/spec_authorization_plugin.rb +1 -1
  89. data/spec/support/spec_blueprints.rb +72 -0
  90. data/spec/support/{spec_resource_definitions.rb → spec_endpoint_definitions.rb} +2 -2
  91. data/spec/support/spec_media_types.rb +6 -26
  92. data/tasks/thor/app.rb +8 -34
  93. data/tasks/thor/example.rb +51 -285
  94. data/tasks/thor/model.rb +40 -0
  95. data/tasks/thor/scaffold.rb +117 -0
  96. data/tasks/thor/templates/generator/empty_app/.gitignore +0 -1
  97. data/tasks/thor/templates/generator/empty_app/Gemfile +7 -23
  98. data/tasks/thor/templates/generator/empty_app/README.md +1 -1
  99. data/tasks/thor/templates/generator/empty_app/Rakefile +4 -13
  100. data/tasks/thor/templates/generator/empty_app/{design/response_templates → app/v1/resources}/.empty_directory +0 -0
  101. data/tasks/thor/templates/generator/empty_app/{design/response_templates → app/v1/resources}/.gitkeep +0 -0
  102. data/tasks/thor/templates/generator/empty_app/config/environment.rb +26 -17
  103. data/tasks/thor/templates/generator/empty_app/{design/v1/resources → config/initializers}/.empty_directory +0 -0
  104. data/tasks/thor/templates/generator/empty_app/{design/v1/resources → config/initializers}/.gitkeep +0 -0
  105. data/tasks/thor/templates/generator/empty_app/design/v1/endpoints/.empty_directory +0 -0
  106. data/tasks/thor/templates/generator/empty_app/design/v1/endpoints/.gitkeep +0 -0
  107. data/tasks/thor/templates/generator/empty_app/docs/.empty_directory +0 -0
  108. data/tasks/thor/templates/generator/empty_app/docs/.gitkeep +0 -0
  109. data/tasks/thor/templates/generator/empty_app/spec/spec_helper.rb +14 -9
  110. data/tasks/thor/templates/generator/example_app/.gitignore +1 -0
  111. data/tasks/thor/templates/generator/example_app/Gemfile +19 -0
  112. data/tasks/thor/templates/generator/example_app/Rakefile +61 -0
  113. data/tasks/thor/templates/generator/example_app/app/models/user.rb +6 -0
  114. data/tasks/thor/templates/generator/example_app/app/v1/concerns/controller_base.rb +24 -0
  115. data/tasks/thor/templates/generator/example_app/app/v1/controllers/users.rb +17 -0
  116. data/tasks/thor/templates/generator/example_app/app/v1/resources/base.rb +11 -0
  117. data/tasks/thor/templates/generator/example_app/app/v1/resources/user.rb +25 -0
  118. data/tasks/thor/templates/generator/example_app/config.ru +30 -0
  119. data/tasks/thor/templates/generator/example_app/config/environment.rb +41 -0
  120. data/tasks/thor/templates/generator/example_app/db/migrate/20201010101010_create_users_table.rb +12 -0
  121. data/tasks/thor/templates/generator/example_app/db/seeds.rb +6 -0
  122. data/tasks/thor/templates/generator/example_app/design/api.rb +18 -0
  123. data/tasks/thor/templates/generator/example_app/design/v1/endpoints/users.rb +37 -0
  124. data/tasks/thor/templates/generator/example_app/design/v1/media_types/user.rb +21 -0
  125. data/tasks/thor/templates/generator/example_app/spec/helpers/database_helper.rb +20 -0
  126. data/tasks/thor/templates/generator/example_app/spec/spec_helper.rb +42 -0
  127. data/tasks/thor/templates/generator/example_app/spec/v1/controllers/users_spec.rb +37 -0
  128. data/tasks/thor/templates/generator/scaffold/design/endpoints/collection.rb +98 -0
  129. data/tasks/thor/templates/generator/scaffold/design/media_types/item.rb +18 -0
  130. data/tasks/thor/templates/generator/scaffold/implementation/controllers/collection.rb +77 -0
  131. data/tasks/thor/templates/generator/scaffold/implementation/resources/base.rb +11 -0
  132. data/tasks/thor/templates/generator/scaffold/implementation/resources/item.rb +45 -0
  133. data/tasks/thor/templates/generator/scaffold/models/active_record.rb +6 -0
  134. data/tasks/thor/templates/generator/scaffold/models/sequel.rb +6 -0
  135. metadata +62 -136
  136. data/lib/api_browser/.bowerrc +0 -3
  137. data/lib/api_browser/.editorconfig +0 -21
  138. data/lib/api_browser/Gruntfile.js +0 -581
  139. data/lib/api_browser/app/index.html +0 -59
  140. data/lib/api_browser/app/js/app.js +0 -48
  141. data/lib/api_browser/app/js/controllers/action.js +0 -47
  142. data/lib/api_browser/app/js/controllers/controller.js +0 -10
  143. data/lib/api_browser/app/js/controllers/menu.js +0 -93
  144. data/lib/api_browser/app/js/controllers/trait.js +0 -10
  145. data/lib/api_browser/app/js/controllers/type.js +0 -24
  146. data/lib/api_browser/app/js/directives/attribute_description.js +0 -56
  147. data/lib/api_browser/app/js/directives/attribute_table.js +0 -28
  148. data/lib/api_browser/app/js/directives/conditional_requirements.js +0 -13
  149. data/lib/api_browser/app/js/directives/fixed_if_fits.js +0 -38
  150. data/lib/api_browser/app/js/directives/highlight.js +0 -14
  151. data/lib/api_browser/app/js/directives/menu_item.js +0 -59
  152. data/lib/api_browser/app/js/directives/no_container.js +0 -8
  153. data/lib/api_browser/app/js/directives/readable_list.js +0 -87
  154. data/lib/api_browser/app/js/directives/request_examples.js +0 -31
  155. data/lib/api_browser/app/js/directives/type_placeholder.js +0 -30
  156. data/lib/api_browser/app/js/directives/url.js +0 -15
  157. data/lib/api_browser/app/js/factories/Configuration.js +0 -12
  158. data/lib/api_browser/app/js/factories/Documentation.js +0 -61
  159. data/lib/api_browser/app/js/factories/Example.js +0 -51
  160. data/lib/api_browser/app/js/factories/PageInfo.js +0 -9
  161. data/lib/api_browser/app/js/factories/normalize_attributes.js +0 -20
  162. data/lib/api_browser/app/js/factories/prepare_template.js +0 -15
  163. data/lib/api_browser/app/js/factories/template_for.js +0 -128
  164. data/lib/api_browser/app/js/filters/attribute_name.js +0 -10
  165. data/lib/api_browser/app/js/filters/friendly_json.js +0 -5
  166. data/lib/api_browser/app/js/filters/has_requirement.js +0 -14
  167. data/lib/api_browser/app/js/filters/header_info.js +0 -9
  168. data/lib/api_browser/app/js/filters/is_empty.js +0 -8
  169. data/lib/api_browser/app/js/filters/markdown.js +0 -6
  170. data/lib/api_browser/app/js/filters/resource_name.js +0 -5
  171. data/lib/api_browser/app/js/filters/tag_requirement.js +0 -13
  172. data/lib/api_browser/app/sass/modules/_body.scss +0 -40
  173. data/lib/api_browser/app/sass/modules/_cloke.scss +0 -8
  174. data/lib/api_browser/app/sass/modules/_header.scss +0 -10
  175. data/lib/api_browser/app/sass/modules/_nav.scss +0 -7
  176. data/lib/api_browser/app/sass/modules/_sidebar.scss +0 -134
  177. data/lib/api_browser/app/sass/modules/_switch.scss +0 -55
  178. data/lib/api_browser/app/sass/modules/_table.scss +0 -13
  179. data/lib/api_browser/app/sass/praxis.scss +0 -70
  180. data/lib/api_browser/app/sass/variables/_bootstrap-variables.scss +0 -774
  181. data/lib/api_browser/app/views/action.html +0 -97
  182. data/lib/api_browser/app/views/builtin/field-selector.html +0 -24
  183. data/lib/api_browser/app/views/controller.html +0 -55
  184. data/lib/api_browser/app/views/directives/attribute_description.html +0 -2
  185. data/lib/api_browser/app/views/directives/attribute_description/default.html +0 -2
  186. data/lib/api_browser/app/views/directives/attribute_description/example.html +0 -13
  187. data/lib/api_browser/app/views/directives/attribute_description/headers.html +0 -8
  188. data/lib/api_browser/app/views/directives/attribute_description/member_options.html +0 -4
  189. data/lib/api_browser/app/views/directives/attribute_description/values.html +0 -14
  190. data/lib/api_browser/app/views/directives/attribute_table.html +0 -17
  191. data/lib/api_browser/app/views/directives/menu_item.html +0 -8
  192. data/lib/api_browser/app/views/directives/url.html +0 -3
  193. data/lib/api_browser/app/views/examples/general.html +0 -26
  194. data/lib/api_browser/app/views/home.html +0 -5
  195. data/lib/api_browser/app/views/layout.html +0 -8
  196. data/lib/api_browser/app/views/menu.html +0 -42
  197. data/lib/api_browser/app/views/navbar.html +0 -9
  198. data/lib/api_browser/app/views/trait.html +0 -13
  199. data/lib/api_browser/app/views/type.html +0 -6
  200. data/lib/api_browser/app/views/type/details.html +0 -33
  201. data/lib/api_browser/app/views/types/embedded/array.html +0 -2
  202. data/lib/api_browser/app/views/types/embedded/default.html +0 -12
  203. data/lib/api_browser/app/views/types/embedded/field-selector.html +0 -13
  204. data/lib/api_browser/app/views/types/embedded/links.html +0 -11
  205. data/lib/api_browser/app/views/types/embedded/requirements.html +0 -6
  206. data/lib/api_browser/app/views/types/embedded/single_req.html +0 -9
  207. data/lib/api_browser/app/views/types/embedded/struct.html +0 -14
  208. data/lib/api_browser/app/views/types/label/link.html +0 -1
  209. data/lib/api_browser/app/views/types/label/primitive.html +0 -1
  210. data/lib/api_browser/app/views/types/label/primitive_collection.html +0 -1
  211. data/lib/api_browser/app/views/types/label/type.html +0 -1
  212. data/lib/api_browser/app/views/types/label/type_collection.html +0 -1
  213. data/lib/api_browser/app/views/types/main/array.html +0 -22
  214. data/lib/api_browser/app/views/types/main/default.html +0 -23
  215. data/lib/api_browser/app/views/types/main/hash.html +0 -23
  216. data/lib/api_browser/app/views/types/standalone/array.html +0 -3
  217. data/lib/api_browser/app/views/types/standalone/default.html +0 -18
  218. data/lib/api_browser/app/views/types/standalone/struct.html +0 -2
  219. data/lib/api_browser/bower_template.json +0 -41
  220. data/lib/api_browser/package-lock.json +0 -7110
  221. data/lib/api_browser/package.json +0 -43
  222. data/lib/praxis/docs/generator.rb +0 -243
  223. data/lib/praxis/docs/link_builder.rb +0 -30
  224. data/lib/praxis/links.rb +0 -135
  225. data/lib/praxis/types/multipart.rb +0 -109
  226. data/spec/api_browser/directives/type_placeholder_spec.js +0 -134
  227. data/spec/api_browser/factories/configuration_spec.js +0 -32
  228. data/spec/api_browser/factories/documentation_spec.js +0 -100
  229. data/spec/api_browser/factories/normalize_attributes_spec.js +0 -92
  230. data/spec/api_browser/factories/template_for_spec.js +0 -67
  231. data/spec/api_browser/filters/attribute_name_spec.js +0 -23
  232. data/spec/praxis/types/multipart_spec.rb +0 -112
  233. data/tasks/thor/templates/generator/empty_app/.rspec +0 -1
  234. data/tasks/thor/templates/generator/empty_app/Guardfile +0 -3
  235. data/tasks/thor/templates/generator/empty_app/config/rainbows.rb +0 -57
  236. data/tasks/thor/templates/generator/empty_app/docs/app.js +0 -1
  237. data/tasks/thor/templates/generator/empty_app/docs/styles.scss +0 -3

There are too many changes on this page to be displayed.


The amount of changes on this page would crash your brower.

You can still verify the content by downloading the gem file manually.