apipie-rails 0.0.16 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. data/.gitignore +4 -0
  2. data/.travis.yml +7 -2
  3. data/CHANGELOG.md +97 -0
  4. data/Gemfile +1 -1
  5. data/Gemfile.rails30 +5 -0
  6. data/Gemfile.rails32 +5 -0
  7. data/Gemfile.rails40 +5 -0
  8. data/Gemfile.rails41 +5 -0
  9. data/README.rst +405 -25
  10. data/apipie-rails.gemspec +1 -1
  11. data/app/controllers/apipie/apipies_controller.rb +20 -1
  12. data/app/helpers/apipie_helper.rb +9 -0
  13. data/app/views/apipie/apipies/_metadata.erb +1 -0
  14. data/app/views/apipie/apipies/_method_detail.erb +46 -0
  15. data/app/views/apipie/apipies/_params.html.erb +12 -0
  16. data/app/views/apipie/apipies/_params_plain.html.erb +4 -0
  17. data/app/views/apipie/apipies/apipie_404.html.erb +3 -1
  18. data/app/views/apipie/apipies/apipie_checksum.json.erb +1 -0
  19. data/app/views/apipie/apipies/method.html.erb +3 -39
  20. data/app/views/apipie/apipies/plain.html.erb +1 -0
  21. data/app/views/apipie/apipies/resource.html.erb +8 -39
  22. data/app/views/apipie/apipies/static.html.erb +1 -0
  23. data/lib/apipie/application.rb +52 -31
  24. data/lib/apipie/configuration.rb +25 -2
  25. data/lib/apipie/dsl_definition.rb +342 -155
  26. data/lib/apipie/error_description.rb +22 -10
  27. data/lib/apipie/extractor/collector.rb +2 -2
  28. data/lib/apipie/extractor/recorder.rb +6 -3
  29. data/lib/apipie/extractor/writer.rb +10 -4
  30. data/lib/apipie/extractor.rb +5 -2
  31. data/lib/apipie/markup.rb +5 -1
  32. data/lib/apipie/method_description.rb +51 -34
  33. data/lib/apipie/middleware/checksum_in_headers.rb +35 -0
  34. data/lib/apipie/param_description.rb +138 -18
  35. data/lib/apipie/railtie.rb +1 -1
  36. data/lib/apipie/resource_description.rb +13 -8
  37. data/lib/apipie/routing.rb +1 -0
  38. data/lib/apipie/see_description.rb +39 -0
  39. data/lib/apipie/static_dispatcher.rb +11 -2
  40. data/lib/apipie/validator.rb +124 -18
  41. data/lib/apipie/version.rb +1 -1
  42. data/lib/apipie-rails.rb +2 -1
  43. data/lib/generators/apipie/views_generator.rb +11 -0
  44. data/lib/tasks/apipie.rake +28 -2
  45. data/spec/controllers/api/v2/nested/resources_controller_spec.rb +11 -0
  46. data/spec/controllers/apipies_controller_spec.rb +16 -0
  47. data/spec/controllers/concerns_controller_spec.rb +42 -0
  48. data/spec/controllers/users_controller_spec.rb +196 -47
  49. data/spec/dummy/app/controllers/api/v1/architectures_controller.rb +14 -3
  50. data/spec/dummy/app/controllers/api/v2/architectures_controller.rb +1 -3
  51. data/spec/dummy/app/controllers/api/v2/nested/architectures_controller.rb +32 -0
  52. data/spec/dummy/app/controllers/api/v2/nested/resources_controller.rb +33 -0
  53. data/spec/dummy/app/controllers/concerns/sample_controller.rb +41 -0
  54. data/spec/dummy/app/controllers/concerns_controller.rb +8 -0
  55. data/spec/dummy/app/controllers/users_controller.rb +51 -7
  56. data/spec/dummy/config/routes.rb +2 -1
  57. data/spec/dummy/doc/users/desc_from_file.md +1 -0
  58. data/spec/lib/application_spec.rb +49 -0
  59. data/spec/lib/method_description_spec.rb +28 -5
  60. data/spec/lib/param_description_spec.rb +216 -6
  61. data/spec/lib/param_group_spec.rb +45 -0
  62. data/spec/lib/rake_spec.rb +68 -0
  63. data/spec/lib/resource_description_spec.rb +27 -7
  64. data/spec/lib/validator_spec.rb +55 -0
  65. data/spec/spec_helper.rb +2 -1
  66. data/spec/support/rake.rb +21 -0
  67. metadata +90 -21
  68. data/.rvmrc +0 -1
  69. data/CHANGELOG +0 -16
  70. data/Gemfile.lock +0 -122
data/.gitignore CHANGED
@@ -5,3 +5,7 @@ spec/dummy/db/*.sqlite3
5
5
  spec/dummy/log/*.log
6
6
  spec/dummy/tmp/
7
7
  .idea
8
+ Gemfile*.lock
9
+ .rvmrc
10
+
11
+ .DS_Store
data/.travis.yml CHANGED
@@ -1,5 +1,10 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 1.8.7
4
- - 1.9.2
5
3
  - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
6
+ gemfile:
7
+ - Gemfile.rails30
8
+ - Gemfile.rails32
9
+ - Gemfile.rails40
10
+ - Gemfile.rails41
data/CHANGELOG.md ADDED
@@ -0,0 +1,97 @@
1
+ ===========
2
+ Changelog
3
+ ===========
4
+
5
+ v0.1.0
6
+ ------
7
+
8
+ * middleware for computing Apipie checksum for [dynamic bindings](https://github.com/Apipie/apipie-bindings) [#215](https://github.com/Apipie/apipie-rails/pull/215) [@mbacovsky][]
9
+ * `api_base_url` inherited properly [#214](https://github.com/Apipie/apipie-rails/pull/214) [@mbacovsky][]
10
+ * ability to hide specific parameters [#208](https://github.com/Apipie/apipie-rails/pull/208) [@nathanhoel][]
11
+ * fix for SafeYAML compatibility [#207](https://github.com/Apipie/apipie-rails/pull/207) [@pivotalshiny][]
12
+ * option to show all examples in the documentation [#203](https://github.com/Apipie/apipie-rails/pull/203) [@pivotalshiny][]
13
+ * support for array of hashes validation [#189](https://github.com/Apipie/apipie-rails/pull/189) [@mtparet][]
14
+ * support for saving the values based on documentation into `@api_params` variable [#188](https://github.com/Apipie/apipie-rails/pull/188) [@mtparet][]
15
+ * support for json generated from rake task `rake apipie:static_json` [#186](https://github.com/Apipie/apipie-rails/pull/186) [@mtparet][]
16
+ * fix `undefined method 'has_key?' for nil:NilClass` when validating Hash against non-hash value [#185](https://github.com/Apipie/apipie-rails/pull/185) [@mtparet][]
17
+ * fix NoMethorError when validating Hash against non-hash value [#183](https://github.com/Apipie/apipie-rails/pull/183) [@nathanhoel][]
18
+ * support for metadata for params [#181](https://github.com/Apipie/apipie-rails/pull/181) [@tstrachota][]
19
+ * fix camelization of class names [#170](https://github.com/Apipie/apipie-rails/pull/170) [@yonpols][]
20
+ * new array class validator [#169](https://github.com/Apipie/apipie-rails/pull/169) [@mkrajewski][]
21
+
22
+ v0.0.24
23
+ -------
24
+
25
+ * fix DOS vulnerability for running in production without use_cache
26
+ * ability to load descriptions from external files
27
+ * improved examples extractor
28
+ * fixed deprecation warnings in Rails 4
29
+ * using StandardError instead of Exception for errors
30
+
31
+ v0.0.23
32
+ -------
33
+
34
+ * fix exceptions on unknown validator
35
+ * fix concerns substitution in parameters
36
+ * possibility to authenticate the API doc
37
+ * support for array in api_controllers_matcher
38
+
39
+ v0.0.22
40
+ -------
41
+
42
+ * fix "named_resources" option
43
+ * fix generating static files when concerns used
44
+
45
+ v0.0.21
46
+ -------
47
+
48
+ * fix RDoc 4.0 compatibility issue
49
+ * ``validate_value`` and ``validate_presence`` options for better
50
+ validation granularity
51
+
52
+ v0.0.20
53
+ -------
54
+
55
+ * namespaced resources - prevent collisions when one resource defined
56
+ in more modules
57
+ * ``Apipie::DSL::Concern`` for being able to use the DSL in module
58
+ that is included into controllers
59
+
60
+ v0.0.19
61
+ -------
62
+
63
+ * fix examples recording when resource_id is set
64
+ * use safe_yaml for loading examples file when available
65
+
66
+ v0.0.18
67
+ -------
68
+
69
+ * ``param_group`` and ``def_param_group`` keywords
70
+ * ``:action_aware`` options for reusing param groups for create/update actions
71
+
72
+ v0.0.17
73
+ -------
74
+
75
+ * support for multiple see links at action and ability to provide
76
+ description of see links
77
+
78
+ v0.0.16
79
+ -------
80
+
81
+ * Fix getting started being rendered even when documentation was available
82
+
83
+ v0.0.15
84
+ -------
85
+
86
+ * Fix case when there is no documentation yet: with link to how to
87
+ start
88
+ * Fix handling bad requests when cache is on
89
+ * Fix params extractor in case there is already some documentation
90
+
91
+ [@mbacovsky]: https://github.com/mbacovsky
92
+ [@tstrachota]: https://github.com/tstrachota
93
+ [@nathanhoel]: https://github.com/nathanhoel
94
+ [@pivotalshiny]: https://github.com/pivotalshiny
95
+ [@mtparet]: https://github.com/mtparet
96
+ [@yonpols]: https://github.com/yonpols
97
+ [@mkrajewski]: https://github.com/mkrajewski
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
data/Gemfile.rails30 ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rails', '~> 3.0.0'
data/Gemfile.rails32 ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rails', '~> 3.2.0'
data/Gemfile.rails40 ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rails', '~> 4.0.0'
data/Gemfile.rails41 ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem 'rails', '~> 4.1.0.beta'