merge_params 0.4.2 → 0.5.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: 01063ec1c21ddfa54b1e23325be36ce1fe86dcea
4
- data.tar.gz: 7119ef72e5aa76760f1330efe684da9529a060ee
2
+ SHA256:
3
+ metadata.gz: d43d9cf3df4fb81e7b97db8b9a4881983d93c76fd2a2c62da80afae6209cae95
4
+ data.tar.gz: b76c110bc2145c68e4f7d7eb33b39c5b2264a84e1dcf96828bb378c6e53d5251
5
5
  SHA512:
6
- metadata.gz: 23b3730b8c340aa2b85b3b671287b15c106fd5dc25ac8839fea7764dd0f135fcddcef34a6180e2e5b25590e34f495c0d6ba75abb1fd959fc4fb07020b9bee071
7
- data.tar.gz: cf7704f58636d5215cfd242a59ce0ba0341df05bf61b61dad6de76820a129ddb22f813c0eff4200512d0888837f488b3565d8066163bbe76391c431b357039f1
6
+ metadata.gz: 1630b02c9715804035906a2c29994352f9cdbacfd61c398df1ed2c2afb0672d01fe7f5f442d2a5cda371cd98ae881207dd9126a61aaf0258dd11f93e80e17b2f
7
+ data.tar.gz: 82c2373090cd74310668114f6ea0b4742d66955d2c329b8c4c4f9377dce402aa377cd608eed8975b0ab2757db744b2ded9b35dc04fa3cc8347d965fb13cdea51
@@ -5,6 +5,11 @@ recommendations of [keepachangelog.com](http://keepachangelog.com/).
5
5
 
6
6
  ## (Unreleased)
7
7
 
8
+ ## 0.5.0 (2020-08-25)
9
+ - Change the order of arguments for `add_params` to `add_params(url, query_params_to_add)`.
10
+ This feels more natural, since you are adding the new query params to the _end_ of the given URL.
11
+ It is also more consistent with the Rails route helpers, like `something_path(query_params_to_add)`.
12
+
8
13
  ## 0.4.2 (2019-02-10)
9
14
  - Fix `merge_url_for` to not pass on reserved options like only_path (which were only intended for
10
15
  consumption by `url_for`) to `add_params`. It was adding it to the end of the URL, like
data/License CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2018 Tyler Rick
1
+ Copyright (c) 2020 Tyler Rick
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
4
  associated documentation files (the "Software"), to deal in the Software without restriction,
@@ -104,12 +104,12 @@ module MergeParams::Helpers
104
104
  [k, v]
105
105
  end
106
106
  }
107
- add_params(query_params_to_add, url)
107
+ add_params(url, query_params_to_add)
108
108
  end
109
109
 
110
110
  # Adds params to the query string
111
111
  # (Unlike url_for_merge, which tries to generate a route from the params.)
112
- def add_params(new_params = {}, url = request.fullpath)
112
+ def add_params(url = request.fullpath, new_params = {})
113
113
  uri = URI(url)
114
114
  # Allow keys that are currently in query_params to be deleted by setting their value to nil in
115
115
  # new_params (including in nested hashes).
@@ -1,5 +1,5 @@
1
1
  module MergeParams
2
2
  def self.version
3
- "0.4.2"
3
+ "0.5.0"
4
4
  end
5
5
  end
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "actionpack", [">= 4.2", "< 5.3"]
32
32
  spec.add_dependency "facets"
33
33
 
34
- spec.add_development_dependency "bundler", "~> 1.17"
34
+ spec.add_development_dependency "bundler", "~> 2"
35
35
  spec.add_development_dependency "rake", "~> 10.0"
36
36
  spec.add_development_dependency "rspec", "~> 3.0"
37
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merge_params
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Rick
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-11 00:00:00.000000000 Z
11
+ date: 2020-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: '1.17'
73
+ version: '2'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: '1.17'
80
+ version: '2'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: rake
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -150,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.6.14.3
153
+ rubygems_version: 3.1.2
155
154
  signing_key:
156
155
  specification_version: 4
157
156
  summary: Safely merge params for use with url_for or for the query string