despecable 0.2.0 → 0.3.0

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
- SHA1:
3
- metadata.gz: 844167e9ba0dad9d3420d9da0055e5f03429a173
4
- data.tar.gz: c6e592b5c7b15ff362e6544435313f55a842a595
2
+ SHA256:
3
+ metadata.gz: 27abde4ea35465717dd657bc7243ecd69d5060a266531a444db7a1193ca5ba5d
4
+ data.tar.gz: 85bac7c82642febacbbb55aa1dddbd7673ae5fc921741da3f9d49d8ac097424b
5
5
  SHA512:
6
- metadata.gz: b3e960887d49d22504ac2d2085a0719dec32ea74dcb0750f780b855399635c0f1e54acbf92d0f266cd76831071e23ab8b81fc511a413ac4f61608db294464042
7
- data.tar.gz: 789378ab03e1ff0e829c36255c8d6b76c0826124db5737012e60bf7fc1749cf643d46882f064513c1ff2b7e884b1aac454ad489c1b111a4487db2133900cbf68
6
+ metadata.gz: 2de10da5e0c3743cbb77e3bf3668f6e30015f05c7ca8d5d54c80715f16b24a8bbf3d27a6e7b39c53e691dadaf0c03770062e2bebf303fc194c2ac88be72e4556
7
+ data.tar.gz: 060645f9d637a3028c3dee97ea8850444e2f4b88cb2e178a998955b0893bd77bc7010e2dda5a552d2f2e9e7c599cccfc8739f9b2d462979539cbb1330f61ff04
@@ -1,16 +1,24 @@
1
1
  module Despecable
2
2
  module ActionController
3
3
  def despec(*args, strict: false, &blk)
4
- despecable_me(params.deep_dup).doit(*args, strict: strict, &blk)
4
+ despecable_me(params.dup).doit(*args, strict: strict, &blk)
5
5
  end
6
6
 
7
7
  def despec!(*args, &blk)
8
8
  despec(*args, &blk)
9
- params.merge!(despecable_me.params)
9
+ # Loop in place of merge due to unpermitted params restriction
10
+ despecable_me.params.each do |key, val|
11
+ params[key] = val
12
+ end
10
13
  end
11
14
 
12
15
  def despecable_me(params = {})
13
- @despecable_me ||= Despecable::Me.new(params, request.query_parameters.merge(request.request_parameters))
16
+ supplied_params = request.query_parameters.dup
17
+ # Loop in place of merge due to unpermitted params restriction
18
+ request.request_parameters.each do |key, val|
19
+ supplied_params[key] = val
20
+ end
21
+ @despecable_me ||= Despecable::Me.new(params, supplied_params)
14
22
  end
15
23
  end
16
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: despecable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Schwartz
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.10.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: actionpack
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Write self-documenting parameter validation and type-casting in your
42
56
  API actions. Docs and development at https://github.com/ozydingo/despecable.
43
57
  email: ozydingo@gmail.com
@@ -74,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
88
  - !ruby/object:Gem::Version
75
89
  version: '0'
76
90
  requirements: []
77
- rubyforge_project:
78
- rubygems_version: 2.6.13
91
+ rubygems_version: 3.0.1
79
92
  signing_key:
80
93
  specification_version: 4
81
94
  summary: Easy self-documenting parameter specifications for API routes in Rails