requestor 0.1.3 → 0.1.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.
Files changed (2) hide show
  1. data/lib/requestor.rb +4 -3
  2. metadata +1 -1
data/lib/requestor.rb CHANGED
@@ -4,11 +4,12 @@
4
4
 
5
5
  require 'open-uri'
6
6
  require 'net/http'
7
- require 'dynarex'
7
+ require 'rexml/document'
8
8
 
9
9
  class Requestor
10
10
 
11
11
  class Filex
12
+ include REXML
12
13
 
13
14
  attr_reader :code
14
15
 
@@ -38,7 +39,7 @@ class Requestor
38
39
 
39
40
  if url.file_list? then
40
41
  @file_list = true
41
- @dynarex = Dynarex.new(url)
42
+ @doc = Document.new(open(url, 'UserAgent' => 'Ruby-REXML').read)
42
43
  end
43
44
  end
44
45
 
@@ -46,7 +47,7 @@ class Requestor
46
47
 
47
48
  unless @names.include? file then
48
49
  if @file_list then
49
- url = @dynarex.records[file][:body][:url]
50
+ url = XPath.first(@doc.root, "records/file[name='#{file}']/url/text()").to_s
50
51
  else
51
52
  file += '.rb' unless file[/\.rb$/]
52
53
  url = @url + file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: requestor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors: []
7
7