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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +1 -3
- data/CHANGELOG.md +25 -0
- data/TODO.md +1 -4
- data/bin/praxis +67 -12
- data/lib/praxis.rb +10 -3
- data/lib/praxis/action_definition.rb +15 -13
- data/lib/praxis/action_definition/headers_dsl_compiler.rb +0 -7
- data/lib/praxis/api_general_info.rb +1 -1
- data/lib/praxis/application.rb +6 -2
- data/lib/praxis/blueprint.rb +357 -0
- data/lib/praxis/bootloader.rb +9 -3
- data/lib/praxis/bootloader_stages/environment.rb +16 -13
- data/lib/praxis/collection.rb +1 -11
- data/lib/praxis/config_hash.rb +44 -0
- data/lib/praxis/docs/{openapi → open_api}/info_object.rb +18 -10
- data/lib/praxis/docs/{openapi → open_api}/media_type_object.rb +0 -0
- data/lib/praxis/docs/{openapi → open_api}/operation_object.rb +0 -0
- data/lib/praxis/docs/{openapi → open_api}/parameter_object.rb +2 -2
- data/lib/praxis/docs/{openapi → open_api}/paths_object.rb +12 -15
- data/lib/praxis/docs/{openapi → open_api}/request_body_object.rb +0 -0
- data/lib/praxis/docs/{openapi → open_api}/response_object.rb +0 -0
- data/lib/praxis/docs/{openapi → open_api}/responses_object.rb +0 -0
- data/lib/praxis/docs/{openapi → open_api}/schema_object.rb +0 -0
- data/lib/praxis/docs/{openapi → open_api}/server_object.rb +0 -0
- data/lib/praxis/docs/{openapi → open_api}/tag_object.rb +0 -0
- data/lib/praxis/docs/open_api_generator.rb +91 -6
- data/lib/praxis/endpoint_definition.rb +273 -0
- data/lib/praxis/extensions/attribute_filtering/active_record_filter_query_builder.rb +57 -8
- data/lib/praxis/extensions/attribute_filtering/filtering_params.rb +3 -16
- data/lib/praxis/extensions/attribute_filtering/sequel_filter_query_builder.rb +20 -8
- data/lib/praxis/extensions/field_expansion.rb +3 -36
- data/lib/praxis/extensions/pagination.rb +5 -32
- data/lib/praxis/extensions/pagination/ordering_params.rb +5 -1
- data/lib/praxis/extensions/pagination/pagination_params.rb +10 -4
- data/lib/praxis/field_expander.rb +90 -0
- data/lib/praxis/finalizable.rb +34 -0
- data/lib/praxis/mapper/active_model_compat.rb +4 -0
- data/lib/praxis/mapper/resource.rb +18 -2
- data/lib/praxis/mapper/selector_generator.rb +2 -1
- data/lib/praxis/mapper/sequel_compat.rb +7 -0
- data/lib/praxis/media_type.rb +3 -68
- data/lib/praxis/plugin_concern.rb +1 -1
- data/lib/praxis/plugins/mapper_plugin.rb +24 -15
- data/lib/praxis/plugins/pagination_plugin.rb +34 -4
- data/lib/praxis/renderer.rb +88 -0
- data/lib/praxis/request.rb +1 -1
- data/lib/praxis/resource_definition.rb +2 -311
- data/lib/praxis/response_definition.rb +2 -10
- data/lib/praxis/response_template.rb +3 -3
- data/lib/praxis/router.rb +2 -2
- data/lib/praxis/routing_config.rb +1 -1
- data/lib/praxis/tasks/api_docs.rb +17 -64
- data/lib/praxis/tasks/routes.rb +2 -2
- data/lib/praxis/types/media_type_common.rb +1 -11
- data/lib/praxis/version.rb +1 -1
- data/praxis.gemspec +0 -1
- data/spec/functional_spec.rb +5 -9
- data/spec/praxis/action_definition_spec.rb +12 -20
- data/spec/praxis/blueprint_spec.rb +373 -0
- data/spec/praxis/bootloader_spec.rb +10 -2
- data/spec/praxis/collection_spec.rb +0 -13
- data/spec/praxis/config_hash_spec.rb +64 -0
- data/spec/praxis/{resource_definition_spec.rb → endpoint_definition_spec.rb} +37 -64
- data/spec/praxis/extensions/attribute_filtering/active_record_filter_query_builder_spec.rb +19 -8
- data/spec/praxis/extensions/attribute_filtering/filtering_params_spec.rb +106 -0
- data/spec/praxis/extensions/field_expansion_spec.rb +5 -24
- data/spec/praxis/extensions/field_selection/active_record_query_selector_spec.rb +1 -1
- data/spec/praxis/extensions/field_selection/sequel_query_selector_spec.rb +1 -1
- data/spec/praxis/extensions/support/spec_resources_active_model.rb +1 -1
- data/spec/praxis/field_expander_spec.rb +149 -0
- data/spec/praxis/mapper/selector_generator_spec.rb +1 -1
- data/spec/praxis/media_type_identifier_spec.rb +5 -4
- data/spec/praxis/media_type_spec.rb +4 -93
- data/spec/praxis/renderer_spec.rb +188 -0
- data/spec/praxis/response_definition_spec.rb +0 -31
- data/spec/praxis/response_spec.rb +1 -1
- data/spec/praxis/router_spec.rb +8 -8
- data/spec/praxis/routing_config_spec.rb +3 -3
- data/spec/spec_app/app/controllers/instances.rb +13 -7
- data/spec/spec_app/design/media_types/instance.rb +1 -19
- data/spec/spec_app/design/media_types/volume.rb +1 -1
- data/spec/spec_app/design/media_types/volume_snapshot.rb +2 -14
- data/spec/spec_app/design/resources/instances.rb +5 -8
- data/spec/spec_app/design/resources/volume_snapshots.rb +1 -1
- data/spec/spec_app/design/resources/volumes.rb +1 -1
- data/spec/support/spec_authorization_plugin.rb +1 -1
- data/spec/support/spec_blueprints.rb +72 -0
- data/spec/support/{spec_resource_definitions.rb → spec_endpoint_definitions.rb} +2 -2
- data/spec/support/spec_media_types.rb +6 -26
- data/tasks/thor/app.rb +8 -34
- data/tasks/thor/example.rb +51 -285
- data/tasks/thor/model.rb +40 -0
- data/tasks/thor/scaffold.rb +117 -0
- data/tasks/thor/templates/generator/empty_app/.gitignore +0 -1
- data/tasks/thor/templates/generator/empty_app/Gemfile +7 -23
- data/tasks/thor/templates/generator/empty_app/README.md +1 -1
- data/tasks/thor/templates/generator/empty_app/Rakefile +4 -13
- data/tasks/thor/templates/generator/empty_app/{design/response_templates → app/v1/resources}/.empty_directory +0 -0
- data/tasks/thor/templates/generator/empty_app/{design/response_templates → app/v1/resources}/.gitkeep +0 -0
- data/tasks/thor/templates/generator/empty_app/config/environment.rb +26 -17
- data/tasks/thor/templates/generator/empty_app/{design/v1/resources → config/initializers}/.empty_directory +0 -0
- data/tasks/thor/templates/generator/empty_app/{design/v1/resources → config/initializers}/.gitkeep +0 -0
- data/tasks/thor/templates/generator/empty_app/design/v1/endpoints/.empty_directory +0 -0
- data/tasks/thor/templates/generator/empty_app/design/v1/endpoints/.gitkeep +0 -0
- data/tasks/thor/templates/generator/empty_app/docs/.empty_directory +0 -0
- data/tasks/thor/templates/generator/empty_app/docs/.gitkeep +0 -0
- data/tasks/thor/templates/generator/empty_app/spec/spec_helper.rb +14 -9
- data/tasks/thor/templates/generator/example_app/.gitignore +1 -0
- data/tasks/thor/templates/generator/example_app/Gemfile +19 -0
- data/tasks/thor/templates/generator/example_app/Rakefile +61 -0
- data/tasks/thor/templates/generator/example_app/app/models/user.rb +6 -0
- data/tasks/thor/templates/generator/example_app/app/v1/concerns/controller_base.rb +24 -0
- data/tasks/thor/templates/generator/example_app/app/v1/controllers/users.rb +17 -0
- data/tasks/thor/templates/generator/example_app/app/v1/resources/base.rb +11 -0
- data/tasks/thor/templates/generator/example_app/app/v1/resources/user.rb +25 -0
- data/tasks/thor/templates/generator/example_app/config.ru +30 -0
- data/tasks/thor/templates/generator/example_app/config/environment.rb +41 -0
- data/tasks/thor/templates/generator/example_app/db/migrate/20201010101010_create_users_table.rb +12 -0
- data/tasks/thor/templates/generator/example_app/db/seeds.rb +6 -0
- data/tasks/thor/templates/generator/example_app/design/api.rb +18 -0
- data/tasks/thor/templates/generator/example_app/design/v1/endpoints/users.rb +37 -0
- data/tasks/thor/templates/generator/example_app/design/v1/media_types/user.rb +21 -0
- data/tasks/thor/templates/generator/example_app/spec/helpers/database_helper.rb +20 -0
- data/tasks/thor/templates/generator/example_app/spec/spec_helper.rb +42 -0
- data/tasks/thor/templates/generator/example_app/spec/v1/controllers/users_spec.rb +37 -0
- data/tasks/thor/templates/generator/scaffold/design/endpoints/collection.rb +98 -0
- data/tasks/thor/templates/generator/scaffold/design/media_types/item.rb +18 -0
- data/tasks/thor/templates/generator/scaffold/implementation/controllers/collection.rb +77 -0
- data/tasks/thor/templates/generator/scaffold/implementation/resources/base.rb +11 -0
- data/tasks/thor/templates/generator/scaffold/implementation/resources/item.rb +45 -0
- data/tasks/thor/templates/generator/scaffold/models/active_record.rb +6 -0
- data/tasks/thor/templates/generator/scaffold/models/sequel.rb +6 -0
- metadata +62 -136
- data/lib/api_browser/.bowerrc +0 -3
- data/lib/api_browser/.editorconfig +0 -21
- data/lib/api_browser/Gruntfile.js +0 -581
- data/lib/api_browser/app/index.html +0 -59
- data/lib/api_browser/app/js/app.js +0 -48
- data/lib/api_browser/app/js/controllers/action.js +0 -47
- data/lib/api_browser/app/js/controllers/controller.js +0 -10
- data/lib/api_browser/app/js/controllers/menu.js +0 -93
- data/lib/api_browser/app/js/controllers/trait.js +0 -10
- data/lib/api_browser/app/js/controllers/type.js +0 -24
- data/lib/api_browser/app/js/directives/attribute_description.js +0 -56
- data/lib/api_browser/app/js/directives/attribute_table.js +0 -28
- data/lib/api_browser/app/js/directives/conditional_requirements.js +0 -13
- data/lib/api_browser/app/js/directives/fixed_if_fits.js +0 -38
- data/lib/api_browser/app/js/directives/highlight.js +0 -14
- data/lib/api_browser/app/js/directives/menu_item.js +0 -59
- data/lib/api_browser/app/js/directives/no_container.js +0 -8
- data/lib/api_browser/app/js/directives/readable_list.js +0 -87
- data/lib/api_browser/app/js/directives/request_examples.js +0 -31
- data/lib/api_browser/app/js/directives/type_placeholder.js +0 -30
- data/lib/api_browser/app/js/directives/url.js +0 -15
- data/lib/api_browser/app/js/factories/Configuration.js +0 -12
- data/lib/api_browser/app/js/factories/Documentation.js +0 -61
- data/lib/api_browser/app/js/factories/Example.js +0 -51
- data/lib/api_browser/app/js/factories/PageInfo.js +0 -9
- data/lib/api_browser/app/js/factories/normalize_attributes.js +0 -20
- data/lib/api_browser/app/js/factories/prepare_template.js +0 -15
- data/lib/api_browser/app/js/factories/template_for.js +0 -128
- data/lib/api_browser/app/js/filters/attribute_name.js +0 -10
- data/lib/api_browser/app/js/filters/friendly_json.js +0 -5
- data/lib/api_browser/app/js/filters/has_requirement.js +0 -14
- data/lib/api_browser/app/js/filters/header_info.js +0 -9
- data/lib/api_browser/app/js/filters/is_empty.js +0 -8
- data/lib/api_browser/app/js/filters/markdown.js +0 -6
- data/lib/api_browser/app/js/filters/resource_name.js +0 -5
- data/lib/api_browser/app/js/filters/tag_requirement.js +0 -13
- data/lib/api_browser/app/sass/modules/_body.scss +0 -40
- data/lib/api_browser/app/sass/modules/_cloke.scss +0 -8
- data/lib/api_browser/app/sass/modules/_header.scss +0 -10
- data/lib/api_browser/app/sass/modules/_nav.scss +0 -7
- data/lib/api_browser/app/sass/modules/_sidebar.scss +0 -134
- data/lib/api_browser/app/sass/modules/_switch.scss +0 -55
- data/lib/api_browser/app/sass/modules/_table.scss +0 -13
- data/lib/api_browser/app/sass/praxis.scss +0 -70
- data/lib/api_browser/app/sass/variables/_bootstrap-variables.scss +0 -774
- data/lib/api_browser/app/views/action.html +0 -97
- data/lib/api_browser/app/views/builtin/field-selector.html +0 -24
- data/lib/api_browser/app/views/controller.html +0 -55
- data/lib/api_browser/app/views/directives/attribute_description.html +0 -2
- data/lib/api_browser/app/views/directives/attribute_description/default.html +0 -2
- data/lib/api_browser/app/views/directives/attribute_description/example.html +0 -13
- data/lib/api_browser/app/views/directives/attribute_description/headers.html +0 -8
- data/lib/api_browser/app/views/directives/attribute_description/member_options.html +0 -4
- data/lib/api_browser/app/views/directives/attribute_description/values.html +0 -14
- data/lib/api_browser/app/views/directives/attribute_table.html +0 -17
- data/lib/api_browser/app/views/directives/menu_item.html +0 -8
- data/lib/api_browser/app/views/directives/url.html +0 -3
- data/lib/api_browser/app/views/examples/general.html +0 -26
- data/lib/api_browser/app/views/home.html +0 -5
- data/lib/api_browser/app/views/layout.html +0 -8
- data/lib/api_browser/app/views/menu.html +0 -42
- data/lib/api_browser/app/views/navbar.html +0 -9
- data/lib/api_browser/app/views/trait.html +0 -13
- data/lib/api_browser/app/views/type.html +0 -6
- data/lib/api_browser/app/views/type/details.html +0 -33
- data/lib/api_browser/app/views/types/embedded/array.html +0 -2
- data/lib/api_browser/app/views/types/embedded/default.html +0 -12
- data/lib/api_browser/app/views/types/embedded/field-selector.html +0 -13
- data/lib/api_browser/app/views/types/embedded/links.html +0 -11
- data/lib/api_browser/app/views/types/embedded/requirements.html +0 -6
- data/lib/api_browser/app/views/types/embedded/single_req.html +0 -9
- data/lib/api_browser/app/views/types/embedded/struct.html +0 -14
- data/lib/api_browser/app/views/types/label/link.html +0 -1
- data/lib/api_browser/app/views/types/label/primitive.html +0 -1
- data/lib/api_browser/app/views/types/label/primitive_collection.html +0 -1
- data/lib/api_browser/app/views/types/label/type.html +0 -1
- data/lib/api_browser/app/views/types/label/type_collection.html +0 -1
- data/lib/api_browser/app/views/types/main/array.html +0 -22
- data/lib/api_browser/app/views/types/main/default.html +0 -23
- data/lib/api_browser/app/views/types/main/hash.html +0 -23
- data/lib/api_browser/app/views/types/standalone/array.html +0 -3
- data/lib/api_browser/app/views/types/standalone/default.html +0 -18
- data/lib/api_browser/app/views/types/standalone/struct.html +0 -2
- data/lib/api_browser/bower_template.json +0 -41
- data/lib/api_browser/package-lock.json +0 -7110
- data/lib/api_browser/package.json +0 -43
- data/lib/praxis/docs/generator.rb +0 -243
- data/lib/praxis/docs/link_builder.rb +0 -30
- data/lib/praxis/links.rb +0 -135
- data/lib/praxis/types/multipart.rb +0 -109
- data/spec/api_browser/directives/type_placeholder_spec.js +0 -134
- data/spec/api_browser/factories/configuration_spec.js +0 -32
- data/spec/api_browser/factories/documentation_spec.js +0 -100
- data/spec/api_browser/factories/normalize_attributes_spec.js +0 -92
- data/spec/api_browser/factories/template_for_spec.js +0 -67
- data/spec/api_browser/filters/attribute_name_spec.js +0 -23
- data/spec/praxis/types/multipart_spec.rb +0 -112
- data/tasks/thor/templates/generator/empty_app/.rspec +0 -1
- data/tasks/thor/templates/generator/empty_app/Guardfile +0 -3
- data/tasks/thor/templates/generator/empty_app/config/rainbows.rb +0 -57
- data/tasks/thor/templates/generator/empty_app/docs/app.js +0 -1
- data/tasks/thor/templates/generator/empty_app/docs/styles.scss +0 -3
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: praxis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.pre.
|
4
|
+
version: 2.0.pre.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josep M. Blanquer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
@@ -73,20 +73,6 @@ dependencies:
|
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
|
-
- !ruby/object:Gem::Dependency
|
77
|
-
name: praxis-blueprints
|
78
|
-
requirement: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.5'
|
83
|
-
type: :runtime
|
84
|
-
prerelease: false
|
85
|
-
version_requirements: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '3.5'
|
90
76
|
- !ruby/object:Gem::Dependency
|
91
77
|
name: attributor
|
92
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -406,98 +392,13 @@ files:
|
|
406
392
|
- Rakefile
|
407
393
|
- TODO.md
|
408
394
|
- bin/praxis
|
409
|
-
- lib/api_browser/.bowerrc
|
410
|
-
- lib/api_browser/.editorconfig
|
411
|
-
- lib/api_browser/Gruntfile.js
|
412
|
-
- lib/api_browser/app/index.html
|
413
|
-
- lib/api_browser/app/js/app.js
|
414
|
-
- lib/api_browser/app/js/controllers/action.js
|
415
|
-
- lib/api_browser/app/js/controllers/controller.js
|
416
|
-
- lib/api_browser/app/js/controllers/menu.js
|
417
|
-
- lib/api_browser/app/js/controllers/trait.js
|
418
|
-
- lib/api_browser/app/js/controllers/type.js
|
419
|
-
- lib/api_browser/app/js/directives/attribute_description.js
|
420
|
-
- lib/api_browser/app/js/directives/attribute_table.js
|
421
|
-
- lib/api_browser/app/js/directives/conditional_requirements.js
|
422
|
-
- lib/api_browser/app/js/directives/fixed_if_fits.js
|
423
|
-
- lib/api_browser/app/js/directives/highlight.js
|
424
|
-
- lib/api_browser/app/js/directives/menu_item.js
|
425
|
-
- lib/api_browser/app/js/directives/no_container.js
|
426
|
-
- lib/api_browser/app/js/directives/readable_list.js
|
427
|
-
- lib/api_browser/app/js/directives/request_examples.js
|
428
|
-
- lib/api_browser/app/js/directives/type_placeholder.js
|
429
|
-
- lib/api_browser/app/js/directives/url.js
|
430
|
-
- lib/api_browser/app/js/factories/Configuration.js
|
431
|
-
- lib/api_browser/app/js/factories/Documentation.js
|
432
|
-
- lib/api_browser/app/js/factories/Example.js
|
433
|
-
- lib/api_browser/app/js/factories/PageInfo.js
|
434
|
-
- lib/api_browser/app/js/factories/normalize_attributes.js
|
435
|
-
- lib/api_browser/app/js/factories/prepare_template.js
|
436
|
-
- lib/api_browser/app/js/factories/template_for.js
|
437
|
-
- lib/api_browser/app/js/filters/attribute_name.js
|
438
|
-
- lib/api_browser/app/js/filters/friendly_json.js
|
439
|
-
- lib/api_browser/app/js/filters/has_requirement.js
|
440
|
-
- lib/api_browser/app/js/filters/header_info.js
|
441
|
-
- lib/api_browser/app/js/filters/is_empty.js
|
442
|
-
- lib/api_browser/app/js/filters/markdown.js
|
443
|
-
- lib/api_browser/app/js/filters/resource_name.js
|
444
|
-
- lib/api_browser/app/js/filters/tag_requirement.js
|
445
|
-
- lib/api_browser/app/sass/modules/_body.scss
|
446
|
-
- lib/api_browser/app/sass/modules/_cloke.scss
|
447
|
-
- lib/api_browser/app/sass/modules/_header.scss
|
448
|
-
- lib/api_browser/app/sass/modules/_nav.scss
|
449
|
-
- lib/api_browser/app/sass/modules/_sidebar.scss
|
450
|
-
- lib/api_browser/app/sass/modules/_switch.scss
|
451
|
-
- lib/api_browser/app/sass/modules/_table.scss
|
452
|
-
- lib/api_browser/app/sass/praxis.scss
|
453
|
-
- lib/api_browser/app/sass/variables/_bootstrap-variables.scss
|
454
|
-
- lib/api_browser/app/views/action.html
|
455
|
-
- lib/api_browser/app/views/builtin/field-selector.html
|
456
|
-
- lib/api_browser/app/views/controller.html
|
457
|
-
- lib/api_browser/app/views/directives/attribute_description.html
|
458
|
-
- lib/api_browser/app/views/directives/attribute_description/default.html
|
459
|
-
- lib/api_browser/app/views/directives/attribute_description/example.html
|
460
|
-
- lib/api_browser/app/views/directives/attribute_description/headers.html
|
461
|
-
- lib/api_browser/app/views/directives/attribute_description/member_options.html
|
462
|
-
- lib/api_browser/app/views/directives/attribute_description/values.html
|
463
|
-
- lib/api_browser/app/views/directives/attribute_table.html
|
464
|
-
- lib/api_browser/app/views/directives/menu_item.html
|
465
|
-
- lib/api_browser/app/views/directives/url.html
|
466
|
-
- lib/api_browser/app/views/examples/general.html
|
467
|
-
- lib/api_browser/app/views/home.html
|
468
|
-
- lib/api_browser/app/views/layout.html
|
469
|
-
- lib/api_browser/app/views/menu.html
|
470
|
-
- lib/api_browser/app/views/navbar.html
|
471
|
-
- lib/api_browser/app/views/trait.html
|
472
|
-
- lib/api_browser/app/views/type.html
|
473
|
-
- lib/api_browser/app/views/type/details.html
|
474
|
-
- lib/api_browser/app/views/types/embedded/array.html
|
475
|
-
- lib/api_browser/app/views/types/embedded/default.html
|
476
|
-
- lib/api_browser/app/views/types/embedded/field-selector.html
|
477
|
-
- lib/api_browser/app/views/types/embedded/links.html
|
478
|
-
- lib/api_browser/app/views/types/embedded/requirements.html
|
479
|
-
- lib/api_browser/app/views/types/embedded/single_req.html
|
480
|
-
- lib/api_browser/app/views/types/embedded/struct.html
|
481
|
-
- lib/api_browser/app/views/types/label/link.html
|
482
|
-
- lib/api_browser/app/views/types/label/primitive.html
|
483
|
-
- lib/api_browser/app/views/types/label/primitive_collection.html
|
484
|
-
- lib/api_browser/app/views/types/label/type.html
|
485
|
-
- lib/api_browser/app/views/types/label/type_collection.html
|
486
|
-
- lib/api_browser/app/views/types/main/array.html
|
487
|
-
- lib/api_browser/app/views/types/main/default.html
|
488
|
-
- lib/api_browser/app/views/types/main/hash.html
|
489
|
-
- lib/api_browser/app/views/types/standalone/array.html
|
490
|
-
- lib/api_browser/app/views/types/standalone/default.html
|
491
|
-
- lib/api_browser/app/views/types/standalone/struct.html
|
492
|
-
- lib/api_browser/bower_template.json
|
493
|
-
- lib/api_browser/package-lock.json
|
494
|
-
- lib/api_browser/package.json
|
495
395
|
- lib/praxis.rb
|
496
396
|
- lib/praxis/action_definition.rb
|
497
397
|
- lib/praxis/action_definition/headers_dsl_compiler.rb
|
498
398
|
- lib/praxis/api_definition.rb
|
499
399
|
- lib/praxis/api_general_info.rb
|
500
400
|
- lib/praxis/application.rb
|
401
|
+
- lib/praxis/blueprint.rb
|
501
402
|
- lib/praxis/bootloader.rb
|
502
403
|
- lib/praxis/bootloader_stages/environment.rb
|
503
404
|
- lib/praxis/bootloader_stages/file_loader.rb
|
@@ -511,22 +412,22 @@ files:
|
|
511
412
|
- lib/praxis/callbacks.rb
|
512
413
|
- lib/praxis/collection.rb
|
513
414
|
- lib/praxis/config.rb
|
415
|
+
- lib/praxis/config_hash.rb
|
514
416
|
- lib/praxis/controller.rb
|
515
417
|
- lib/praxis/dispatcher.rb
|
516
|
-
- lib/praxis/docs/
|
517
|
-
- lib/praxis/docs/
|
418
|
+
- lib/praxis/docs/open_api/info_object.rb
|
419
|
+
- lib/praxis/docs/open_api/media_type_object.rb
|
420
|
+
- lib/praxis/docs/open_api/operation_object.rb
|
421
|
+
- lib/praxis/docs/open_api/parameter_object.rb
|
422
|
+
- lib/praxis/docs/open_api/paths_object.rb
|
423
|
+
- lib/praxis/docs/open_api/request_body_object.rb
|
424
|
+
- lib/praxis/docs/open_api/response_object.rb
|
425
|
+
- lib/praxis/docs/open_api/responses_object.rb
|
426
|
+
- lib/praxis/docs/open_api/schema_object.rb
|
427
|
+
- lib/praxis/docs/open_api/server_object.rb
|
428
|
+
- lib/praxis/docs/open_api/tag_object.rb
|
518
429
|
- lib/praxis/docs/open_api_generator.rb
|
519
|
-
- lib/praxis/
|
520
|
-
- lib/praxis/docs/openapi/media_type_object.rb
|
521
|
-
- lib/praxis/docs/openapi/operation_object.rb
|
522
|
-
- lib/praxis/docs/openapi/parameter_object.rb
|
523
|
-
- lib/praxis/docs/openapi/paths_object.rb
|
524
|
-
- lib/praxis/docs/openapi/request_body_object.rb
|
525
|
-
- lib/praxis/docs/openapi/response_object.rb
|
526
|
-
- lib/praxis/docs/openapi/responses_object.rb
|
527
|
-
- lib/praxis/docs/openapi/schema_object.rb
|
528
|
-
- lib/praxis/docs/openapi/server_object.rb
|
529
|
-
- lib/praxis/docs/openapi/tag_object.rb
|
430
|
+
- lib/praxis/endpoint_definition.rb
|
530
431
|
- lib/praxis/error_handler.rb
|
531
432
|
- lib/praxis/exception.rb
|
532
433
|
- lib/praxis/exceptions/config.rb
|
@@ -561,12 +462,13 @@ files:
|
|
561
462
|
- lib/praxis/extensions/rails_compat.rb
|
562
463
|
- lib/praxis/extensions/rails_compat/request_methods.rb
|
563
464
|
- lib/praxis/extensions/rendering.rb
|
465
|
+
- lib/praxis/field_expander.rb
|
564
466
|
- lib/praxis/file_group.rb
|
467
|
+
- lib/praxis/finalizable.rb
|
565
468
|
- lib/praxis/handlers/json.rb
|
566
469
|
- lib/praxis/handlers/plain.rb
|
567
470
|
- lib/praxis/handlers/www_form.rb
|
568
471
|
- lib/praxis/handlers/xml-sample.rb
|
569
|
-
- lib/praxis/links.rb
|
570
472
|
- lib/praxis/mapper/active_model_compat.rb
|
571
473
|
- lib/praxis/mapper/resource.rb
|
572
474
|
- lib/praxis/mapper/selector_generator.rb
|
@@ -582,6 +484,7 @@ files:
|
|
582
484
|
- lib/praxis/plugins/mapper_plugin.rb
|
583
485
|
- lib/praxis/plugins/pagination_plugin.rb
|
584
486
|
- lib/praxis/plugins/rails_plugin.rb
|
487
|
+
- lib/praxis/renderer.rb
|
585
488
|
- lib/praxis/request.rb
|
586
489
|
- lib/praxis/request_stages/action.rb
|
587
490
|
- lib/praxis/request_stages/load_request.rb
|
@@ -614,30 +517,26 @@ files:
|
|
614
517
|
- lib/praxis/trait.rb
|
615
518
|
- lib/praxis/types/fuzzy_hash.rb
|
616
519
|
- lib/praxis/types/media_type_common.rb
|
617
|
-
- lib/praxis/types/multipart.rb
|
618
520
|
- lib/praxis/types/multipart_array.rb
|
619
521
|
- lib/praxis/types/multipart_array/part_definition.rb
|
620
522
|
- lib/praxis/validation_handler.rb
|
621
523
|
- lib/praxis/version.rb
|
622
524
|
- praxis.gemspec
|
623
|
-
- spec/api_browser/directives/type_placeholder_spec.js
|
624
|
-
- spec/api_browser/factories/configuration_spec.js
|
625
|
-
- spec/api_browser/factories/documentation_spec.js
|
626
|
-
- spec/api_browser/factories/normalize_attributes_spec.js
|
627
|
-
- spec/api_browser/factories/template_for_spec.js
|
628
|
-
- spec/api_browser/filters/attribute_name_spec.js
|
629
525
|
- spec/functional_spec.rb
|
630
526
|
- spec/praxis/action_definition_spec.rb
|
631
527
|
- spec/praxis/api_definition_spec.rb
|
632
528
|
- spec/praxis/api_general_info_spec.rb
|
633
529
|
- spec/praxis/api_resource_spec.rb
|
634
530
|
- spec/praxis/application_spec.rb
|
531
|
+
- spec/praxis/blueprint_spec.rb
|
635
532
|
- spec/praxis/bootloader_spec.rb
|
636
533
|
- spec/praxis/callbacks_spec.rb
|
637
534
|
- spec/praxis/collection_spec.rb
|
535
|
+
- spec/praxis/config_hash_spec.rb
|
638
536
|
- spec/praxis/config_spec.rb
|
639
537
|
- spec/praxis/controller_spec.rb
|
640
538
|
- spec/praxis/dispatcher_spec.rb
|
539
|
+
- spec/praxis/endpoint_definition_spec.rb
|
641
540
|
- spec/praxis/extensions/attribute_filtering/active_record_filter_query_builder_spec.rb
|
642
541
|
- spec/praxis/extensions/attribute_filtering/filter_tree_node_spec.rb
|
643
542
|
- spec/praxis/extensions/attribute_filtering/filtering_params_spec.rb
|
@@ -649,6 +548,7 @@ files:
|
|
649
548
|
- spec/praxis/extensions/rendering_spec.rb
|
650
549
|
- spec/praxis/extensions/support/spec_resources_active_model.rb
|
651
550
|
- spec/praxis/extensions/support/spec_resources_sequel.rb
|
551
|
+
- spec/praxis/field_expander_spec.rb
|
652
552
|
- spec/praxis/file_group_spec.rb
|
653
553
|
- spec/praxis/handlers/json_spec.rb
|
654
554
|
- spec/praxis/mapper/resource_spec.rb
|
@@ -659,11 +559,11 @@ files:
|
|
659
559
|
- spec/praxis/multipart/parser_spec.rb
|
660
560
|
- spec/praxis/notifications_spec.rb
|
661
561
|
- spec/praxis/plugin_concern_spec.rb
|
562
|
+
- spec/praxis/renderer_spec.rb
|
662
563
|
- spec/praxis/request_spec.rb
|
663
564
|
- spec/praxis/request_stages/action_spec.rb
|
664
565
|
- spec/praxis/request_stages/request_stage_spec.rb
|
665
566
|
- spec/praxis/request_stages/validate_spec.rb
|
666
|
-
- spec/praxis/resource_definition_spec.rb
|
667
567
|
- spec/praxis/response_definition_spec.rb
|
668
568
|
- spec/praxis/response_spec.rb
|
669
569
|
- spec/praxis/responses/internal_server_error_spec.rb
|
@@ -676,7 +576,6 @@ files:
|
|
676
576
|
- spec/praxis/types/fuzzy_hash_spec.rb
|
677
577
|
- spec/praxis/types/multipart_array/part_definition_spec.rb
|
678
578
|
- spec/praxis/types/multipart_array_spec.rb
|
679
|
-
- spec/praxis/types/multipart_spec.rb
|
680
579
|
- spec/spec_app/app/concerns/authenticated.rb
|
681
580
|
- spec/spec_app/app/concerns/basic_api.rb
|
682
581
|
- spec/spec_app/app/concerns/log_wrapper.rb
|
@@ -706,18 +605,19 @@ files:
|
|
706
605
|
- spec/spec_helper.rb
|
707
606
|
- spec/support/be_deep_equal_matcher.rb
|
708
607
|
- spec/support/spec_authorization_plugin.rb
|
608
|
+
- spec/support/spec_blueprints.rb
|
709
609
|
- spec/support/spec_complex_authentication_plugin.rb
|
610
|
+
- spec/support/spec_endpoint_definitions.rb
|
710
611
|
- spec/support/spec_media_types.rb
|
711
|
-
- spec/support/spec_resource_definitions.rb
|
712
612
|
- spec/support/spec_resources.rb
|
713
613
|
- spec/support/spec_simple_authentication_plugin.rb
|
714
614
|
- tasks/loader.thor
|
715
615
|
- tasks/thor/app.rb
|
716
616
|
- tasks/thor/example.rb
|
617
|
+
- tasks/thor/model.rb
|
618
|
+
- tasks/thor/scaffold.rb
|
717
619
|
- tasks/thor/templates/generator/empty_app/.gitignore
|
718
|
-
- tasks/thor/templates/generator/empty_app/.rspec
|
719
620
|
- tasks/thor/templates/generator/empty_app/Gemfile
|
720
|
-
- tasks/thor/templates/generator/empty_app/Guardfile
|
721
621
|
- tasks/thor/templates/generator/empty_app/README.md
|
722
622
|
- tasks/thor/templates/generator/empty_app/Rakefile
|
723
623
|
- tasks/thor/templates/generator/empty_app/app/models/.empty_directory
|
@@ -726,19 +626,45 @@ files:
|
|
726
626
|
- tasks/thor/templates/generator/empty_app/app/responses/.gitkeep
|
727
627
|
- tasks/thor/templates/generator/empty_app/app/v1/controllers/.empty_directory
|
728
628
|
- tasks/thor/templates/generator/empty_app/app/v1/controllers/.gitkeep
|
629
|
+
- tasks/thor/templates/generator/empty_app/app/v1/resources/.empty_directory
|
630
|
+
- tasks/thor/templates/generator/empty_app/app/v1/resources/.gitkeep
|
729
631
|
- tasks/thor/templates/generator/empty_app/config.ru
|
730
632
|
- tasks/thor/templates/generator/empty_app/config/environment.rb
|
731
|
-
- tasks/thor/templates/generator/empty_app/config/
|
633
|
+
- tasks/thor/templates/generator/empty_app/config/initializers/.empty_directory
|
634
|
+
- tasks/thor/templates/generator/empty_app/config/initializers/.gitkeep
|
732
635
|
- tasks/thor/templates/generator/empty_app/design/api.rb
|
733
|
-
- tasks/thor/templates/generator/empty_app/design/
|
734
|
-
- tasks/thor/templates/generator/empty_app/design/
|
636
|
+
- tasks/thor/templates/generator/empty_app/design/v1/endpoints/.empty_directory
|
637
|
+
- tasks/thor/templates/generator/empty_app/design/v1/endpoints/.gitkeep
|
735
638
|
- tasks/thor/templates/generator/empty_app/design/v1/media_types/.empty_directory
|
736
639
|
- tasks/thor/templates/generator/empty_app/design/v1/media_types/.gitkeep
|
737
|
-
- tasks/thor/templates/generator/empty_app/
|
738
|
-
- tasks/thor/templates/generator/empty_app/
|
739
|
-
- tasks/thor/templates/generator/empty_app/docs/app.js
|
740
|
-
- tasks/thor/templates/generator/empty_app/docs/styles.scss
|
640
|
+
- tasks/thor/templates/generator/empty_app/docs/.empty_directory
|
641
|
+
- tasks/thor/templates/generator/empty_app/docs/.gitkeep
|
741
642
|
- tasks/thor/templates/generator/empty_app/spec/spec_helper.rb
|
643
|
+
- tasks/thor/templates/generator/example_app/.gitignore
|
644
|
+
- tasks/thor/templates/generator/example_app/Gemfile
|
645
|
+
- tasks/thor/templates/generator/example_app/Rakefile
|
646
|
+
- tasks/thor/templates/generator/example_app/app/models/user.rb
|
647
|
+
- tasks/thor/templates/generator/example_app/app/v1/concerns/controller_base.rb
|
648
|
+
- tasks/thor/templates/generator/example_app/app/v1/controllers/users.rb
|
649
|
+
- tasks/thor/templates/generator/example_app/app/v1/resources/base.rb
|
650
|
+
- tasks/thor/templates/generator/example_app/app/v1/resources/user.rb
|
651
|
+
- tasks/thor/templates/generator/example_app/config.ru
|
652
|
+
- tasks/thor/templates/generator/example_app/config/environment.rb
|
653
|
+
- tasks/thor/templates/generator/example_app/db/migrate/20201010101010_create_users_table.rb
|
654
|
+
- tasks/thor/templates/generator/example_app/db/seeds.rb
|
655
|
+
- tasks/thor/templates/generator/example_app/design/api.rb
|
656
|
+
- tasks/thor/templates/generator/example_app/design/v1/endpoints/users.rb
|
657
|
+
- tasks/thor/templates/generator/example_app/design/v1/media_types/user.rb
|
658
|
+
- tasks/thor/templates/generator/example_app/spec/helpers/database_helper.rb
|
659
|
+
- tasks/thor/templates/generator/example_app/spec/spec_helper.rb
|
660
|
+
- tasks/thor/templates/generator/example_app/spec/v1/controllers/users_spec.rb
|
661
|
+
- tasks/thor/templates/generator/scaffold/design/endpoints/collection.rb
|
662
|
+
- tasks/thor/templates/generator/scaffold/design/media_types/item.rb
|
663
|
+
- tasks/thor/templates/generator/scaffold/implementation/controllers/collection.rb
|
664
|
+
- tasks/thor/templates/generator/scaffold/implementation/resources/base.rb
|
665
|
+
- tasks/thor/templates/generator/scaffold/implementation/resources/item.rb
|
666
|
+
- tasks/thor/templates/generator/scaffold/models/active_record.rb
|
667
|
+
- tasks/thor/templates/generator/scaffold/models/sequel.rb
|
742
668
|
homepage: https://github.com/praxis/praxis
|
743
669
|
licenses:
|
744
670
|
- MIT
|
@@ -758,7 +684,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
758
684
|
- !ruby/object:Gem::Version
|
759
685
|
version: 1.3.1
|
760
686
|
requirements: []
|
761
|
-
rubygems_version: 3.
|
687
|
+
rubygems_version: 3.1.2
|
762
688
|
signing_key:
|
763
689
|
specification_version: 4
|
764
690
|
summary: Building APIs the way you want it.
|
data/lib/api_browser/.bowerrc
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
2
|
-
# coding styles between different editors and IDEs
|
3
|
-
# editorconfig.org
|
4
|
-
|
5
|
-
root = true
|
6
|
-
|
7
|
-
|
8
|
-
[*]
|
9
|
-
|
10
|
-
# Change these settings to your own preference
|
11
|
-
indent_style = space
|
12
|
-
indent_size = 2
|
13
|
-
|
14
|
-
# We recommend you to keep these unchanged
|
15
|
-
end_of_line = lf
|
16
|
-
charset = utf-8
|
17
|
-
trim_trailing_whitespace = true
|
18
|
-
insert_final_newline = true
|
19
|
-
|
20
|
-
[*.md]
|
21
|
-
trim_trailing_whitespace = false
|
@@ -1,581 +0,0 @@
|
|
1
|
-
module.exports = function(grunt) {
|
2
|
-
// Load grunt tasks automatically
|
3
|
-
require('load-grunt-tasks')(grunt);
|
4
|
-
|
5
|
-
// Time how long tasks take. Can help when optimizing build times
|
6
|
-
try {
|
7
|
-
require('time-grunt')(grunt);
|
8
|
-
} catch(e) {
|
9
|
-
|
10
|
-
}
|
11
|
-
|
12
|
-
var userDocsPath = process.env.USER_DOCS_PATH,
|
13
|
-
pluginPaths = process.env.PLUGIN_PATHS ? process.env.PLUGIN_PATHS.split(':') : [],
|
14
|
-
buildPath = userDocsPath + '/output',
|
15
|
-
browserPort = process.env.DOC_PORT || '9090',
|
16
|
-
bowerPaths = pluginPaths.concat([userDocsPath]).map(function(f) { return f + '/bower.json'; }),
|
17
|
-
basePath = process.env.BASE_PATH || '';
|
18
|
-
|
19
|
-
var cssOutput = {};
|
20
|
-
cssOutput[buildPath + '/css/main.css'] = userDocsPath + '/styles.scss';
|
21
|
-
|
22
|
-
grunt.registerMultiTask('merge_bower', function() {
|
23
|
-
var merge = require('package-merge'),
|
24
|
-
options = this.options({
|
25
|
-
template: {},
|
26
|
-
writePath: './bower.json',
|
27
|
-
install: false
|
28
|
-
}),
|
29
|
-
shouldInstallDevAssets = this.flags.development,
|
30
|
-
files = [],
|
31
|
-
template = options.templatePath ? grunt.file.read(options.templatePath) : JSON.stringify(options.template, null, 2),
|
32
|
-
dependencies = template.dependencies || {},
|
33
|
-
devDependencies = template.devDependencies || {};
|
34
|
-
|
35
|
-
this.files.forEach(function(obj) {
|
36
|
-
files = files.concat(obj.src.filter(function(file) {
|
37
|
-
return grunt.file.exists(file);
|
38
|
-
}));
|
39
|
-
});
|
40
|
-
|
41
|
-
var result = files.reduce(function(combined, file) {
|
42
|
-
grunt.verbose.writelns("Combining " + file);
|
43
|
-
return merge(grunt.file.read(file), combined);
|
44
|
-
}, template);
|
45
|
-
|
46
|
-
grunt.file.write(options.writePath, result);
|
47
|
-
|
48
|
-
if (options.install) {
|
49
|
-
grunt.log.writeln('Installing Bower Dependencies');
|
50
|
-
var exec = require('child_process').exec;
|
51
|
-
var done = this.async();
|
52
|
-
exec('node_modules/.bin/bower install --force-latest' + (shouldInstallDevAssets ? '' : ' --production') + '--config.interactive=false --config.analytics=false', { cwd: '.' }, function(error, result) {
|
53
|
-
if (error) {
|
54
|
-
grunt.log.error('bower install failed with' + error);
|
55
|
-
done(false);
|
56
|
-
} else {
|
57
|
-
grunt.log.ok('Dependencies installed succesfully');
|
58
|
-
done();
|
59
|
-
}
|
60
|
-
});
|
61
|
-
}
|
62
|
-
});
|
63
|
-
|
64
|
-
grunt.initConfig({
|
65
|
-
// web server for development
|
66
|
-
connect: {
|
67
|
-
options: {
|
68
|
-
port: browserPort,
|
69
|
-
hostname: '0.0.0.0'
|
70
|
-
},
|
71
|
-
livereload: {
|
72
|
-
options: {
|
73
|
-
livereload: 9091,
|
74
|
-
open: true,
|
75
|
-
base: [userDocsPath].concat(pluginPaths).concat([,
|
76
|
-
'.tmp',
|
77
|
-
'.data',
|
78
|
-
'app'
|
79
|
-
]),
|
80
|
-
// This is to handle support of using $locationProvider.html5Mode(true).
|
81
|
-
middleware: function(connect, options, middlewares) {
|
82
|
-
middlewares.push(function(req, res, next) {
|
83
|
-
var segments = require('url').parse(req.url).pathname.split('/'),
|
84
|
-
last = segments[segments.length - 1];
|
85
|
-
if (last.split('.').length === 1) {
|
86
|
-
try {
|
87
|
-
var index = grunt.file.read('.tmp/index.html');
|
88
|
-
res.setHeader("Content-Type", "text/html");
|
89
|
-
res.write(index, 'utf8');
|
90
|
-
res.end()
|
91
|
-
} catch(e) {
|
92
|
-
next(e);
|
93
|
-
}
|
94
|
-
} else {
|
95
|
-
next();
|
96
|
-
}
|
97
|
-
});
|
98
|
-
|
99
|
-
return middlewares;
|
100
|
-
}
|
101
|
-
}
|
102
|
-
},
|
103
|
-
dist: {
|
104
|
-
options: {
|
105
|
-
base: ['.data', buildPath]
|
106
|
-
}
|
107
|
-
}
|
108
|
-
},
|
109
|
-
|
110
|
-
clean: {
|
111
|
-
serve: {
|
112
|
-
files: [{
|
113
|
-
dot: true,
|
114
|
-
src: [
|
115
|
-
'.tmp'
|
116
|
-
]
|
117
|
-
}]
|
118
|
-
},
|
119
|
-
dist: {
|
120
|
-
options: {
|
121
|
-
force: true,
|
122
|
-
},
|
123
|
-
files: [{
|
124
|
-
dot: true,
|
125
|
-
src: [
|
126
|
-
'.tmp',
|
127
|
-
buildPath
|
128
|
-
]
|
129
|
-
}]
|
130
|
-
}
|
131
|
-
},
|
132
|
-
// Automatically inject Bower components into the app
|
133
|
-
wiredep: {
|
134
|
-
app: {
|
135
|
-
src: '.tmp/index.html',
|
136
|
-
ignorePath: /(..\/)?app\//,
|
137
|
-
// We do not use bootstrap's JS code, also the SASS styles are included by our style sheet
|
138
|
-
exclude: [/bootstrap-sass/]
|
139
|
-
}
|
140
|
-
},
|
141
|
-
|
142
|
-
// Automatically inject the JS files into the app
|
143
|
-
fileblocks: {
|
144
|
-
options: { removeFiles: true },
|
145
|
-
dist: {
|
146
|
-
src: 'app/index.html',
|
147
|
-
dest: '.tmp/index.html',
|
148
|
-
blocks: {
|
149
|
-
scripts: {
|
150
|
-
cwd: 'app',
|
151
|
-
// This ensures app.js comes first so the angular module is declared,
|
152
|
-
// then Praxis core files, then plugin files
|
153
|
-
src: ['js/app.js', 'js/**/*.js']
|
154
|
-
},
|
155
|
-
pluginscripts: {
|
156
|
-
src: pluginPaths.map(function(path) {
|
157
|
-
return path + '/**/*.js';
|
158
|
-
})
|
159
|
-
},
|
160
|
-
userscripts: {
|
161
|
-
// cwd: userDocsPath,
|
162
|
-
src: [userDocsPath + '/app.js', userDocsPath + '/**/*.js', '!' + userDocsPath + '/output/**/*.js']
|
163
|
-
}
|
164
|
-
}
|
165
|
-
},
|
166
|
-
|
167
|
-
serve: {
|
168
|
-
src: 'app/index.html',
|
169
|
-
dest: '.tmp/index.html',
|
170
|
-
blocks: {
|
171
|
-
scripts: {
|
172
|
-
cwd: 'app',
|
173
|
-
// This ensures app.js comes first so the angular module is declared
|
174
|
-
src: ['js/app.js', 'js/**/*.js']
|
175
|
-
},
|
176
|
-
pluginscripts: {
|
177
|
-
src: pluginPaths.map(function(path) {
|
178
|
-
return path + '/**/*.js';
|
179
|
-
}),
|
180
|
-
templatesFn: {
|
181
|
-
js: function(file) {
|
182
|
-
var pluginPath = pluginPaths.filter(function(path) {
|
183
|
-
return grunt.file.isMatch(path + '/**/*.js', file);
|
184
|
-
})[0];
|
185
|
-
|
186
|
-
return file.replace(pluginPath + '/', '');
|
187
|
-
}
|
188
|
-
}
|
189
|
-
},
|
190
|
-
userscripts: {
|
191
|
-
cwd: userDocsPath,
|
192
|
-
src: ['app.js', '**/*.js', '!output/**/*.js']
|
193
|
-
}
|
194
|
-
}
|
195
|
-
}
|
196
|
-
},
|
197
|
-
|
198
|
-
// Build stylesheet from SASS files
|
199
|
-
sass: {
|
200
|
-
server: {
|
201
|
-
options: {
|
202
|
-
sourceComments: 'map',
|
203
|
-
sourceMap: __dirname + '/.tmp/css/main.css.map',
|
204
|
-
includePaths: ['app/sass'].concat(pluginPaths)
|
205
|
-
},
|
206
|
-
files: {
|
207
|
-
'.tmp/css/main.css': userDocsPath + '/styles.scss'
|
208
|
-
}
|
209
|
-
},
|
210
|
-
dist: {
|
211
|
-
options: {
|
212
|
-
sourceComments: 'none',
|
213
|
-
includePaths: ['app/sass'].concat(pluginPaths)
|
214
|
-
},
|
215
|
-
files: cssOutput
|
216
|
-
}
|
217
|
-
},
|
218
|
-
|
219
|
-
cssmin: {
|
220
|
-
dist: {
|
221
|
-
files: [{
|
222
|
-
src: buildPath + '/css/main.css',
|
223
|
-
dest: buildPath + '/css/main.css'
|
224
|
-
}]
|
225
|
-
}
|
226
|
-
},
|
227
|
-
|
228
|
-
ngAnnotate: {
|
229
|
-
options: {
|
230
|
-
add: true,
|
231
|
-
singleQuotes: true,
|
232
|
-
ngAnnotateOptions: {
|
233
|
-
plugin: [{init: function() {},
|
234
|
-
match: function(node) {
|
235
|
-
if (node.callee && node.callee.object) {
|
236
|
-
var object = node.callee.object;
|
237
|
-
if (object && object.type === 'Identifier' && object.name === 'templateForProvider' && node.callee.property.name === 'register') {
|
238
|
-
return node.arguments[0];
|
239
|
-
}
|
240
|
-
if (object && object.type === 'Identifier' && object.name === 'ExamplesProvider' && node.callee.property.name === 'register') {
|
241
|
-
return node.arguments[2];
|
242
|
-
}
|
243
|
-
}
|
244
|
-
}}]
|
245
|
-
}
|
246
|
-
},
|
247
|
-
dist: {
|
248
|
-
files: [{
|
249
|
-
expand: true,
|
250
|
-
cwd: '.tmp/concat/scripts',
|
251
|
-
src: '*.js',
|
252
|
-
dest: '.tmp/concat/scripts'
|
253
|
-
}]
|
254
|
-
}
|
255
|
-
},
|
256
|
-
|
257
|
-
filerev: {
|
258
|
-
dist: {
|
259
|
-
src: [
|
260
|
-
buildPath + '/scripts/*.js',
|
261
|
-
buildPath + '/css/*.css'
|
262
|
-
]
|
263
|
-
}
|
264
|
-
},
|
265
|
-
|
266
|
-
ngtemplates: {
|
267
|
-
options: {
|
268
|
-
htmlmin: {
|
269
|
-
collapseBooleanAttributes: true,
|
270
|
-
collapseWhitespace: true,
|
271
|
-
removeAttributeQuotes: true,
|
272
|
-
removeComments: true,
|
273
|
-
removeEmptyAttributes: true,
|
274
|
-
removeRedundantAttributes: true,
|
275
|
-
removeScriptTypeAttributes: true,
|
276
|
-
removeStyleLinkTypeAttributes: true
|
277
|
-
},
|
278
|
-
bootstrap: function(module, script) {
|
279
|
-
return 'angular.module("' + module + '").run(function($templateCache){' + script + '});';
|
280
|
-
},
|
281
|
-
},
|
282
|
-
dist: {
|
283
|
-
files: [{
|
284
|
-
cwd: 'app',
|
285
|
-
src: 'views/**/*.html',
|
286
|
-
dest: '.tmp/templates.js'
|
287
|
-
}].concat(pluginPaths.map(function (path, i) {
|
288
|
-
return {
|
289
|
-
cwd: path,
|
290
|
-
src: 'views/**/*.html',
|
291
|
-
dest: '.tmp/plugin-templates-' + i + '.js'
|
292
|
-
};
|
293
|
-
})),
|
294
|
-
|
295
|
-
options: {
|
296
|
-
usemin: buildPath + '/scripts/praxis.js',
|
297
|
-
module: 'PraxisDocBrowser',
|
298
|
-
}
|
299
|
-
},
|
300
|
-
userScripts: {
|
301
|
-
cwd: userDocsPath,
|
302
|
-
src: 'views/**/*.html',
|
303
|
-
dest: '.tmp/usertemplates.js',
|
304
|
-
options: {
|
305
|
-
usemin: buildPath + '/scripts/docs.js',
|
306
|
-
module: 'DocBrowser',
|
307
|
-
}
|
308
|
-
}
|
309
|
-
},
|
310
|
-
|
311
|
-
copy: {
|
312
|
-
dist: {
|
313
|
-
files: [{
|
314
|
-
expand: true,
|
315
|
-
dot: true,
|
316
|
-
cwd: 'app',
|
317
|
-
dest: buildPath,
|
318
|
-
src: [
|
319
|
-
'*.{ico,png,txt}'
|
320
|
-
]
|
321
|
-
}, {
|
322
|
-
expand: true,
|
323
|
-
dot: true,
|
324
|
-
cwd: '.tmp',
|
325
|
-
dest: buildPath,
|
326
|
-
src: [
|
327
|
-
'index.html'
|
328
|
-
]
|
329
|
-
}, {
|
330
|
-
expand: true,
|
331
|
-
dot: true,
|
332
|
-
cwd: userDocsPath,
|
333
|
-
dest: buildPath,
|
334
|
-
src: [
|
335
|
-
'**/*',
|
336
|
-
'!**/*.{js,scss,sass,less,coffee}',
|
337
|
-
'!views/**',
|
338
|
-
'!**/.*',
|
339
|
-
'!output/**',
|
340
|
-
'!bower.json'
|
341
|
-
]
|
342
|
-
}].concat(pluginPaths.map(function(path) {
|
343
|
-
return {
|
344
|
-
expand: true,
|
345
|
-
dot: true,
|
346
|
-
cwd: path,
|
347
|
-
dest: buildPath,
|
348
|
-
src: [
|
349
|
-
'**/*',
|
350
|
-
'!**/*.{js,scss,sass,less,coffee}',
|
351
|
-
'!views/**',
|
352
|
-
'!**/.*',
|
353
|
-
'!output/**',
|
354
|
-
'!bower.json'
|
355
|
-
]
|
356
|
-
};
|
357
|
-
}))
|
358
|
-
}
|
359
|
-
},
|
360
|
-
|
361
|
-
merge_bower: {
|
362
|
-
app: {
|
363
|
-
options: {
|
364
|
-
writePath: 'bower.json',
|
365
|
-
templatePath: 'bower_template.json',
|
366
|
-
install: true
|
367
|
-
},
|
368
|
-
src: bowerPaths
|
369
|
-
}
|
370
|
-
},
|
371
|
-
|
372
|
-
// Reads HTML for usemin blocks to enable smart builds that automatically
|
373
|
-
// concat, minify and revision files. Creates configurations in memory so
|
374
|
-
// additional tasks can operate on them
|
375
|
-
useminPrepare: {
|
376
|
-
html: '.tmp/index.html',
|
377
|
-
options: {
|
378
|
-
dest: buildPath
|
379
|
-
}
|
380
|
-
},
|
381
|
-
|
382
|
-
// Performs rewrites based on rev and the useminPrepare configuration
|
383
|
-
usemin: {
|
384
|
-
html: [buildPath + '/index.html'],
|
385
|
-
css: [buildPath + '/css/{,*/}*.css'],
|
386
|
-
options: {
|
387
|
-
assetsDirs: [buildPath],
|
388
|
-
blockReplacements: {
|
389
|
-
base: function(block) {
|
390
|
-
if (basePath !== '') {
|
391
|
-
return '<base href="' + basePath + '">';
|
392
|
-
}
|
393
|
-
return '';
|
394
|
-
}
|
395
|
-
}
|
396
|
-
}
|
397
|
-
},
|
398
|
-
|
399
|
-
karma: {
|
400
|
-
options: {
|
401
|
-
files: [
|
402
|
-
'node_modules/quick_check/dist/jasmine-quick-check.js',
|
403
|
-
'app/bower_components/jquery/dist/jquery.js',
|
404
|
-
'app/bower_components/angular/angular.js',
|
405
|
-
'app/bower_components/lodash/lodash.js',
|
406
|
-
'app/bower_components/angular-ui-router/release/angular-ui-router.js',
|
407
|
-
'app/bower_components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.js',
|
408
|
-
'app/bower_components/angular-sanitize/angular-sanitize.js',
|
409
|
-
'app/bower_components/angular-mocks/angular-mocks.js',
|
410
|
-
'app/bower_components/showdown/compressed/Showdown.min.js',
|
411
|
-
'app/js/app.js', 'app/js/**/*.js', '.tmp/templates.js', '../../spec/api_browser/**/*.js'
|
412
|
-
],
|
413
|
-
frameworks: ['jasmine'],
|
414
|
-
reporters: ['dots'],
|
415
|
-
},
|
416
|
-
unit: {
|
417
|
-
browsers: ['PhantomJS'],
|
418
|
-
singleRun: true
|
419
|
-
}
|
420
|
-
},
|
421
|
-
|
422
|
-
jshint: {
|
423
|
-
src: ['app/js/**/*.js', '../../spec/api_browser/**/*.js'],
|
424
|
-
options: {
|
425
|
-
bitwise: true,
|
426
|
-
immed: true,
|
427
|
-
newcap: false,
|
428
|
-
noarg: true,
|
429
|
-
noempty: true,
|
430
|
-
nonew: true,
|
431
|
-
trailing: true,
|
432
|
-
boss: true,
|
433
|
-
eqnull: true,
|
434
|
-
expr: true,
|
435
|
-
laxbreak: true,
|
436
|
-
loopfunc: true,
|
437
|
-
sub: true,
|
438
|
-
undef: true,
|
439
|
-
unused: true,
|
440
|
-
browser: true,
|
441
|
-
quotmark: true,
|
442
|
-
indent: 2,
|
443
|
-
jasmine: true,
|
444
|
-
globals: {
|
445
|
-
"angular": false,
|
446
|
-
"app": true,
|
447
|
-
"_": false,
|
448
|
-
"$": false,
|
449
|
-
"jQuery": false,
|
450
|
-
"Showdown": false,
|
451
|
-
"inject": false,
|
452
|
-
"qc": false
|
453
|
-
}
|
454
|
-
}
|
455
|
-
}
|
456
|
-
});
|
457
|
-
|
458
|
-
grunt.registerTask('runGenerator', function() {
|
459
|
-
var exec = require('child_process').exec;
|
460
|
-
var done = this.async();
|
461
|
-
exec('bundle exec rake praxis:docs:generate', {cwd: userDocsPath + '/../'}, done);
|
462
|
-
});
|
463
|
-
|
464
|
-
grunt.registerTask('serve', function(target) {
|
465
|
-
if (target === 'dist') {
|
466
|
-
return grunt.task.run(['build', 'connect:dist:keepalive']);
|
467
|
-
}
|
468
|
-
grunt.config.merge({
|
469
|
-
watch: {
|
470
|
-
// Updates index.html for any file added or removed
|
471
|
-
scripts: {
|
472
|
-
files: ['app/js/**/*.js', userDocsPath + '/**/*.js'],
|
473
|
-
tasks: ['fileblocks:serve', 'wiredep'],
|
474
|
-
options: { livereload: 9091 }
|
475
|
-
},
|
476
|
-
|
477
|
-
// Updates index.html for any bower component added or removed
|
478
|
-
bowerComponents: {
|
479
|
-
files: ['app/bower_components/**/.bower.json'],
|
480
|
-
tasks: 'wiredep',
|
481
|
-
options: { livereload: 9091 }
|
482
|
-
},
|
483
|
-
|
484
|
-
// watches bower paths to retrigger bower install
|
485
|
-
bower: {
|
486
|
-
files: bowerPaths.concat(['bower_template.json']),
|
487
|
-
tasks: ['merge_bower:app', 'wiredep'],
|
488
|
-
options: { livereload: 9091 }
|
489
|
-
},
|
490
|
-
|
491
|
-
// Rebuild the stylesheets for any SASS file changed
|
492
|
-
sass: {
|
493
|
-
files: [
|
494
|
-
'app/sass/**/*.scss',
|
495
|
-
'app/bower_components/**/*.scss',
|
496
|
-
userDocsPath + '/**/*.scss'
|
497
|
-
],
|
498
|
-
tasks: 'sass',
|
499
|
-
options: { livereload: 9091 }
|
500
|
-
},
|
501
|
-
|
502
|
-
data: {
|
503
|
-
files: [
|
504
|
-
userDocsPath + '/../design/**/*.rb'
|
505
|
-
],
|
506
|
-
tasks: 'runGenerator',
|
507
|
-
options: { livereload: 9091 }
|
508
|
-
},
|
509
|
-
|
510
|
-
// Watches files that don't need processing
|
511
|
-
other: {
|
512
|
-
files: [
|
513
|
-
'app/css/*.css',
|
514
|
-
"app/index.html",
|
515
|
-
"app/views/**/*.html",
|
516
|
-
userDocsPath + '/views/**/*.html'
|
517
|
-
],
|
518
|
-
options: {
|
519
|
-
livereload: 9091
|
520
|
-
}
|
521
|
-
}
|
522
|
-
}
|
523
|
-
});
|
524
|
-
|
525
|
-
grunt.task.run([
|
526
|
-
'clean:serve',
|
527
|
-
'merge_bower:app',
|
528
|
-
'fileblocks:serve',
|
529
|
-
'wiredep',
|
530
|
-
'sass:server',
|
531
|
-
'connect:livereload',
|
532
|
-
'watch'
|
533
|
-
]);
|
534
|
-
});
|
535
|
-
|
536
|
-
grunt.registerTask('build', [
|
537
|
-
'clean:dist',
|
538
|
-
'merge_bower:app',
|
539
|
-
'fileblocks:dist',
|
540
|
-
'wiredep',
|
541
|
-
'sass:dist',
|
542
|
-
'useminPrepare',
|
543
|
-
'ngtemplates',
|
544
|
-
'concat',
|
545
|
-
'ngAnnotate',
|
546
|
-
'copy:dist',
|
547
|
-
'cssmin',
|
548
|
-
'uglify',
|
549
|
-
'filerev',
|
550
|
-
'usemin'
|
551
|
-
]);
|
552
|
-
|
553
|
-
grunt.registerTask('test', function() {
|
554
|
-
grunt.config.set('watch', {
|
555
|
-
tests: {
|
556
|
-
files: [
|
557
|
-
'app/js/**',
|
558
|
-
'../../spec/api_browser/**'
|
559
|
-
],
|
560
|
-
tasks: ['jshint:src', 'karma:unit'],
|
561
|
-
options: {
|
562
|
-
atBegin: true
|
563
|
-
}
|
564
|
-
}
|
565
|
-
});
|
566
|
-
|
567
|
-
grunt.task.run([
|
568
|
-
'ngtemplates:dist',
|
569
|
-
'watch:tests'
|
570
|
-
]);
|
571
|
-
});
|
572
|
-
|
573
|
-
grunt.registerTask('ci', [
|
574
|
-
'merge_bower:app:development',
|
575
|
-
'ngtemplates:dist',
|
576
|
-
'jshint:src',
|
577
|
-
'karma:unit'
|
578
|
-
]);
|
579
|
-
|
580
|
-
grunt.registerTask("default", ["serve"]);
|
581
|
-
};
|