rx_nav 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
2
  SHA1:
3
- metadata.gz: 8367470122958506ce71097193a6cf0412337350
4
- data.tar.gz: 09ab00eadee63525cffff3503bd2b6cf727c6692
3
+ metadata.gz: 6e4ae8296ad4f2a1eb5afd6e612681da3050adb0
4
+ data.tar.gz: 6e99a01bdb195df9e40f7370317cdc0f1ac7f3bf
5
5
  SHA512:
6
- metadata.gz: bd3d4a99fbddfe32604451cbe3a59f94de135ba097d4cf15637220bf403e08260f619bea1ab0d7b6109a48630ac982ef6c49f56400356966c917e6cd55982030
7
- data.tar.gz: 90540aea81270a5926f35808add76a13add19e980a9a2c43d5634e0883973c2b52148344ed6e5c58297d029abd69c8a059ed3685ba45b9d87d2a7d9a18742892
6
+ metadata.gz: 4c3df2fc862784274df58166c49a615c5cd44eb7867bef3f8e136518b9408df02698701c130c93dedadff529b3f030bc0e5270b5607e496da6d2a0225ff75c1e
7
+ data.tar.gz: 37d8907feb8fa275286c5ef46f612f20c2cf2d3124fc481a5f35c365d09f255b4d19b7121fbcfdbc52f9f1df0a2f8ad0384328ede68cac12bb2d7aa36e4bd442
data/lib/rx_nav.rb CHANGED
@@ -20,7 +20,7 @@ module RxNav
20
20
 
21
21
  def self.make_request query
22
22
  encoded_query = URI.encode(query)
23
- request = URI.parse('http://rxnav.nlm.nih.gov/REST' + encoded_query)
23
+ request = URI.parse("https://rxnav.nlm.nih.gov/REST#{encoded_query}")
24
24
  return RxNav.nori.parse(Net::HTTP.get request)
25
25
  end
26
26
 
@@ -104,6 +104,12 @@ module RxNav
104
104
  property id, "available_strength"
105
105
  end
106
106
 
107
+ def display_names
108
+ query = "/displaynames"
109
+ display_terms_list = get_response_hash(query)[:display_terms_list]
110
+ display_terms_list ? display_terms_list[:term] : nil
111
+ end
112
+
107
113
  private
108
114
 
109
115
  def get_response_hash query
@@ -1,3 +1,3 @@
1
1
  module RxNav
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/rx_nav.gemspec CHANGED
@@ -18,10 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'nori'
21
+ spec.add_dependency 'nori', '>= 2.0.0'
22
22
  spec.add_dependency 'nokogiri'
23
23
 
24
24
  spec.add_development_dependency 'bundler', '~> 1.3'
25
25
  spec.add_development_dependency 'rake'
26
- spec.add_development_dependency 'rspec', '>= 2.0.0'
26
+ spec.add_development_dependency 'rspec', '>= 3.0.0'
27
27
  end
data/spec/rx_nav_spec.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "http://rxnav.nlm.nih.gov/REST" do
3
+ describe "https://rxnav.nlm.nih.gov/REST" do
4
4
  before :all do
5
- @url = URI "http://rxnav.nlm.nih.gov/REST/json"
5
+ @url = URI "https://rxnav.nlm.nih.gov/REST/json"
6
6
  @response = Net::HTTP.get(@url)
7
7
  @json = JSON.parse(@response)
8
8
  end
data/spec/rx_norm_spec.rb CHANGED
@@ -5,7 +5,7 @@ require 'support/array_type'
5
5
  describe RxNav::RxNorm do
6
6
 
7
7
  describe "remote endpoints" do
8
- url = "http://rxnav.nlm.nih.gov/REST"
8
+ url = "https://rxnav.nlm.nih.gov/REST"
9
9
  response = Net::HTTP.get(URI("#{url}/json"))
10
10
  subject { JSON.parse(response)["resourceList"]["resource"] }
11
11
 
@@ -17,7 +17,8 @@ describe RxNav::RxNorm do
17
17
  "#{url}/spellingsuggestions?name=yourName",
18
18
  "#{url}/rxcui/{rxcui}/status",
19
19
  "#{url}/rxcui/{rxcui}/properties",
20
- "#{url}/rxcui/{rxcui}/property?propName=propName"
20
+ "#{url}/rxcui/{rxcui}/property?propName=propName",
21
+ "#{url}/displaynames",
21
22
  ]
22
23
  end
23
24
 
@@ -89,4 +90,10 @@ describe RxNav::RxNorm do
89
90
  it { is_expected.to be_kind_of(OpenStruct) }
90
91
  end
91
92
 
93
+ describe "#display_names" do
94
+ subject { RxNav::RxNorm.display_names }
95
+
96
+ include_examples "should be an array of", String
97
+ it { is_expected.to include("acetaminophen") }
98
+ end
92
99
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rx_nav
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
  - Jonathan Bender
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-02 00:00:00.000000000 Z
11
+ date: 2016-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nori
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 2.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 2.0.0
75
+ version: 3.0.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 2.0.0
82
+ version: 3.0.0
83
83
  description: Ruby wrappers for the RxNav RESTful APIs
84
84
  email:
85
85
  - jlbender@gmail.com
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.2.2
131
+ rubygems_version: 2.4.8
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Ruby-based way of interacting with the RxNav APIs (http://rxnav.nlm.nih.gov/APIsOverview.html)