open_fda_api 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10a12a605aa07fbd3dfa75f7fdb9e909fc9eaa7b18f2add3449db666110c7d3f
4
- data.tar.gz: 79207bf839e4a82f2a6a1f374645cc4e2a25cfa2923d4726aaf856d779b667dd
3
+ metadata.gz: c2a7513c32091c436f4641cf0e32a64b51e0ad8ae1f600579a54526c868ece7c
4
+ data.tar.gz: 797198f936396fbe4a1610996ab7a58fe2fc744017ed4634c0347f345659ce15
5
5
  SHA512:
6
- metadata.gz: 1a172a5bd14024af9dff624f3bf0c5cd22d09cb43cd7b5901b43d7b328e88d6cfbbabc8097be14ec456fe64b4e6ff661334687c24cb7141f217be52b4808ccfd
7
- data.tar.gz: 375be0de9fbf21279fd5b0d00ebd16375455d99a3d1e672bfc6cdf3373aa04c3cc2c824b7deddb6104c8b39856365b2a54c8ef5ae04243682d830a72782f04f3
6
+ metadata.gz: 468e135f99f59470fdad06055b1849978f9b95fe40aa4b415a8b9485ecc6a17fa4b18f23a06e233dd108f193e5cf2ef335756e327be8ecf5eebd94fd2b8ccb4a
7
+ data.tar.gz: 2d42fdf47f92181a0d4ebaaaae6eab84c8d5e868ffec47fd2cfa30b41e66ac036bd2c0bb9cdf40eaf0fc1b5f597ad16921a786c5a883c60561a81f594b989556
data/.rubocop.yml CHANGED
@@ -12,3 +12,7 @@ Style/StringLiteralsInInterpolation:
12
12
 
13
13
  Layout/LineLength:
14
14
  Max: 120
15
+
16
+ Metrics/BlockLength:
17
+ Exclude:
18
+ - spec/**/*
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.0.2] - 2022-01-19
3
+ ## [0.0.4] - 2022-01-19
4
+ - Fix version string in changelog
5
+ - Update Query Builder to group search arguments properly
6
+ - Update Query Builder to replace spaces with pluses in search values as openFDA API documentation requires
7
+
8
+ ## [0.0.3] - 2022-01-19
4
9
  - Update version again because CHANGELOG wasn't updated along with the 0.0.2 release.
5
10
 
6
11
  ## [0.0.2] - 2022-01-19
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- open_fda_api (0.0.1)
4
+ open_fda_api (0.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -42,13 +42,9 @@ module OpenFdaApi
42
42
  def build_search_string(search)
43
43
  return "" if search.empty?
44
44
 
45
- value = if search.count == 1 # AND case
46
- # Turns [{a: b, c: d}] into "a:b+AND+c:d"
47
- search.first.map { |k, v| "#{k}:#{v}" }.join("+AND+")
48
- else # OR case
49
- # Turns [{a: b}, {c: d}] into "a:b+c:d"
50
- search.map { |h| "#{h.keys.first}:#{h.values.first}" }.join("+")
51
- end
45
+ value = search.map do |and_args|
46
+ "(#{and_args.map { |k, v| "#{k}:#{v.gsub(" ", "+")}" }.join("+AND+")})"
47
+ end.join("+")
52
48
 
53
49
  "search=#{value}"
54
50
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OpenFdaApi
4
- VERSION = "0.0.3"
4
+ VERSION = "0.0.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_fda_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hebron George