fictium 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 942b491567ad199b83676dd568a341e12d02a8fec6486dc7a835ea996e785653
4
- data.tar.gz: 402d88c43fcc7fa645717dd6c4ebc2da8fa75dcc8f97b3ce8df0e8de635b9e8b
3
+ metadata.gz: 5934206031e83692052ec6d5184d6c0ea7a040f5a7c859d274eb9101daa664f4
4
+ data.tar.gz: feaf049eee613925b0b3c14dcbaadb3a6a3c4f3e051b265853db873729e8ce37
5
5
  SHA512:
6
- metadata.gz: 37a4e5776157dea3d682a88c1086ad8fbd861f98382b28b039e2f09d14d4b0081838b176112debc09b7b74428030462a50cf6a421b8afd9dbf179e1c273e40ac
7
- data.tar.gz: 919c22475150deec51aa1ad053fa178f98389311b6f68fe9689d5b58a23b67c0f6552e29dc11ea18f796d3b3d2603b30792b9d92abf49c0834c472f085f1c5ee
6
+ metadata.gz: 2ecc05097ef9652469e114db2fbb484a957afbb49b80feedbbb00dac03b0e47db441dac08a8694de1b0cc6cafa25ccfa00d90d6f375343bcec4d48f91e74a9bc
7
+ data.tar.gz: bf81849ffcafd6bc42c94b3ed06fedf1f2959c74a333ee2268e7cc02c8379f564512f4d0e2e8bf845f9aeb89d69ba6ce7a4c3d21373a3b26eaa360196f8fceb0
data/CHANGELOG.md CHANGED
@@ -17,6 +17,22 @@
17
17
 
18
18
  ## LOG
19
19
 
20
+ ### 0.3.2 (2019-11-12)
21
+
22
+ Use path parameters instead of formatting path.
23
+
24
+ #### Changes
25
+
26
+ - Use path parameters instead of formatting path.
27
+
28
+ ### 0.3.1 (2019-11-12)
29
+
30
+ Added support for rails 5.1
31
+
32
+ #### Changes
33
+
34
+ - Add support for older Rails versions.
35
+
20
36
  ### 0.3.0 (2019-11-12)
21
37
 
22
38
  New exporter: Postman.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fictium (0.3.1)
4
+ fictium (0.3.2)
5
5
  activesupport (>= 5.1, < 6.2)
6
6
  json-schema (~> 2.8)
7
7
  verbs (~> 2.1.4)
@@ -3,7 +3,7 @@ module Fictium
3
3
  module Autocomplete
4
4
  module Params
5
5
  REQUEST_SECTIONS = %i[query header path cookie].freeze
6
- PATH_TEMPLATE = /{([A-Z_\-][A-Z0-9_\-]*)}/i.freeze
6
+ IGNORED_PATH_PARAMETERS = %i[action controller].freeze
7
7
 
8
8
  class << self
9
9
  def extract_from_request(action, request)
@@ -47,10 +47,12 @@ module Fictium
47
47
  end
48
48
  end
49
49
 
50
- def parse_request_path(params, action, _request)
51
- action.full_path.scan(PATH_TEMPLATE).flatten.each do |name|
50
+ def parse_request_path(params, _action, request)
51
+ request.path_parameters.except(*IGNORED_PATH_PARAMETERS).each do |name, value|
52
52
  params[name] ||= {}
53
- # TODO: Extract example from request
53
+ params[name].merge!(
54
+ example: value
55
+ )
54
56
  end
55
57
  end
56
58
 
@@ -1,5 +1,5 @@
1
1
  module Fictium
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  RAILS_MIN_VERSION = '>= 5.1'.freeze
4
4
  RAILS_MAX_VERSION = '< 6.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fictium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ramiro Rojo