praxis 2.0.pre.18 → 2.0.pre.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +54 -0
  3. data/.simplecov +3 -1
  4. data/.travis.yml +2 -1
  5. data/CHANGELOG.md +6 -0
  6. data/CONTRIBUTING.md +2 -79
  7. data/Gemfile +5 -1
  8. data/Guardfile +6 -4
  9. data/LICENSE +0 -2
  10. data/MAINTAINERS.md +1 -0
  11. data/README.md +15 -22
  12. data/Rakefile +4 -2
  13. data/bin/praxis +55 -58
  14. data/lib/praxis/action_definition/headers_dsl_compiler.rb +5 -6
  15. data/lib/praxis/action_definition.rb +64 -94
  16. data/lib/praxis/api_definition.rb +21 -29
  17. data/lib/praxis/api_general_info.rb +55 -66
  18. data/lib/praxis/application.rb +15 -32
  19. data/lib/praxis/blueprint.rb +64 -73
  20. data/lib/praxis/bootloader.rb +24 -33
  21. data/lib/praxis/bootloader_stages/environment.rb +5 -10
  22. data/lib/praxis/bootloader_stages/file_loader.rb +3 -6
  23. data/lib/praxis/bootloader_stages/plugin_config_load.rb +4 -6
  24. data/lib/praxis/bootloader_stages/plugin_config_prepare.rb +2 -2
  25. data/lib/praxis/bootloader_stages/plugin_loader.rb +3 -7
  26. data/lib/praxis/bootloader_stages/plugin_setup.rb +3 -3
  27. data/lib/praxis/bootloader_stages/routing.rb +5 -8
  28. data/lib/praxis/bootloader_stages/subgroup_loader.rb +2 -10
  29. data/lib/praxis/bootloader_stages/warn_unloaded_files.rb +15 -19
  30. data/lib/praxis/callbacks.rb +12 -11
  31. data/lib/praxis/collection.rb +10 -13
  32. data/lib/praxis/config.rb +17 -28
  33. data/lib/praxis/config_hash.rb +2 -1
  34. data/lib/praxis/controller.rb +7 -6
  35. data/lib/praxis/dispatcher.rb +34 -42
  36. data/lib/praxis/docs/open_api/info_object.rb +11 -8
  37. data/lib/praxis/docs/open_api/media_type_object.rb +18 -17
  38. data/lib/praxis/docs/open_api/operation_object.rb +6 -3
  39. data/lib/praxis/docs/open_api/parameter_object.rb +17 -14
  40. data/lib/praxis/docs/open_api/paths_object.rb +11 -9
  41. data/lib/praxis/docs/open_api/request_body_object.rb +14 -13
  42. data/lib/praxis/docs/open_api/response_object.rb +24 -18
  43. data/lib/praxis/docs/open_api/responses_object.rb +3 -1
  44. data/lib/praxis/docs/open_api/schema_object.rb +16 -16
  45. data/lib/praxis/docs/open_api/server_object.rb +5 -2
  46. data/lib/praxis/docs/open_api/tag_object.rb +6 -3
  47. data/lib/praxis/docs/open_api_generator.rb +92 -95
  48. data/lib/praxis/endpoint_definition.rb +60 -77
  49. data/lib/praxis/error_handler.rb +2 -2
  50. data/lib/praxis/exception.rb +2 -0
  51. data/lib/praxis/exceptions/config.rb +3 -1
  52. data/lib/praxis/exceptions/config_load.rb +2 -0
  53. data/lib/praxis/exceptions/config_validation.rb +3 -1
  54. data/lib/praxis/exceptions/invalid_configuration.rb +3 -1
  55. data/lib/praxis/exceptions/invalid_response.rb +3 -1
  56. data/lib/praxis/exceptions/invalid_trait.rb +3 -1
  57. data/lib/praxis/exceptions/stage_not_found.rb +3 -1
  58. data/lib/praxis/exceptions/validation.rb +4 -3
  59. data/lib/praxis/extensions/attribute_filtering/active_record_filter_query_builder.rb +163 -149
  60. data/lib/praxis/extensions/attribute_filtering/active_record_patches/5x.rb +18 -13
  61. data/lib/praxis/extensions/attribute_filtering/active_record_patches/6_0.rb +13 -9
  62. data/lib/praxis/extensions/attribute_filtering/active_record_patches/6_1_plus.rb +14 -11
  63. data/lib/praxis/extensions/attribute_filtering/active_record_patches.rb +12 -9
  64. data/lib/praxis/extensions/attribute_filtering/filter_tree_node.rb +8 -5
  65. data/lib/praxis/extensions/attribute_filtering/filtering_params.rb +89 -65
  66. data/lib/praxis/extensions/attribute_filtering/filters_parser.rb +68 -62
  67. data/lib/praxis/extensions/attribute_filtering.rb +3 -1
  68. data/lib/praxis/extensions/field_expansion.rb +6 -4
  69. data/lib/praxis/extensions/field_selection/active_record_query_selector.rb +10 -8
  70. data/lib/praxis/extensions/field_selection/field_selector.rb +91 -92
  71. data/lib/praxis/extensions/field_selection/sequel_query_selector.rb +12 -12
  72. data/lib/praxis/extensions/field_selection.rb +3 -1
  73. data/lib/praxis/extensions/pagination/active_record_pagination_handler.rb +6 -4
  74. data/lib/praxis/extensions/pagination/header_generator.rb +16 -11
  75. data/lib/praxis/extensions/pagination/ordering_params.rb +29 -28
  76. data/lib/praxis/extensions/pagination/pagination_handler.rb +44 -42
  77. data/lib/praxis/extensions/pagination/pagination_params.rb +29 -48
  78. data/lib/praxis/extensions/pagination/sequel_pagination_handler.rb +8 -7
  79. data/lib/praxis/extensions/pagination.rb +10 -15
  80. data/lib/praxis/extensions/rails_compat/request_methods.rb +3 -4
  81. data/lib/praxis/extensions/rails_compat.rb +2 -0
  82. data/lib/praxis/extensions/rendering.rb +12 -12
  83. data/lib/praxis/field_expander.rb +8 -9
  84. data/lib/praxis/file_group.rb +8 -12
  85. data/lib/praxis/finalizable.rb +1 -0
  86. data/lib/praxis/handlers/json.rb +5 -2
  87. data/lib/praxis/handlers/plain.rb +2 -1
  88. data/lib/praxis/handlers/www_form.rb +6 -3
  89. data/lib/praxis/handlers/{xml-sample.rb → xml_sample.rb} +26 -22
  90. data/lib/praxis/mapper/active_model_compat.rb +13 -10
  91. data/lib/praxis/mapper/resource.rb +171 -180
  92. data/lib/praxis/mapper/selector_generator.rb +106 -112
  93. data/lib/praxis/mapper/sequel_compat.rb +70 -67
  94. data/lib/praxis/media_type.rb +2 -2
  95. data/lib/praxis/media_type_identifier.rb +26 -22
  96. data/lib/praxis/middleware_app.rb +18 -15
  97. data/lib/praxis/multipart/parser.rb +46 -51
  98. data/lib/praxis/multipart/part.rb +78 -110
  99. data/lib/praxis/notifications.rb +2 -4
  100. data/lib/praxis/plugin.rb +11 -18
  101. data/lib/praxis/plugin_concern.rb +12 -15
  102. data/lib/praxis/plugins/mapper_plugin.rb +15 -13
  103. data/lib/praxis/plugins/pagination_plugin.rb +8 -6
  104. data/lib/praxis/plugins/rails_plugin.rb +33 -28
  105. data/lib/praxis/renderer.rb +11 -15
  106. data/lib/praxis/request.rb +46 -47
  107. data/lib/praxis/request_stages/action.rb +4 -6
  108. data/lib/praxis/request_stages/load_request.rb +2 -4
  109. data/lib/praxis/request_stages/request_stage.rb +19 -23
  110. data/lib/praxis/request_stages/response.rb +4 -6
  111. data/lib/praxis/request_stages/validate.rb +3 -5
  112. data/lib/praxis/request_stages/validate_params_and_headers.rb +15 -16
  113. data/lib/praxis/request_stages/validate_payload.rb +25 -27
  114. data/lib/praxis/request_superclassing.rb +3 -3
  115. data/lib/praxis/resource_definition.rb +1 -0
  116. data/lib/praxis/response.rb +13 -25
  117. data/lib/praxis/response_definition.rb +77 -122
  118. data/lib/praxis/response_template.rb +11 -15
  119. data/lib/praxis/responses/http.rb +23 -44
  120. data/lib/praxis/responses/internal_server_error.rb +18 -21
  121. data/lib/praxis/responses/multipart_ok.rb +4 -9
  122. data/lib/praxis/responses/validation_error.rb +8 -15
  123. data/lib/praxis/route.rb +8 -10
  124. data/lib/praxis/router/rack.rb +13 -7
  125. data/lib/praxis/router/simple.rb +10 -5
  126. data/lib/praxis/router.rb +27 -34
  127. data/lib/praxis/routing_config.rb +52 -29
  128. data/lib/praxis/simple_media_type.rb +5 -8
  129. data/lib/praxis/stage.rb +17 -25
  130. data/lib/praxis/tasks/api_docs.rb +15 -15
  131. data/lib/praxis/tasks/console.rb +3 -1
  132. data/lib/praxis/tasks/environment.rb +2 -0
  133. data/lib/praxis/tasks/routes.rb +26 -24
  134. data/lib/praxis/tasks.rb +3 -1
  135. data/lib/praxis/trait.rb +37 -46
  136. data/lib/praxis/types/fuzzy_hash.rb +13 -14
  137. data/lib/praxis/types/media_type_common.rb +11 -10
  138. data/lib/praxis/types/multipart_array/part_definition.rb +14 -17
  139. data/lib/praxis/types/multipart_array.rb +88 -112
  140. data/lib/praxis/validation_handler.rb +5 -3
  141. data/lib/praxis/version.rb +3 -1
  142. data/lib/praxis.rb +4 -5
  143. data/praxis.gemspec +22 -21
  144. data/spec/functional_spec.rb +40 -52
  145. data/spec/praxis/action_definition_spec.rb +36 -46
  146. data/spec/praxis/api_definition_spec.rb +45 -47
  147. data/spec/praxis/api_general_info_spec.rb +28 -29
  148. data/spec/praxis/application_spec.rb +18 -14
  149. data/spec/praxis/blueprint_spec.rb +33 -34
  150. data/spec/praxis/bootloader_spec.rb +32 -30
  151. data/spec/praxis/callbacks_spec.rb +37 -37
  152. data/spec/praxis/collection_spec.rb +18 -25
  153. data/spec/praxis/config_hash_spec.rb +5 -4
  154. data/spec/praxis/config_spec.rb +27 -26
  155. data/spec/praxis/controller_spec.rb +8 -9
  156. data/spec/praxis/endpoint_definition_spec.rb +25 -32
  157. data/spec/praxis/extensions/attribute_filtering/active_record_filter_query_builder_spec.rb +171 -114
  158. data/spec/praxis/extensions/attribute_filtering/filter_tree_node_spec.rb +22 -21
  159. data/spec/praxis/extensions/attribute_filtering/filtering_params_spec.rb +112 -60
  160. data/spec/praxis/extensions/attribute_filtering/filters_parser_spec.rb +37 -38
  161. data/spec/praxis/extensions/field_expansion_spec.rb +8 -10
  162. data/spec/praxis/extensions/field_selection/active_record_query_selector_spec.rb +14 -13
  163. data/spec/praxis/extensions/field_selection/field_selector_spec.rb +9 -16
  164. data/spec/praxis/extensions/field_selection/sequel_query_selector_spec.rb +50 -49
  165. data/spec/praxis/extensions/pagination/active_record_pagination_handler_spec.rb +32 -31
  166. data/spec/praxis/extensions/rendering_spec.rb +9 -9
  167. data/spec/praxis/extensions/support/spec_resources_active_model.rb +32 -49
  168. data/spec/praxis/extensions/support/spec_resources_sequel.rb +48 -48
  169. data/spec/praxis/field_expander_spec.rb +6 -5
  170. data/spec/praxis/file_group_spec.rb +3 -1
  171. data/spec/praxis/handlers/json_spec.rb +6 -5
  172. data/spec/praxis/mapper/resource_spec.rb +27 -30
  173. data/spec/praxis/mapper/selector_generator_spec.rb +50 -50
  174. data/spec/praxis/media_type_identifier_spec.rb +13 -10
  175. data/spec/praxis/media_type_spec.rb +12 -12
  176. data/spec/praxis/middleware_app_spec.rb +23 -22
  177. data/spec/praxis/multipart/parser_spec.rb +7 -9
  178. data/spec/praxis/notifications_spec.rb +4 -4
  179. data/spec/praxis/plugin_concern_spec.rb +5 -6
  180. data/spec/praxis/renderer_spec.rb +10 -9
  181. data/spec/praxis/request_spec.rb +38 -41
  182. data/spec/praxis/request_stages/action_spec.rb +14 -15
  183. data/spec/praxis/request_stages/request_stage_spec.rb +30 -41
  184. data/spec/praxis/request_stages/validate_spec.rb +3 -1
  185. data/spec/praxis/response_definition_spec.rb +79 -92
  186. data/spec/praxis/response_spec.rb +28 -39
  187. data/spec/praxis/responses/internal_server_error_spec.rb +6 -9
  188. data/spec/praxis/responses/validation_error_spec.rb +17 -18
  189. data/spec/praxis/route_spec.rb +4 -7
  190. data/spec/praxis/router_spec.rb +69 -79
  191. data/spec/praxis/routing_config_spec.rb +15 -14
  192. data/spec/praxis/stage_spec.rb +56 -53
  193. data/spec/praxis/trait_spec.rb +17 -18
  194. data/spec/praxis/types/fuzzy_hash_spec.rb +11 -9
  195. data/spec/praxis/types/multipart_array/part_definition_spec.rb +3 -2
  196. data/spec/praxis/types/multipart_array_spec.rb +33 -48
  197. data/spec/spec_app/app/concerns/authenticated.rb +5 -5
  198. data/spec/spec_app/app/concerns/basic_api.rb +3 -1
  199. data/spec/spec_app/app/concerns/log_wrapper.rb +5 -3
  200. data/spec/spec_app/app/controllers/base_class.rb +6 -5
  201. data/spec/spec_app/app/controllers/instances.rb +31 -34
  202. data/spec/spec_app/app/controllers/volumes.rb +6 -6
  203. data/spec/spec_app/app/responses/multipart.rb +1 -2
  204. data/spec/spec_app/app/responses/other_response.rb +2 -2
  205. data/spec/spec_app/config/environment.rb +19 -6
  206. data/spec/spec_app/config.ru +4 -3
  207. data/spec/spec_app/design/api.rb +13 -15
  208. data/spec/spec_app/design/media_types/instance.rb +5 -5
  209. data/spec/spec_app/design/media_types/volume.rb +2 -1
  210. data/spec/spec_app/design/media_types/volume_snapshot.rb +2 -1
  211. data/spec/spec_app/design/resources/instances.rb +9 -15
  212. data/spec/spec_app/design/resources/volume_snapshots.rb +4 -5
  213. data/spec/spec_app/design/resources/volumes.rb +4 -5
  214. data/spec/spec_helper.rb +11 -13
  215. data/spec/support/be_deep_equal_matcher.rb +5 -0
  216. data/spec/support/spec_authorization_plugin.rb +7 -12
  217. data/spec/support/spec_blueprints.rb +2 -1
  218. data/spec/support/spec_complex_authentication_plugin.rb +17 -34
  219. data/spec/support/spec_endpoint_definitions.rb +2 -3
  220. data/spec/support/spec_media_types.rb +28 -35
  221. data/spec/support/spec_resources.rb +20 -18
  222. data/spec/support/spec_simple_authentication_plugin.rb +5 -9
  223. data/tasks/loader.thor +4 -2
  224. data/tasks/thor/app.rb +7 -5
  225. data/tasks/thor/example.rb +23 -22
  226. data/tasks/thor/model.rb +7 -7
  227. data/tasks/thor/scaffold.rb +23 -23
  228. data/tasks/thor/templates/generator/example_app/app/v1/resources/user.rb +0 -8
  229. data/tasks/thor/templates/generator/scaffold/implementation/resources/item.rb +1 -2
  230. metadata +72 -84
  231. data/MAINTAINERS +0 -2
  232. data/TODO.md +0 -25
  233. data/spec/praxis/api_resource_spec.rb +0 -0
  234. data/spec/praxis/dispatcher_spec.rb +0 -0
  235. data/spec/spec_app/app/responses/bulk_response.rb +0 -0
data/tasks/thor/model.rb CHANGED
@@ -4,23 +4,23 @@ module PraxisGen
4
4
  class Model < Thor
5
5
  require 'active_support/inflector'
6
6
  include Thor::Actions
7
-
7
+
8
8
  def self.source_root
9
- File.dirname(__FILE__) + "/templates/generator/scaffold"
9
+ "#{File.dirname(__FILE__)}/templates/generator/scaffold"
10
10
  end
11
11
 
12
- desc "gmodel", "Generates a skeleton model file under app/models for ActiveRecord or Sequel."
12
+ desc 'gmodel', 'Generates a skeleton model file under app/models for ActiveRecord or Sequel.'
13
13
  argument :model_name, required: true
14
- option :orm, required: false, default: 'activerecord', enum: ['activerecord','sequel']
14
+ option :orm, required: false, default: 'activerecord', enum: %w[activerecord sequel]
15
15
  def g
16
- #self.class.check_name(model_name)
16
+ # self.class.check_name(model_name)
17
17
  template_file = \
18
18
  if options[:orm] == 'activerecord'
19
19
  'models/active_record.rb'
20
20
  else
21
21
  'models/sequel.rb'
22
22
  end
23
- puts "Generating Model for #{model_name}"
23
+ puts "Generating Model for #{model_name}"
24
24
  template template_file, "app/models/#{model_name}.rb"
25
25
  nil
26
26
  end
@@ -34,7 +34,7 @@ module PraxisGen
34
34
  # TODO: do we want the argument to be camelcase? or snake case?
35
35
  def self.check_name(name)
36
36
  sanitized = name.downcase.gsub(/[^a-z0-9_]/, '')
37
- raise "Please use only downcase letters, numbers and underscores for the model" unless sanitized == name
37
+ raise 'Please use only downcase letters, numbers and underscores for the model' unless sanitized == name
38
38
  end
39
39
  end
40
40
  end
@@ -4,32 +4,32 @@ module PraxisGen
4
4
  class Scaffold < Thor
5
5
  require 'active_support/inflector'
6
6
  include Thor::Actions
7
-
7
+
8
8
  attr_reader :actions_hash
9
9
 
10
10
  def self.source_root
11
- File.dirname(__FILE__) + "/templates/generator/scaffold"
11
+ "#{File.dirname(__FILE__)}/templates/generator/scaffold"
12
12
  end
13
13
 
14
- desc "g","Generates an API design and implementation scaffold for managing a collection of <collection_name>"
14
+ desc 'g', 'Generates an API design and implementation scaffold for managing a collection of <collection_name>'
15
15
  argument :collection_name, required: true
16
16
  option :version, required: false, default: '1',
17
- desc: 'Version string for the API endpoint. This also dictates the directory structure (i.e., v1/endpoints/...))'
17
+ desc: 'Version string for the API endpoint. This also dictates the directory structure (i.e., v1/endpoints/...))'
18
18
  option :design, type: :boolean, default: true,
19
- desc: 'Include the Endpoint and MediaType files for the collection'
19
+ desc: 'Include the Endpoint and MediaType files for the collection'
20
20
  option :implementation, type: :boolean, default: true,
21
- desc: 'Include the Controller and (possibly the) Resource files for the collection (see --no-resource)'
21
+ desc: 'Include the Controller and (possibly the) Resource files for the collection (see --no-resource)'
22
22
  option :resource, type: :boolean, default: true,
23
- desc: 'Disable (or enable) the creation of the Resource files when generating implementation'
24
- option :model, type: :string, enum: ['activerecord','sequel'],
25
- desc: 'It also generates a model for the given ORM. An empty --model flag will default to activerecord'
26
- option :actions, type: :string, default: 'crud', enum: ['cr','cru','crud','u','ud','d'],
27
- desc: 'Specifies the actions to generate for the API. cr=create, u=update, d=delete. Index and show actions are always generated'
23
+ desc: 'Disable (or enable) the creation of the Resource files when generating implementation'
24
+ option :model, type: :string, enum: %w[activerecord sequel],
25
+ desc: 'It also generates a model for the given ORM. An empty --model flag will default to activerecord'
26
+ option :actions, type: :string, default: 'crud', enum: %w[cr cru crud u ud d],
27
+ desc: 'Specifies the actions to generate for the API. cr=create, u=update, d=delete. Index and show actions are always generated'
28
28
  def g
29
29
  self.class.check_name(collection_name)
30
30
  @actions_hash = self.class.compose_actions_hash(options[:actions])
31
- env_rb = Pathname.new(destination_root)+Pathname.new("config/environment.rb")
32
- @pagination_plugin_found = File.open(env_rb).grep(/Praxis::Plugins::PaginationPlugin.*/).reject{|l| l.strip[0] == '#'}.present?
31
+ env_rb = Pathname.new(destination_root) + Pathname.new('config/environment.rb')
32
+ @pagination_plugin_found = File.open(env_rb).grep(/Praxis::Plugins::PaginationPlugin.*/).reject { |l| l.strip[0] == '#' }.present?
33
33
  if options[:design]
34
34
  say_status 'Design', "Generating scaffold for #{plural_class}", :blue
35
35
  template 'design/media_types/item.rb', "design/#{version_dir}/media_types/#{collection_name.singularize}.rb"
@@ -38,14 +38,14 @@ module PraxisGen
38
38
  if options[:implementation]
39
39
  say_status 'Implement', "Generating scaffold for #{plural_class}", :blue
40
40
  if options[:resource]
41
- base_resource = Pathname.new(destination_root)+Pathname.new("app/#{version_dir}/resources/base.rb")
41
+ base_resource = Pathname.new(destination_root) + Pathname.new("app/#{version_dir}/resources/base.rb")
42
42
  unless base_resource.exist?
43
43
  # Copy an appropriate base resource for the version (resources within same version must share same base)
44
- say_status "NOTE:",
45
- "Creating a base resource file for resources to inherit from (at 'app/#{version_dir}/resources/base.rb')",
46
- :yellow
47
- say_status "",
48
- "If you had already other resources in the app, change them to derive from this Base"
44
+ say_status 'NOTE:',
45
+ "Creating a base resource file for resources to inherit from (at 'app/#{version_dir}/resources/base.rb')",
46
+ :yellow
47
+ say_status '',
48
+ 'If you had already other resources in the app, change them to derive from this Base'
49
49
  template 'implementation/resources/base.rb', "app/#{version_dir}/resources/base.rb"
50
50
  end
51
51
  template 'implementation/resources/item.rb', "app/#{version_dir}/resources/#{collection_name.singularize}.rb"
@@ -60,11 +60,11 @@ module PraxisGen
60
60
  def plural_class
61
61
  collection_name.camelize
62
62
  end
63
-
63
+
64
64
  def singular_class
65
65
  collection_name.singularize.camelize
66
66
  end
67
-
67
+
68
68
  def version
69
69
  options[:version]
70
70
  end
@@ -72,7 +72,7 @@ module PraxisGen
72
72
  def version_module
73
73
  "V#{version}"
74
74
  end
75
-
75
+
76
76
  def version_dir
77
77
  version_module.camelize(:lower)
78
78
  end
@@ -111,7 +111,7 @@ module PraxisGen
111
111
  def self.check_name(name)
112
112
  sanitized = name.downcase.gsub(/[^a-z0-9_]/, '')
113
113
  # TODO: bail or support CamelCase collections (for now only snake case)
114
- raise "Please use only downcase letters, numbers and underscores for the collection" unless sanitized == name
114
+ raise 'Please use only downcase letters, numbers and underscores for the collection' unless sanitized == name
115
115
  end
116
116
  end
117
117
  end
@@ -5,14 +5,6 @@ module V1
5
5
  class User < Base
6
6
  model ::User
7
7
 
8
- # Mappings for the allowed filters
9
- filters_mapping(
10
- 'uuid': 'uuid',
11
- 'first_name': 'first_name',
12
- 'last_name': 'last_name',
13
- 'email': 'email'
14
- )
15
-
16
8
  # To compute the full_name (method below) we need to load first and last names from the DB
17
9
  property :full_name, dependencies: %i[first_name last_name]
18
10
 
@@ -6,9 +6,8 @@ module <%= version_module %>
6
6
  model ::<%= singular_class %> # Change it if it maps to a different DB model class
7
7
 
8
8
  # Define the name mapping from API filter params, to model attribute/associations
9
- # when they aren't 1:1
9
+ # when they aren't 1:1 the same
10
10
  # filters_mapping(
11
- # 'name': 'name',
12
11
  # 'label': 'association.label_name'
13
12
  # )
14
13
 
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.18
4
+ version: 2.0.pre.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep M. Blanquer
@@ -9,56 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-11-22 00:00:00.000000000 Z
12
+ date: 2022-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: rack
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: '1'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: '1'
28
- - !ruby/object:Gem::Dependency
29
- name: mustermann
15
+ name: activesupport
30
16
  requirement: !ruby/object:Gem::Requirement
31
17
  requirements:
32
18
  - - ">="
33
19
  - !ruby/object:Gem::Version
34
- version: '1.1'
35
- - - "<="
36
- - !ruby/object:Gem::Version
37
- version: '2'
20
+ version: '3'
38
21
  type: :runtime
39
22
  prerelease: false
40
23
  version_requirements: !ruby/object:Gem::Requirement
41
24
  requirements:
42
25
  - - ">="
43
26
  - !ruby/object:Gem::Version
44
- version: '1.1'
45
- - - "<="
46
- - !ruby/object:Gem::Version
47
- version: '2'
27
+ version: '3'
48
28
  - !ruby/object:Gem::Dependency
49
- name: activesupport
29
+ name: attributor
50
30
  requirement: !ruby/object:Gem::Requirement
51
31
  requirements:
52
32
  - - ">="
53
33
  - !ruby/object:Gem::Version
54
- version: '3'
34
+ version: '6.0'
55
35
  type: :runtime
56
36
  prerelease: false
57
37
  version_requirements: !ruby/object:Gem::Requirement
58
38
  requirements:
59
39
  - - ">="
60
40
  - !ruby/object:Gem::Version
61
- version: '3'
41
+ version: '6.0'
62
42
  - !ruby/object:Gem::Dependency
63
43
  name: mime
64
44
  requirement: !ruby/object:Gem::Requirement
@@ -74,33 +54,39 @@ dependencies:
74
54
  - !ruby/object:Gem::Version
75
55
  version: '0'
76
56
  - !ruby/object:Gem::Dependency
77
- name: attributor
57
+ name: mustermann
78
58
  requirement: !ruby/object:Gem::Requirement
79
59
  requirements:
80
60
  - - ">="
81
61
  - !ruby/object:Gem::Version
82
- version: '6.0'
62
+ version: '1.1'
63
+ - - "<="
64
+ - !ruby/object:Gem::Version
65
+ version: '2'
83
66
  type: :runtime
84
67
  prerelease: false
85
68
  version_requirements: !ruby/object:Gem::Requirement
86
69
  requirements:
87
70
  - - ">="
88
71
  - !ruby/object:Gem::Version
89
- version: '6.0'
72
+ version: '1.1'
73
+ - - "<="
74
+ - !ruby/object:Gem::Version
75
+ version: '2'
90
76
  - !ruby/object:Gem::Dependency
91
- name: thor
77
+ name: rack
92
78
  requirement: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - ">="
95
81
  - !ruby/object:Gem::Version
96
- version: '0'
82
+ version: '1'
97
83
  type: :runtime
98
84
  prerelease: false
99
85
  version_requirements: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - ">="
102
88
  - !ruby/object:Gem::Version
103
- version: '0'
89
+ version: '1'
104
90
  - !ruby/object:Gem::Dependency
105
91
  name: terminal-table
106
92
  requirement: !ruby/object:Gem::Requirement
@@ -115,6 +101,20 @@ dependencies:
115
101
  - - "~>"
116
102
  - !ruby/object:Gem::Version
117
103
  version: '1.4'
104
+ - !ruby/object:Gem::Dependency
105
+ name: thor
106
+ requirement: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ type: :runtime
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: bundler
120
120
  requirement: !ruby/object:Gem::Requirement
@@ -200,49 +200,49 @@ dependencies:
200
200
  - !ruby/object:Gem::Version
201
201
  version: '1'
202
202
  - !ruby/object:Gem::Dependency
203
- name: rspec
203
+ name: coveralls
204
204
  requirement: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - "~>"
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
- version: '3'
208
+ version: '0'
209
209
  type: :development
210
210
  prerelease: false
211
211
  version_requirements: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - "~>"
213
+ - - ">="
214
214
  - !ruby/object:Gem::Version
215
- version: '3'
215
+ version: '0'
216
216
  - !ruby/object:Gem::Dependency
217
- name: rspec-its
217
+ name: fuubar
218
218
  requirement: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '1'
222
+ version: '2'
223
223
  type: :development
224
224
  prerelease: false
225
225
  version_requirements: !ruby/object:Gem::Requirement
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '1'
229
+ version: '2'
230
230
  - !ruby/object:Gem::Dependency
231
- name: rspec-collection_matchers
231
+ name: guard
232
232
  requirement: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '1'
236
+ version: '2'
237
237
  type: :development
238
238
  prerelease: false
239
239
  version_requirements: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '1'
243
+ version: '2'
244
244
  - !ruby/object:Gem::Dependency
245
- name: guard
245
+ name: guard-bundler
246
246
  requirement: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - "~>"
@@ -270,75 +270,81 @@ dependencies:
270
270
  - !ruby/object:Gem::Version
271
271
  version: '4'
272
272
  - !ruby/object:Gem::Dependency
273
- name: guard-bundler
273
+ name: rack-test
274
274
  requirement: !ruby/object:Gem::Requirement
275
275
  requirements:
276
276
  - - "~>"
277
277
  - !ruby/object:Gem::Version
278
- version: '2'
278
+ version: '0'
279
279
  type: :development
280
280
  prerelease: false
281
281
  version_requirements: !ruby/object:Gem::Requirement
282
282
  requirements:
283
283
  - - "~>"
284
284
  - !ruby/object:Gem::Version
285
- version: '2'
285
+ version: '0'
286
286
  - !ruby/object:Gem::Dependency
287
- name: rack-test
287
+ name: rspec
288
288
  requirement: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - "~>"
291
291
  - !ruby/object:Gem::Version
292
- version: '0'
292
+ version: '3'
293
293
  type: :development
294
294
  prerelease: false
295
295
  version_requirements: !ruby/object:Gem::Requirement
296
296
  requirements:
297
297
  - - "~>"
298
298
  - !ruby/object:Gem::Version
299
- version: '0'
299
+ version: '3'
300
300
  - !ruby/object:Gem::Dependency
301
- name: simplecov
301
+ name: rspec-collection_matchers
302
302
  requirement: !ruby/object:Gem::Requirement
303
303
  requirements:
304
304
  - - "~>"
305
305
  - !ruby/object:Gem::Version
306
- version: '0'
306
+ version: '1'
307
307
  type: :development
308
308
  prerelease: false
309
309
  version_requirements: !ruby/object:Gem::Requirement
310
310
  requirements:
311
311
  - - "~>"
312
312
  - !ruby/object:Gem::Version
313
- version: '0'
313
+ version: '1'
314
314
  - !ruby/object:Gem::Dependency
315
- name: fuubar
315
+ name: rspec-its
316
316
  requirement: !ruby/object:Gem::Requirement
317
317
  requirements:
318
318
  - - "~>"
319
319
  - !ruby/object:Gem::Version
320
- version: '2'
320
+ version: '1'
321
321
  type: :development
322
322
  prerelease: false
323
323
  version_requirements: !ruby/object:Gem::Requirement
324
324
  requirements:
325
325
  - - "~>"
326
326
  - !ruby/object:Gem::Version
327
- version: '2'
327
+ version: '1'
328
328
  - !ruby/object:Gem::Dependency
329
- name: coveralls
329
+ name: activerecord
330
330
  requirement: !ruby/object:Gem::Requirement
331
331
  requirements:
332
- - - ">="
332
+ - - ">"
333
333
  - !ruby/object:Gem::Version
334
- version: '0'
334
+ version: '4'
335
+ - - "<"
336
+ - !ruby/object:Gem::Version
337
+ version: '7'
335
338
  type: :development
336
339
  prerelease: false
337
340
  version_requirements: !ruby/object:Gem::Requirement
338
341
  requirements:
339
- - - ">="
342
+ - - ">"
340
343
  - !ruby/object:Gem::Version
341
- version: '0'
344
+ version: '4'
345
+ - - "<"
346
+ - !ruby/object:Gem::Version
347
+ version: '7'
342
348
  - !ruby/object:Gem::Dependency
343
349
  name: sequel
344
350
  requirement: !ruby/object:Gem::Requirement
@@ -353,20 +359,6 @@ dependencies:
353
359
  - - "~>"
354
360
  - !ruby/object:Gem::Version
355
361
  version: '5'
356
- - !ruby/object:Gem::Dependency
357
- name: activerecord
358
- requirement: !ruby/object:Gem::Requirement
359
- requirements:
360
- - - ">"
361
- - !ruby/object:Gem::Version
362
- version: '4'
363
- type: :development
364
- prerelease: false
365
- version_requirements: !ruby/object:Gem::Requirement
366
- requirements:
367
- - - ">"
368
- - !ruby/object:Gem::Version
369
- version: '4'
370
362
  description:
371
363
  email:
372
364
  - blanquer@gmail.com
@@ -378,6 +370,7 @@ extra_rdoc_files: []
378
370
  files:
379
371
  - ".gitignore"
380
372
  - ".rspec"
373
+ - ".rubocop.yml"
381
374
  - ".ruby-version"
382
375
  - ".simplecov"
383
376
  - ".travis.yml"
@@ -386,11 +379,9 @@ files:
386
379
  - Gemfile
387
380
  - Guardfile
388
381
  - LICENSE
389
- - MAINTAINERS
390
382
  - MAINTAINERS.md
391
383
  - README.md
392
384
  - Rakefile
393
- - TODO.md
394
385
  - bin/praxis
395
386
  - lib/praxis.rb
396
387
  - lib/praxis/action_definition.rb
@@ -469,7 +460,7 @@ files:
469
460
  - lib/praxis/handlers/json.rb
470
461
  - lib/praxis/handlers/plain.rb
471
462
  - lib/praxis/handlers/www_form.rb
472
- - lib/praxis/handlers/xml-sample.rb
463
+ - lib/praxis/handlers/xml_sample.rb
473
464
  - lib/praxis/mapper/active_model_compat.rb
474
465
  - lib/praxis/mapper/resource.rb
475
466
  - lib/praxis/mapper/selector_generator.rb
@@ -527,7 +518,6 @@ files:
527
518
  - spec/praxis/action_definition_spec.rb
528
519
  - spec/praxis/api_definition_spec.rb
529
520
  - spec/praxis/api_general_info_spec.rb
530
- - spec/praxis/api_resource_spec.rb
531
521
  - spec/praxis/application_spec.rb
532
522
  - spec/praxis/blueprint_spec.rb
533
523
  - spec/praxis/bootloader_spec.rb
@@ -536,7 +526,6 @@ files:
536
526
  - spec/praxis/config_hash_spec.rb
537
527
  - spec/praxis/config_spec.rb
538
528
  - spec/praxis/controller_spec.rb
539
- - spec/praxis/dispatcher_spec.rb
540
529
  - spec/praxis/endpoint_definition_spec.rb
541
530
  - spec/praxis/extensions/attribute_filtering/active_record_filter_query_builder_spec.rb
542
531
  - spec/praxis/extensions/attribute_filtering/filter_tree_node_spec.rb
@@ -584,7 +573,6 @@ files:
584
573
  - spec/spec_app/app/controllers/base_class.rb
585
574
  - spec/spec_app/app/controllers/instances.rb
586
575
  - spec/spec_app/app/controllers/volumes.rb
587
- - spec/spec_app/app/responses/bulk_response.rb
588
576
  - spec/spec_app/app/responses/multipart.rb
589
577
  - spec/spec_app/app/responses/other_response.rb
590
578
  - spec/spec_app/config.ru
@@ -680,7 +668,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
680
668
  requirements:
681
669
  - - ">="
682
670
  - !ruby/object:Gem::Version
683
- version: '2.1'
671
+ version: '2.5'
684
672
  required_rubygems_version: !ruby/object:Gem::Requirement
685
673
  requirements:
686
674
  - - ">"
data/MAINTAINERS DELETED
@@ -1,2 +0,0 @@
1
- Josep Blanquer <blanquer@gmail.com> (@blanquer)
2
- Dane Jensen <dane.jensen@gmail.com>
data/TODO.md DELETED
@@ -1,25 +0,0 @@
1
- # TODO
2
-
3
- ## Things to delete
4
-
5
- * views (just use a sensible default view of just simple types?)
6
- * remove collection summary things...
7
- * FieldResolver?? and that conditional dependency thing...?
8
- * simplify or change examples? ...maybe get rid of randexp.
9
- * NOTE: make sure the types we use only expose the json-schema types...no longer things like Hash/Struct/Symbol ...(that might be good only for coding/implementation, not for documentation)
10
- * Plugins? ... maybe leave them out for the moment?
11
- * change errors to be machine readable
12
- * change naming of resource definition to endpoint definition
13
- * get rid of deprecations
14
-
15
-
16
- ## DONE
17
- * remove links and link_builder
18
- * remove xml handlers for parsing and rendering. (same for url-encoding) -- (which would allow nil-setting things)
19
- * remove route aliases, named routes...and primary route concepts
20
-
21
-
22
- NOTES:
23
- APIGeneralInfo: consumes and produces (make that the default if it isn't...)
24
- maybe remove Praxis::Handlers::WWWForm AND Praxis::Handlers::XML ? or stash them away as examples...
25
-
File without changes
File without changes
File without changes