renalware-core 2.0.0.pre.rc7 → 2.0.0.pre.rc8

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
  SHA256:
3
- metadata.gz: fe0192f8e977702f2adbf2a0f2893b3552b9e6bd573f721208e0250e03e03312
4
- data.tar.gz: 87a77ba05e6a2dfb83cddbdb4d1d2de1bfe19aaf2c50515e57677db00588f7d5
3
+ metadata.gz: d927fd26b8733bc5ec33cdc73b99b5dfffd2153a0ad5d2cad076f94594faefd1
4
+ data.tar.gz: bf774fb154de01725b0322f3a149a40d691dfe81eb6d38880f72f1329ad48303
5
5
  SHA512:
6
- metadata.gz: 3f6ef5e4f2f0fc65a67b0d6cb9c649685ec7ed98db4b0129a1ffb5f96d566e6a283f1fd436cff669188cd34778561b696f2a68c86b9d539790131110b6705e00
7
- data.tar.gz: e61ff85f88683a31976a64dc74dfd65be9250168c7de67225c73db358591b387cef1f8add0ddb9bbf08cb6ade2becdbcc8e4f142de7c6893f4bde1c412dd027d
6
+ metadata.gz: b5d0501d2a554f92f4f97048b46d52800e5a0eceaed4cbf0476114f650e628de804879ed4b71fd79c7e3bea794d1b1063af800819dc173392d50f75e897c83eb
7
+ data.tar.gz: 1cff8fa1d608fbdd588d63632001490c149dd2ef7d1e9d84784c6db6366996a248c86a5f23b5c00bc1c61255411a23ba3954c34560bb1716f3c5f4e9cf965eb7
@@ -35,50 +35,62 @@
35
35
  # If tags are encountered multiple times, their blocks will be called multiple times.
36
36
 
37
37
  require "nokogiri"
38
+ require_dependency "renalware/feeds"
38
39
 
39
- class XmlParser
40
- def initialize(node, &block)
41
- @node = node
42
- @node.each do
43
- self.instance_eval(&block)
44
- end
45
- end
40
+ # Note I moved XmlParse into this namespace as I was getting strange
41
+ # 'uninitialised constant XmlParser' errors in production when it was in /lib
46
42
 
47
- def name
48
- @node.name
49
- end
43
+ module Renalware
44
+ module Feeds
45
+ module Files
46
+ module Practices
47
+ class XmlParser
48
+ def initialize(node, &block)
49
+ @node = node
50
+ @node.each do
51
+ self.instance_eval(&block)
52
+ end
53
+ end
50
54
 
51
- def inner_xml
52
- @node.inner_xml.strip
53
- end
55
+ def name
56
+ @node.name
57
+ end
54
58
 
55
- def is_start?
56
- @node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
57
- end
59
+ def inner_xml
60
+ @node.inner_xml.strip
61
+ end
58
62
 
59
- def is_end?
60
- @node.node_type == Nokogiri::XML::Reader::TYPE_END_ELEMENT
61
- end
63
+ def is_start?
64
+ @node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
65
+ end
62
66
 
63
- def attribute(attribute)
64
- @node.attribute(attribute)
65
- end
67
+ def is_end?
68
+ @node.node_type == Nokogiri::XML::Reader::TYPE_END_ELEMENT
69
+ end
66
70
 
67
- def for_element(name, &block)
68
- return unless self.name == name and is_start?
69
- self.instance_eval(&block)
70
- end
71
+ def attribute(attribute)
72
+ @node.attribute(attribute)
73
+ end
74
+
75
+ def for_element(name, &block)
76
+ return unless self.name == name and is_start?
77
+ self.instance_eval(&block)
78
+ end
71
79
 
72
- def inside_element(name=nil, &block)
73
- return if @node.self_closing?
74
- return unless name.nil? or (self.name == name and is_start?)
80
+ def inside_element(name=nil, &block)
81
+ return if @node.self_closing?
82
+ return unless name.nil? or (self.name == name and is_start?)
75
83
 
76
- name = @node.name
77
- depth = @node.depth
84
+ name = @node.name
85
+ depth = @node.depth
78
86
 
79
- @node.each do
80
- return if self.name == name and is_end? and @node.depth == depth
81
- self.instance_eval(&block)
87
+ @node.each do
88
+ return if self.name == name and is_end? and @node.depth == depth
89
+ self.instance_eval(&block)
90
+ end
91
+ end
92
+ end
93
+ end
82
94
  end
83
95
  end
84
96
  end
@@ -18,8 +18,7 @@ module Renalware
18
18
  if config.allow_external_mail
19
19
  practice&.email # nil is acceptable
20
20
  else
21
- user_email = letter.updated_by&.email
22
- user_email.presence || config.fallback_email_address_for_test_messages
21
+ config.fallback_email_address_for_test_messages
23
22
  end
24
23
  end
25
24
  end
@@ -7,7 +7,7 @@ module Renalware
7
7
  end
8
8
 
9
9
  def unzip
10
- Dir.mktmpdir do |dir|
10
+ Dir.mktmpdir(nil, Rails.root.join("tmp").to_s) do |dir|
11
11
  files = unzip_to_tmp_dir_and_return_pathames_array(dir)
12
12
  yield(files)
13
13
  end
@@ -47,7 +47,7 @@ module Renalware
47
47
  config_accessor(:fallback_email_address_for_test_messages) do
48
48
  ENV["FALLBACK_EMAIL_ADDRESS_FOR_TEST_MESSAGES"]
49
49
  end
50
- config_accessor(:ukrdc_sending_facility_name) { "NOT_CONFIGURED" }
50
+ config_accessor(:ukrdc_sending_facility_name) { ENV["UKRDC_SENDING_FACILITY_NAME"] }
51
51
  end
52
52
 
53
53
  def self.config
@@ -1,3 +1,3 @@
1
1
  module Renalware
2
- VERSION = "2.0.0.pre.rc7".freeze
2
+ VERSION = "2.0.0.pre.rc8".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renalware-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.rc7
4
+ version: 2.0.0.pre.rc8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airslie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-29 00:00:00.000000000 Z
11
+ date: 2018-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -1345,6 +1345,7 @@ files:
1345
1345
  - app/models/renalware/feeds/files/practices/csv_organisation.rb
1346
1346
  - app/models/renalware/feeds/files/practices/import_csv.rb
1347
1347
  - app/models/renalware/feeds/files/practices/import_job.rb
1348
+ - app/models/renalware/feeds/files/practices/xml_parser.rb
1348
1349
  - app/models/renalware/feeds/files/primary_care_physicians/import_csv.rb
1349
1350
  - app/models/renalware/feeds/files/primary_care_physicians/import_job.rb
1350
1351
  - app/models/renalware/feeds/files/tissue_typing/import.rb
@@ -3218,7 +3219,6 @@ files:
3218
3219
  - lib/test_support/ajax_helpers.rb
3219
3220
  - lib/test_support/autocomplete_helpers.rb
3220
3221
  - lib/test_support/text_editor_helpers.rb
3221
- - lib/xml_parser.rb
3222
3222
  - spec/factories/accesses/patients.rb
3223
3223
  - spec/factories/accesses/plans.rb
3224
3224
  - spec/factories/accesses/plans_types.rb